@orkestrel/scaffold 0.0.115 → 0.0.116

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.
Files changed (70) hide show
  1. package/dist/bin/main.js +137 -15
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +1 -1
  4. package/dist/host/claude/agents/orkestrel.md +1 -1
  5. package/dist/host/claude/rules/names.md +3 -1
  6. package/dist/host/guides/abort.md +17 -17
  7. package/dist/host/guides/agent.md +445 -445
  8. package/dist/host/guides/brief.md +143 -143
  9. package/dist/host/guides/browser.md +731 -731
  10. package/dist/host/guides/budget.md +39 -39
  11. package/dist/host/guides/capture.md +298 -298
  12. package/dist/host/guides/console.md +109 -109
  13. package/dist/host/guides/contract.md +335 -335
  14. package/dist/host/guides/csv.md +30 -30
  15. package/dist/host/guides/database.md +163 -163
  16. package/dist/host/guides/emitter.md +17 -17
  17. package/dist/host/guides/form.md +99 -99
  18. package/dist/host/guides/guide.md +361 -183
  19. package/dist/host/guides/html.md +49 -49
  20. package/dist/host/guides/indexeddb.md +40 -40
  21. package/dist/host/guides/interpret.md +139 -139
  22. package/dist/host/guides/lsp.md +114 -114
  23. package/dist/host/guides/markdown.md +68 -68
  24. package/dist/host/guides/mcp.md +3745 -3745
  25. package/dist/host/guides/middleware.md +170 -170
  26. package/dist/host/guides/msg.md +95 -95
  27. package/dist/host/guides/ndjson.md +8 -8
  28. package/dist/host/guides/ollama.md +56 -56
  29. package/dist/host/guides/pool.md +21 -21
  30. package/dist/host/guides/probe.md +82 -82
  31. package/dist/host/guides/process.md +99 -99
  32. package/dist/host/guides/program.md +98 -96
  33. package/dist/host/guides/qualifier.md +70 -70
  34. package/dist/host/guides/queue.md +37 -37
  35. package/dist/host/guides/rater.md +38 -38
  36. package/dist/host/guides/reason.md +308 -308
  37. package/dist/host/guides/relation.md +50 -50
  38. package/dist/host/guides/router.md +58 -58
  39. package/dist/host/guides/scaffold.md +554 -419
  40. package/dist/host/guides/sea.md +128 -128
  41. package/dist/host/guides/server.md +100 -100
  42. package/dist/host/guides/sqlite.md +28 -28
  43. package/dist/host/guides/sse.md +20 -20
  44. package/dist/host/guides/study.md +444 -444
  45. package/dist/host/guides/table.md +82 -82
  46. package/dist/host/guides/template.md +41 -41
  47. package/dist/host/guides/terminal.md +121 -121
  48. package/dist/host/guides/test.md +273 -273
  49. package/dist/host/guides/timeout.md +18 -18
  50. package/dist/host/guides/tool.md +27 -27
  51. package/dist/host/guides/toolbox.md +166 -166
  52. package/dist/host/guides/websocket.md +54 -54
  53. package/dist/host/guides/worker.md +24 -24
  54. package/dist/host/guides/workflow.md +187 -187
  55. package/dist/host/guides/workspace.md +55 -55
  56. package/dist/host/manifest.json +55 -55
  57. package/dist/host/tests/setupPolicy.ts +5 -3
  58. package/dist/src/core/index.cjs +89 -3
  59. package/dist/src/core/index.cjs.map +1 -1
  60. package/dist/src/core/index.d.cts +229 -144
  61. package/dist/src/core/index.d.ts +229 -144
  62. package/dist/src/core/index.js +87 -4
  63. package/dist/src/core/index.js.map +1 -1
  64. package/dist/src/server/index.cjs +292 -66
  65. package/dist/src/server/index.cjs.map +1 -1
  66. package/dist/src/server/index.d.cts +188 -6
  67. package/dist/src/server/index.d.ts +188 -6
  68. package/dist/src/server/index.js +287 -69
  69. package/dist/src/server/index.js.map +1 -1
  70. package/package.json +4 -3
@@ -45,20 +45,20 @@ call-signature members are documented under [`## Methods`](#methods). `Success`,
45
45
  [`contract.md`](contract.md)); this package's `success` / `failure` / `isSuccess` / `isFailure`
46
46
  wrap them and do not re-export the types.
47
47
 
48
- | Type | Kind | Shape | Summary |
48
+ | Name | Kind | Signature | Summary |
49
49
  | --------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
50
50
  | `MSGEncoding` | type | `'utf-8' \| 'utf-16le' \| 'windows-1252' \| 'latin1'` | Names a supported text encoding for decoding non-Unicode MSG strings and MIME part bodies. |
51
51
  | `MSGErrorCode` | type | `'UNSUPPORTED' \| 'MALFORMED' \| 'CYCLE' \| 'RANGE' \| 'BURN'` | Names a machine-readable classification for an `MSGError`. |
52
52
  | `MSGFieldType` | type | `'string' \| 'unicode' \| 'binary' \| 'time' \| 'integer' \| 'boolean'` | Names a MAPI property data type tag. |
53
53
  | `MSGRecipientRole` | type | `'to' \| 'cc' \| 'bcc'` | Names a recipient role in a message. |
54
54
  | `MSGDirectoryEntry` | interface | `{ category, name, previousProperty, nextProperty, childProperty, startBlock, sizeBlock, children? }` | Represents a CFB directory entry describing a storage or stream in the compound file. |
55
- | `MSGMutableFieldData` | interface | `{ category, attachments?, recipients?, innerMSGContent?, innerMSGContentFields?, dataId?, contentLength?, folderId?, [key: string] }` | Represents an internal accumulator for MSG field extraction whose members are all readonly. The extraction path writes each resolved field through `Object.assign`, then narrows the accumulator to `MSGFieldData` at the public boundary. |
55
+ | `MSGMutableFieldData` | interface | `{ category, attachments?, recipients?, innerMSGContent?, innerMSGContentFields?, dataId?, contentLength?, folderId?, readonly [key: string]: unknown }` | Represents an internal accumulator for MSG field extraction whose members are all readonly. The extraction path writes each resolved field through `Object.assign`, then narrows the accumulator to `MSGFieldData` at the public boundary. |
56
56
  | `MSGNameIdEntry` | interface | `{ useName, name?, propertySet?, propertyLid? }` | Represents a resolved named property entry from the `__nameid_version1.0` storage. |
57
57
  | `MSGBurnerEntry` | interface | `{ name, category, length, binaryProvider?, children? }` | Describes one CFB entry for `burnCFB`, the compound-file binary writer. Entries form a flat list whose root storage sits at index 0, each entry's children reachable through its `children` indices. |
58
58
  | `MSGBurnerLiteEntry` | interface | `{ entry, left, right, child, firstSector, mini, red }` | Represents an internal lite entry with tree metadata used during CFB burn. Tracks red-black coloring and sector allocation alongside the source MSGBurnerEntry. |
59
59
  | `MSGFieldData` | interface | `{ category, subject?, senderName?, senderEmail?, senderAddressType?, senderSMTPAddress?, sentRepresentingSMTPAddress?, body?, headers?, bodyHTML?, html?, compressedRTF?, messageClass?, messageFlags?, messageId?, internetCodepage?, messageCodepage?, messageLocaleId?, clientSubmitTime?, messageDeliveryTime?, creationTime?, lastModificationTime?, lastModifierName?, creatorSMTPAddress?, lastModifierSMTPAddress?, preview?, conversationTopic?, normalizedSubject?, name?, email?, addressType?, smtpAddress?, recipientRole?, extension?, fileNameShort?, fileName?, contentId?, attachmentHidden?, mimeType?, contentLength?, dataId?, folderId?, innerMSGContent?, innerMSGContentFields?, attachments?, recipients?, departmentName?, middleName?, generation?, surname?, givenName?, companyName?, jobTitle?, location?, postalAddress?, streetAddress?, postalCode?, country?, stateOrProvince?, homePhone?, mobilePhone?, businessPhone?, businessFax?, businessHomePage?, namePrefix?, homeAddressCity?, appointmentStart?, appointmentEnd?, clipStart?, clipEnd?, timeZoneDescription?, appointmentLocation?, appointmentOldLocation?, globalAppointmentId?, votingResponse?, internetAccountName?, yomiFirstName?, yomiLastName?, yomiCompanyName?, primaryEmailAddress?, primaryEmailDisplayName?, primaryEmailOriginalDisplayName?, fileUnder?, workAddressCity?, workAddressStreet?, workAddressState?, workAddressPostalCode?, workAddressCountry?, workAddressCountryCode?, addressCountryCode?, contactWebPage?, workAddress?, instantMessagingAddress?, fax1AddressType?, fax1EmailAddress?, fax1OriginalDisplayName?, fax2AddressType?, fax2EmailAddress?, fax2OriginalDisplayName?, fax3AddressType?, fax3EmailAddress?, fax3OriginalDisplayName? }` | Holds the field data parsed out of one MSG entity — the root message, an attachment, or a recipient — across its email, recipient, attachment, contact, and appointment fields. |
60
60
  | `MSGAttachment` | interface | `{ name, bytes }` | Holds extracted attachment content from an MSG file. |
61
- | `MSGSourceInterface` | interface | `{} plus parse, attachment` | Represents the parsed MSG source `extractMessageFromMSG` reads from: the field tree plus indexed attachment access. |
61
+ | `MSGSourceInterface` | interface | `{ parse(), attachment() }` | Represents the parsed MSG source `extractMessageFromMSG` reads from: the field tree plus indexed attachment access. |
62
62
  | `EmailFormat` | type | `'eml' \| 'msg'` | Names a supported email file format. |
63
63
  | `MIMEHeader` | interface | `{ value, params }` | Represents a parsed MIME header: its primary value and its parameter map. |
64
64
  | `MIMEPart` | interface | `{ headers, body, parts }` | Represents a recursive MIME part tree node. |
@@ -68,7 +68,7 @@ wrap them and do not re-export the types.
68
68
  | `EmailInput` | interface | `{ bytes, name?, mime? }` | Represents the raw email input handed to `createMSG` or `new MSG()`. |
69
69
  | `MSGInput` | type | `Uint8Array \| ArrayBuffer \| EmailInput` | Represents the raw input `createMSG` and `new MSG()` accept: binary MSG bytes, an `ArrayBuffer` over them, or an `EmailInput` carrying a file-name or MIME hint. |
70
70
  | `MSGOptions` | interface | `{ encoding? }` | Configures the creation of an `MSGInterface`. |
71
- | `MSGInterface` | interface | `{ options, chain, fields } plus attachment, burn` | Exposes the public surface of a parsed MSG/EML file. |
71
+ | `MSGInterface` | interface | `{ options, chain, fields, attachment(), burn() }` | Exposes the public surface of a parsed MSG/EML file. |
72
72
 
73
73
  ### Constants
74
74
 
@@ -76,65 +76,65 @@ The CFB layout offsets and sizes, the MSG/EML sniffing tables, the MAPI field na
76
76
 
77
77
  A `Shape` cell holds the constant's declared type.
78
78
 
79
- | Constant | Kind | Shape | Summary |
79
+ | Name | Kind | Signature | Summary |
80
80
  | ----------------------------------- | ----- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
81
81
  | `MSG_FILE_HEADER` | const | `readonly number[]` | Holds the 8-byte CFB/OLE2 magic signature (`D0 CF 11 E0 A1 B1 1A E1`) a `.msg` file must open with. |
82
- | `MSG_UNUSED_BLOCK` | const | `number` | Names the FAT and mini-FAT sentinel for an unallocated sector (`-1`). |
83
- | `MSG_END_OF_CHAIN` | const | `number` | Names the FAT and mini-FAT sentinel marking a sector chain's end (`-2`). |
84
- | `MSG_SECTOR_SIZE` | const | `number` | Holds the standard CFB sector size in bytes (512), read when the header's sector shift is `MSG_S_BIG_BLOCK_MARK` and written by every burn. |
85
- | `MSG_S_BIG_BLOCK_MARK` | const | `number` | Holds the header sector-shift value selecting `MSG_SECTOR_SIZE`, `9` (the byte at offset 30). |
86
- | `MSG_L_BIG_BLOCK_SIZE` | const | `number` | Holds the large CFB sector size in bytes (4096), read when the header's sector shift is `MSG_L_BIG_BLOCK_MARK`. |
87
- | `MSG_L_BIG_BLOCK_MARK` | const | `number` | Holds the header sector-shift value selecting `MSG_L_BIG_BLOCK_SIZE`, `12` (the byte at offset 30). |
88
- | `MSG_MINI_SECTOR_SIZE` | const | `number` | Holds the CFB mini-stream sector size in bytes (64), read by the parse path and written by every burn. |
89
- | `MSG_MINI_STREAM_CUTOFF` | const | `number` | Sets the stream size (4096) at and above which a stream leaves the mini-stream for standard sectors. |
90
- | `MSG_HEADER_PROPERTY_START_OFFSET` | const | `number` | Locates the root directory sector's start within the CFB header (`0x30`). |
91
- | `MSG_HEADER_BAT_START_OFFSET` | const | `number` | Locates the DIFAT's first 109 FAT sector entries within the CFB header (`0x4c`). |
92
- | `MSG_HEADER_BAT_COUNT_OFFSET` | const | `number` | Locates the total FAT sector count within the CFB header (`0x2c`). |
93
- | `MSG_HEADER_SBAT_START_OFFSET` | const | `number` | Locates the mini-FAT's first sector within the CFB header (`0x3c`). |
94
- | `MSG_HEADER_SBAT_COUNT_OFFSET` | const | `number` | Locates the mini-FAT sector count within the CFB header (`0x40`). |
95
- | `MSG_HEADER_XBAT_START_OFFSET` | const | `number` | Locates the first DIFAT (XBAT) sector within the CFB header (`0x44`). |
96
- | `MSG_HEADER_XBAT_COUNT_OFFSET` | const | `number` | Locates the DIFAT (XBAT) sector count within the CFB header (`0x48`). |
97
- | `MSG_PROP_NO_INDEX` | const | `number` | Names the directory-entry sentinel standing for no such property in the previous, next, and child index fields (`-1`). |
98
- | `MSG_MAX_HIERARCHY_DEPTH` | const | `number` | Caps the recursion depth of the directory-tree traversal, guarding against a cyclic or hostile property chain (`64`). |
99
- | `MSG_DIRECTORY_ENTRY_SIZE` | const | `number` | Holds the fixed size in bytes (128) of one CFB directory entry, read by the parse path and written by every burn. |
100
- | `MSG_PROP_NAME_SIZE_OFFSET` | const | `number` | Locates the entry name's UTF-16 byte length within a directory entry (`0x40`). |
101
- | `MSG_PROP_CATEGORY_OFFSET` | const | `number` | Locates the object-category byte within a directory entry, mirroring the Compound File Binary object type field (`0x42`). |
102
- | `MSG_PROP_PREVIOUS_PROPERTY_OFFSET` | const | `number` | Locates the red-black tree's previous sibling index within a directory entry (`0x44`). |
103
- | `MSG_PROP_NEXT_PROPERTY_OFFSET` | const | `number` | Locates the red-black tree's next sibling index within a directory entry (`0x48`). |
104
- | `MSG_PROP_CHILD_PROPERTY_OFFSET` | const | `number` | Locates the first child storage index within a directory entry (`0x4c`). |
105
- | `MSG_PROP_START_BLOCK_OFFSET` | const | `number` | Locates the entry's starting sector of stream data within a directory entry (`0x74`). |
106
- | `MSG_PROP_SIZE_OFFSET` | const | `number` | Locates the stream byte length within a directory entry (`0x78`). |
107
- | `MSG_CATEGORY_UNALLOCATED` | const | `number` | Names the directory-entry category byte for an unallocated (free) slot (`0`). |
108
- | `MSG_CATEGORY_DIRECTORY` | const | `number` | Names the directory-entry category byte for a storage (folder-like) entry (`1`). |
109
- | `MSG_CATEGORY_DOCUMENT` | const | `number` | Names the directory-entry category byte for a stream (document) entry (`2`). |
110
- | `MSG_CATEGORY_ROOT` | const | `number` | Names the directory-entry category byte for the single root storage entry (`5`). |
111
- | `MSG_PREFIX_ATTACHMENT` | const | `string` | Holds the storage name prefix for an attachment entry (`'__attach_version1.0'`). |
112
- | `MSG_PREFIX_RECIPIENT` | const | `string` | Holds the storage name prefix for a recipient entry (`'__recip_version1.0'`). |
113
- | `MSG_PREFIX_DOCUMENT` | const | `string` | Holds the stream name prefix for a MAPI property document (substg) entry (`'__substg1.'`). |
114
- | `MSG_PREFIX_NAMEID` | const | `string` | Holds the storage name of the named-property mapping table (`'__nameid_version1.0'`). |
82
+ | `MSG_UNUSED_BLOCK` | const | `-1` | Names the FAT and mini-FAT sentinel for an unallocated sector (`-1`). |
83
+ | `MSG_END_OF_CHAIN` | const | `-2` | Names the FAT and mini-FAT sentinel marking a sector chain's end (`-2`). |
84
+ | `MSG_SECTOR_SIZE` | const | `512` | Holds the standard CFB sector size in bytes (512), read when the header's sector shift is `MSG_S_BIG_BLOCK_MARK` and written by every burn. |
85
+ | `MSG_S_BIG_BLOCK_MARK` | const | `9` | Holds the header sector-shift value selecting `MSG_SECTOR_SIZE`, `9` (the byte at offset 30). |
86
+ | `MSG_L_BIG_BLOCK_SIZE` | const | `4096` | Holds the large CFB sector size in bytes (4096), read when the header's sector shift is `MSG_L_BIG_BLOCK_MARK`. |
87
+ | `MSG_L_BIG_BLOCK_MARK` | const | `12` | Holds the header sector-shift value selecting `MSG_L_BIG_BLOCK_SIZE`, `12` (the byte at offset 30). |
88
+ | `MSG_MINI_SECTOR_SIZE` | const | `64` | Holds the CFB mini-stream sector size in bytes (64), read by the parse path and written by every burn. |
89
+ | `MSG_MINI_STREAM_CUTOFF` | const | `4096` | Sets the stream size (4096) at and above which a stream leaves the mini-stream for standard sectors. |
90
+ | `MSG_HEADER_PROPERTY_START_OFFSET` | const | `48` | Locates the root directory sector's start within the CFB header (`0x30`). |
91
+ | `MSG_HEADER_BAT_START_OFFSET` | const | `76` | Locates the DIFAT's first 109 FAT sector entries within the CFB header (`0x4c`). |
92
+ | `MSG_HEADER_BAT_COUNT_OFFSET` | const | `44` | Locates the total FAT sector count within the CFB header (`0x2c`). |
93
+ | `MSG_HEADER_SBAT_START_OFFSET` | const | `60` | Locates the mini-FAT's first sector within the CFB header (`0x3c`). |
94
+ | `MSG_HEADER_SBAT_COUNT_OFFSET` | const | `64` | Locates the mini-FAT sector count within the CFB header (`0x40`). |
95
+ | `MSG_HEADER_XBAT_START_OFFSET` | const | `68` | Locates the first DIFAT (XBAT) sector within the CFB header (`0x44`). |
96
+ | `MSG_HEADER_XBAT_COUNT_OFFSET` | const | `72` | Locates the DIFAT (XBAT) sector count within the CFB header (`0x48`). |
97
+ | `MSG_PROP_NO_INDEX` | const | `-1` | Names the directory-entry sentinel standing for no such property in the previous, next, and child index fields (`-1`). |
98
+ | `MSG_MAX_HIERARCHY_DEPTH` | const | `64` | Caps the recursion depth of the directory-tree traversal, guarding against a cyclic or hostile property chain (`64`). |
99
+ | `MSG_DIRECTORY_ENTRY_SIZE` | const | `128` | Holds the fixed size in bytes (128) of one CFB directory entry, read by the parse path and written by every burn. |
100
+ | `MSG_PROP_NAME_SIZE_OFFSET` | const | `64` | Locates the entry name's UTF-16 byte length within a directory entry (`0x40`). |
101
+ | `MSG_PROP_CATEGORY_OFFSET` | const | `66` | Locates the object-category byte within a directory entry, mirroring the Compound File Binary object type field (`0x42`). |
102
+ | `MSG_PROP_PREVIOUS_PROPERTY_OFFSET` | const | `68` | Locates the red-black tree's previous sibling index within a directory entry (`0x44`). |
103
+ | `MSG_PROP_NEXT_PROPERTY_OFFSET` | const | `72` | Locates the red-black tree's next sibling index within a directory entry (`0x48`). |
104
+ | `MSG_PROP_CHILD_PROPERTY_OFFSET` | const | `76` | Locates the first child storage index within a directory entry (`0x4c`). |
105
+ | `MSG_PROP_START_BLOCK_OFFSET` | const | `116` | Locates the entry's starting sector of stream data within a directory entry (`0x74`). |
106
+ | `MSG_PROP_SIZE_OFFSET` | const | `120` | Locates the stream byte length within a directory entry (`0x78`). |
107
+ | `MSG_CATEGORY_UNALLOCATED` | const | `0` | Names the directory-entry category byte for an unallocated (free) slot (`0`). |
108
+ | `MSG_CATEGORY_DIRECTORY` | const | `1` | Names the directory-entry category byte for a storage (folder-like) entry (`1`). |
109
+ | `MSG_CATEGORY_DOCUMENT` | const | `2` | Names the directory-entry category byte for a stream (document) entry (`2`). |
110
+ | `MSG_CATEGORY_ROOT` | const | `5` | Names the directory-entry category byte for the single root storage entry (`5`). |
111
+ | `MSG_PREFIX_ATTACHMENT` | const | `"__attach_version1.0"` | Holds the storage name prefix for an attachment entry (`'__attach_version1.0'`). |
112
+ | `MSG_PREFIX_RECIPIENT` | const | `"__recip_version1.0"` | Holds the storage name prefix for a recipient entry (`'__recip_version1.0'`). |
113
+ | `MSG_PREFIX_DOCUMENT` | const | `"__substg1."` | Holds the stream name prefix for a MAPI property document (substg) entry (`'__substg1.'`). |
114
+ | `MSG_PREFIX_NAMEID` | const | `"__nameid_version1.0"` | Holds the storage name of the named-property mapping table (`'__nameid_version1.0'`). |
115
115
  | `MSG_FIELD_NAMES` | const | `Readonly<Record<string, string>>` | Maps a MAPI property tag's hex to its short field name, for example `subject`. |
116
116
  | `MSG_FIELD_FULL_NAMES` | const | `Readonly<Record<string, string>>` | Maps a compound tag's full 8-character hex to its fully-qualified field name. |
117
117
  | `MSG_FIELD_TYPES` | const | `Readonly<Record<string, MSGFieldType>>` | Maps a MAPI property type tag's hex to its `MSGFieldType` decode tag. |
118
- | `MSG_FIELD_CLASS_ATTACHMENT_DATA` | const | `string` | Identifies the MAPI tag naming an attachment's binary data stream (`'3701'`). |
119
- | `MSG_FIELD_DIR_TYPE_INNER_MSG` | const | `string` | Names the MAPI type tag identifying an embedded `.msg` attachment storage (`'000d'`). |
120
- | `MSG_MAPI_RECIPIENT_TO` | const | `number` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'to'` (`1`). |
121
- | `MSG_MAPI_RECIPIENT_CC` | const | `number` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'cc'` (`2`). |
122
- | `MSG_MAPI_RECIPIENT_BCC` | const | `number` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'bcc'` (`3`). |
118
+ | `MSG_FIELD_CLASS_ATTACHMENT_DATA` | const | `"3701"` | Identifies the MAPI tag naming an attachment's binary data stream (`'3701'`). |
119
+ | `MSG_FIELD_DIR_TYPE_INNER_MSG` | const | `"000d"` | Names the MAPI type tag identifying an embedded `.msg` attachment storage (`'000d'`). |
120
+ | `MSG_MAPI_RECIPIENT_TO` | const | `1` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'to'` (`1`). |
121
+ | `MSG_MAPI_RECIPIENT_CC` | const | `2` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'cc'` (`2`). |
122
+ | `MSG_MAPI_RECIPIENT_BCC` | const | `3` | Names the MAPI recipient-type value mapping to `MSGRecipientRole` `'bcc'` (`3`). |
123
123
  | `MSG_PIDLIDS` | const | `Readonly<Record<string, Readonly<Record<number, string>>>>` | Maps a named-property set GUID to its long-ID-to-field-name table. |
124
124
  | `MSG_BURNER_INTS_PER_SECTOR` | const | `number` | Holds the number of 32-bit FAT and DIFAT entries one standard sector carries (128). |
125
- | `MSG_BURNER_DIFAT_HEADER_SLOTS` | const | `number` | Caps the DIFAT entries stored directly in the CFB header (109). |
126
- | `MSG_BURNER_FAT_SECTOR_MARKER` | const | `number` | Marks a sector as itself part of the FAT (-3). |
127
- | `MSG_BURNER_DIFAT_SECTOR_MARKER` | const | `number` | Marks a sector as part of the DIFAT (-4). |
128
- | `MSG_BURNER_NAME_MAX` | const | `number` | Caps the UTF-16 code units a written CFB directory entry name may hold (31). |
125
+ | `MSG_BURNER_DIFAT_HEADER_SLOTS` | const | `109` | Caps the DIFAT entries stored directly in the CFB header (109). |
126
+ | `MSG_BURNER_FAT_SECTOR_MARKER` | const | `-3` | Marks a sector as itself part of the FAT (-3). |
127
+ | `MSG_BURNER_DIFAT_SECTOR_MARKER` | const | `-4` | Marks a sector as part of the DIFAT (-4). |
128
+ | `MSG_BURNER_NAME_MAX` | const | `31` | Caps the UTF-16 code units a written CFB directory entry name may hold (31). |
129
129
  | `MSG_BURNER_ROOT_CLSID` | const | `readonly number[]` | Holds the 16-byte CLSID `burnCFB` writes for a compound file's root storage entry. |
130
130
  | `EML_EXTENSIONS` | const | `readonly string[]` | Lists the file-name extensions sniffed as the `'eml'` `EmailFormat`, the RFC 2822 / MIME email files. |
131
131
  | `MSG_EXTENSIONS` | const | `readonly string[]` | Lists the file-name extensions sniffed as the `'msg'` `EmailFormat`, the Outlook binary email files. |
132
132
  | `EML_MIME_TYPES` | const | `readonly string[]` | Lists the MIME types sniffed as the `'eml'` `EmailFormat`, the RFC 2822 / MIME email files. |
133
133
  | `MSG_MIME_TYPES` | const | `readonly string[]` | Lists the MIME types sniffed as the `'msg'` `EmailFormat`, the Outlook binary email files. |
134
- | `FALLBACK_CHARSET` | const | `string` | Names the charset `resolveEncoding` falls back to when a MIME part body's label is unrecognized (`'utf-8'`). |
135
- | `FALLBACK_ATTACHMENT_NAME` | const | `string` | Names the file name `extractMessage` falls back to for an attachment part carrying no `filename` or `name` parameter (`'attachment'`). |
134
+ | `FALLBACK_CHARSET` | const | `"utf-8"` | Names the charset `resolveEncoding` falls back to when a MIME part body's label is unrecognized (`'utf-8'`). |
135
+ | `FALLBACK_ATTACHMENT_NAME` | const | `"attachment"` | Names the file name `extractMessage` falls back to for an attachment part carrying no `filename` or `name` parameter (`'attachment'`). |
136
136
  | `MIME_EXTENSIONS` | const | `ReadonlyMap<string, string>` | Maps a common MIME type to the file extension `inferExtension` gives it during file extraction. |
137
- | `MIME_MAX_DEPTH` | const | `number` | Caps the multipart nesting depth `parseMIMEPart` accepts (50). |
137
+ | `MIME_MAX_DEPTH` | const | `50` | Caps the multipart nesting depth `parseMIMEPart` accepts (50). |
138
138
  | `UTF8_SEQUENCE_MINIMUM` | const | `Readonly<Record<number, number>>` | Holds the minimum valid code point for each UTF-8 sequence length, keyed by the number of continuation bytes (1, 2, or 3). |
139
139
  | `WINDOWS_1252_HIGH` | const | `readonly number[]` | Holds the Windows-1252 code point table for the high bytes `0x80`\-`0x9F`. |
140
140
 
@@ -142,10 +142,10 @@ A `Shape` cell holds the constant's declared type.
142
142
 
143
143
  From [`errors.ts`](../src/core/errors.ts) — every MSG/EML parsing or burning failure `throw`s (or, for `createMSG`, returns) an `MSGError` carrying a machine-readable `code`.
144
144
 
145
- | Symbol | Kind | Signature | Summary |
146
- | ------------ | -------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
- | `MSGError` | class | `new MSGError(code, message, context?)` | Represents an error thrown or returned by the MSG/EML parsing and burning surfaces, carrying a machine-readable `MSGErrorCode` and optional structured `context`. |
148
- | `isMSGError` | function | `(value: unknown) => value is MSGError` | Narrows an unknown caught (or `Failure.error`) value to an `MSGError`. |
145
+ | Name | Kind | Signature | Summary |
146
+ | ------------ | -------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | `MSGError` | class | `new (code: MSGErrorCode, message: string, context?: Readonly<Record<string, unknown>>) => MSGError` | Represents an error thrown or returned by the MSG/EML parsing and burning surfaces, carrying a machine-readable `MSGErrorCode` and optional structured `context`. |
148
+ | `isMSGError` | function | `(value: unknown) => value is MSGError` | Narrows an unknown caught (or `Failure.error`) value to an `MSGError`. |
149
149
 
150
150
  ```ts
151
151
  import { isMSGError, MSGError } from '@orkestrel/msg'
@@ -165,35 +165,35 @@ It refuses transparent proxies, unbranded errors, and plain objects carrying the
165
165
 
166
166
  Pure, mostly-total leaves from [`helpers.ts`](../src/core/helpers.ts) — the `Result` constructors/guards, the CFB byte/string/UUID readers and magic check `MSG.ts` composes, the format sniffer, and the MIME/text codecs `parsers.ts` and `shapers.ts` compose.
167
167
 
168
- | Helper | Kind | Signature | Summary |
169
- | --------------------- | -------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
170
- | `success` | function | `<T>(value: T) => Success<T>` | Constructs a `Success` wrapping a value. |
171
- | `failure` | function | `<E>(error: E) => Failure<E>` | Constructs a `Failure` wrapping an error. |
172
- | `isSuccess` | function | `<T, E>(result: Result<T, E>) => result is Success<T>` | Narrows a `Result` to a `Success`. |
173
- | `isFailure` | function | `<T, E>(result: Result<T, E>) => result is Failure<E>` | Narrows a `Result` to a `Failure`. |
174
- | `truncateAtNull` | function | `(text: string) => string` | Truncates a string at its first `\0` character. |
175
- | `readUTF16String` | function | `(view: DataView, offset: number, charCount: number) => string` | Reads a UTF-16LE string out of a `DataView`, throwing when the requested range exceeds the view's bounds. |
176
- | `decodeText` | function | `(bytes: Uint8Array, encoding?: MSGEncoding) => string` | Decodes bytes into a string with a pure-ES decoder, dispatching on the named encoding. Default: `windows-1252`. |
177
- | `fileTimeToUTCString` | function | `(low: number, high: number) => string` | Converts a Windows FILETIME (100-ns ticks since 1601-01-01) to a UTC date string. |
178
- | `toHexLower` | function | `(value: number, length: number) => string` | Converts a number to a zero-padded lowercase hex string of the requested digit count. |
179
- | `readMicrosoftUUID` | function | `(bytes: Uint8Array, offset: number) => string` | Reads a mixed-endian Microsoft UUID starting at an offset in a byte array, throwing past the array's bounds. |
180
- | `roundUpToMultiple` | function | `(value: number, boundary: number) => number` | Rounds a value up to the nearest multiple of a boundary, which must be a power of 2. |
181
- | `computeSectors` | function | `(bytes: number, sectorSize: number) => number` | Computes how many sectors of a given size hold a byte count, answering 0 for a count at or below zero. |
182
- | `compareCFBName` | function | `(a: string, b: string) => number` | Orders two directory names as the compound file format requires, comparing by UTF-16 length first and then by uppercased code points. |
183
- | `isMSGFile` | function | `(view: DataView) => boolean` | Reports whether a `DataView`'s first 8 bytes match the CFB magic signature. |
184
- | `decodeBase64` | function | `(text: string) => Uint8Array` | Decodes a Base64 string into raw bytes without relying on `atob`, ignoring ASCII whitespace and tolerating missing padding. |
185
- | `encodeUTF8` | function | `(text: string) => Uint8Array` | Encodes a string into UTF-8 bytes, pairing surrogates and encoding a lone (unpaired) surrogate as U+FFFD. |
186
- | `decodeUTF8` | function | `(bytes: Uint8Array) => string` | Decodes UTF-8 bytes into a string WHATWG-style: an invalid byte sequence decodes as U+FFFD rather than throwing. |
187
- | `decodeLatin1` | function | `(bytes: Uint8Array) => string` | Decodes Latin-1 (ISO-8859-1) bytes into a string, byte-for-code-point. |
188
- | `decodeWindows1252` | function | `(bytes: Uint8Array) => string` | Decodes Windows-1252 bytes into a string, resolving the `0x80`\-`0x9F` range through `WINDOWS_1252_HIGH` and otherwise matching `decodeLatin1`. |
189
- | `resolveEncoding` | function | `(label: string \| undefined) => MSGEncoding` | Resolves a free-form charset label, as a MIME `charset` parameter carries it, to a supported `MSGEncoding`, falling back to `FALLBACK_CHARSET`'s encoding for an unrecognized or absent label. |
190
- | `detectFormat` | function | `(name?: string, mime?: string) => EmailFormat \| undefined` | Derives the `EmailFormat` from a file name, a MIME type, or both, answering `undefined` when neither hints at a format. |
191
- | `parseMIMEHeaders` | function | `(text: string) => ReadonlyMap<string, MIMEHeader>` | Parses an RFC 2822 / MIME header block, folding continuation lines. |
192
- | `decodeMIMEEncoding` | function | `(body: string, encoding: string) => Uint8Array` | Decodes a MIME body — `base64`, `quoted-printable`, or passthrough — into raw bytes, throwing on invalid Base64. |
193
- | `decodeMIMEText` | function | `(body: string, encoding: string, charset: string) => string` | Decodes a MIME body to text through `decodeMIMEEncoding` and `resolveEncoding`, taking the charset from a free-form label. |
194
- | `decodeMIMEWords` | function | `(text: string) => string` | Decodes the RFC 2047 encoded words (`=?charset?B/Q?...?=`) in a header value, reading the Base64 (`B`) and quoted-printable (`Q`) forms alike. |
195
- | `formatEmailAddress` | function | `(name: string \| undefined, email: string \| undefined) => string` | Formats a display name and an email address into `"Name <email>"`, or into whichever half is present. |
196
- | `inferExtension` | function | `(mimeType?: string, fileName?: string) => string` | Infers an attachment's file extension from its file name or its MIME type, returning the extension with its leading dot and falling back to `.bin`. |
168
+ | Name | Kind | Signature | Summary |
169
+ | --------------------- | -------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
170
+ | `success` | function | `<T>(value: T) => Success<T>` | Constructs a `Success` wrapping a value. |
171
+ | `failure` | function | `<E>(error: E) => Failure<E>` | Constructs a `Failure` wrapping an error. |
172
+ | `isSuccess` | function | `<T, E>(result: Result<T, E>) => result is Success<T>` | Narrows a `Result` to a `Success`. |
173
+ | `isFailure` | function | `<T, E>(result: Result<T, E>) => result is Failure<E>` | Narrows a `Result` to a `Failure`. |
174
+ | `truncateAtNull` | function | `(text: string) => string` | Truncates a string at its first `\0` character. |
175
+ | `readUTF16String` | function | `(view: DataView, offset: number, charCount: number) => string` | Reads a UTF-16LE string out of a `DataView`, throwing when the requested range exceeds the view's bounds. |
176
+ | `decodeText` | function | `(bytes: Uint8Array, encoding?: MSGEncoding) => string` | Decodes bytes into a string with a pure-ES decoder, dispatching on the named encoding. Default: `windows-1252`. |
177
+ | `fileTimeToUTCString` | function | `(low: number, high: number) => string` | Converts a Windows FILETIME (100-ns ticks since 1601-01-01) to a UTC date string. |
178
+ | `toHexLower` | function | `(value: number, length: number) => string` | Converts a number to a zero-padded lowercase hex string of the requested digit count. |
179
+ | `readMicrosoftUUID` | function | `(bytes: Uint8Array, offset: number) => string` | Reads a mixed-endian Microsoft UUID starting at an offset in a byte array, throwing past the array's bounds. |
180
+ | `roundUpToMultiple` | function | `(value: number, boundary: number) => number` | Rounds a value up to the nearest multiple of a boundary, which must be a power of 2. |
181
+ | `computeSectors` | function | `(bytes: number, sectorSize: number) => number` | Computes how many sectors of a given size hold a byte count, answering 0 for a count at or below zero. |
182
+ | `compareCFBName` | function | `(a: string, b: string) => number` | Orders two directory names as the compound file format requires, comparing by UTF-16 length first and then by uppercased code points. |
183
+ | `isMSGFile` | function | `(view: DataView) => boolean` | Reports whether a `DataView`'s first 8 bytes match the CFB magic signature. |
184
+ | `decodeBase64` | function | `(text: string) => Uint8Array` | Decodes a Base64 string into raw bytes without relying on `atob`, ignoring ASCII whitespace and tolerating missing padding. |
185
+ | `encodeUTF8` | function | `(text: string) => Uint8Array` | Encodes a string into UTF-8 bytes, pairing surrogates and encoding a lone (unpaired) surrogate as U+FFFD. |
186
+ | `decodeUTF8` | function | `(bytes: Uint8Array) => string` | Decodes UTF-8 bytes into a string WHATWG-style: an invalid byte sequence decodes as U+FFFD rather than throwing. |
187
+ | `decodeLatin1` | function | `(bytes: Uint8Array) => string` | Decodes Latin-1 (ISO-8859-1) bytes into a string, byte-for-code-point. |
188
+ | `decodeWindows1252` | function | `(bytes: Uint8Array) => string` | Decodes Windows-1252 bytes into a string, resolving the `0x80`\-`0x9F` range through `WINDOWS_1252_HIGH` and otherwise matching `decodeLatin1`. |
189
+ | `resolveEncoding` | function | `(label: string \| undefined) => MSGEncoding` | Resolves a free-form charset label, as a MIME `charset` parameter carries it, to a supported `MSGEncoding`, falling back to `FALLBACK_CHARSET`'s encoding for an unrecognized or absent label. |
190
+ | `detectFormat` | function | `(name: string \| undefined, mime: string \| undefined) => EmailFormat \| undefined` | Derives the `EmailFormat` from a file name, a MIME type, or both, answering `undefined` when neither hints at a format. |
191
+ | `parseMIMEHeaders` | function | `(text: string) => ReadonlyMap<string, MIMEHeader>` | Parses an RFC 2822 / MIME header block, folding continuation lines. |
192
+ | `decodeMIMEEncoding` | function | `(body: string, encoding: string) => Uint8Array` | Decodes a MIME body — `base64`, `quoted-printable`, or passthrough — into raw bytes, throwing on invalid Base64. |
193
+ | `decodeMIMEText` | function | `(body: string, encoding: string, charset: string) => string` | Decodes a MIME body to text through `decodeMIMEEncoding` and `resolveEncoding`, taking the charset from a free-form label. |
194
+ | `decodeMIMEWords` | function | `(text: string) => string` | Decodes the RFC 2047 encoded words (`=?charset?B/Q?...?=`) in a header value, reading the Base64 (`B`) and quoted-printable (`Q`) forms alike. |
195
+ | `formatEmailAddress` | function | `(name: string \| undefined, email: string \| undefined) => string` | Formats a display name and an email address into `"Name <email>"`, or into whichever half is present. |
196
+ | `inferExtension` | function | `(mimeType?: string, fileName?: string) => string` | Infers an attachment's file extension from its file name or its MIME type, returning the extension with its leading dot and falling back to `.bin`. |
197
197
 
198
198
  ```ts
199
199
  import {
@@ -253,7 +253,7 @@ readMicrosoftUUID(new Uint8Array(16), 0) // a UUID string
253
253
 
254
254
  The value shapers from [`shapers.ts`](../src/core/shapers.ts) build a finished value out of an already-parsed source. `burnCFB` compiles a flat readonly entry graph into a standalone binary, without mutating the caller's descriptors. `extractMessage` and `extractMessageFromMSG` project a parsed MIME tree or a parsed MSG field tree into an `EmailMessage`.
255
255
 
256
- | Shaper | Kind | Signature | Summary |
256
+ | Name | Kind | Signature | Summary |
257
257
  | ----------------------- | -------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
258
258
  | `burnCFB` | function | `(entries: readonly MSGBurnerEntry[]) => Uint8Array` | Reconstitutes a valid CFB (Compound Binary File) binary from a flat list of `MSGBurnerEntry` descriptors — root storage at index 0, its children reachable through `children` indices. |
259
259
  | `extractMessageFromMSG` | function | `(reader: MSGSourceInterface) => EmailMessage` | Extracts one `EmailMessage` from the field data and attachments of a parsed MSG source; a corrupt attachment is skipped rather than fatal. |
@@ -291,7 +291,7 @@ extractMessageFromMSG({
291
291
 
292
292
  MIME-tree parsing from [`parsers.ts`](../src/core/parsers.ts) — the recursive coercion from raw text to a typed tree, built on `helpers.ts`'s header parser.
293
293
 
294
- | Parser | Kind | Signature | Summary |
294
+ | Name | Kind | Signature | Summary |
295
295
  | --------------- | -------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
296
296
  | `parseMIMEPart` | function | `(raw: string, depth?: number) => MIMEPart` | Parses raw RFC 2822 / MIME text into a `MIMEPart` tree, throwing past `MIME_MAX_DEPTH` levels of nesting. |
297
297
 
@@ -307,12 +307,12 @@ The from-unknown guards from [`validators.ts`](../src/core/validators.ts). Each
307
307
 
308
308
  In a guard table a `Shape` cell holds the type the guard narrows to.
309
309
 
310
- | Guard | Kind | Shape | Summary |
311
- | ------------------- | -------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
312
- | `isEmailFormat` | function | `EmailFormat` | Narrows an unknown value to a valid `EmailFormat`: a total from-unknown guard, true for `'eml'` and `'msg'`. |
313
- | `isEmailAttachment` | function | `EmailAttachment` | Narrows an unknown value to an `EmailAttachment`: a total from-unknown guard over `name`, `mimeType`, and `bytes`. |
314
- | `isEmailMessage` | function | `EmailMessage` | Narrows an unknown value to an `EmailMessage`: a total from-unknown guard over every member, validating `attachments` recursively through `isEmailAttachment`. |
315
- | `isEmailChain` | function | `EmailChain` | Narrows an unknown value to an `EmailChain`: a total from-unknown guard over `format` and `messages`, validating `messages` recursively through `isEmailMessage`. |
310
+ | Name | Kind | Signature | Summary |
311
+ | ------------------- | -------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
312
+ | `isEmailFormat` | function | `(value: unknown) => value is EmailFormat` | Narrows an unknown value to a valid `EmailFormat`: a total from-unknown guard, true for `'eml'` and `'msg'`. |
313
+ | `isEmailAttachment` | function | `(value: unknown) => value is EmailAttachment` | Narrows an unknown value to an `EmailAttachment`: a total from-unknown guard over `name`, `mimeType`, and `bytes`. |
314
+ | `isEmailMessage` | function | `(value: unknown) => value is EmailMessage` | Narrows an unknown value to an `EmailMessage`: a total from-unknown guard over every member, validating `attachments` recursively through `isEmailAttachment`. |
315
+ | `isEmailChain` | function | `(value: unknown) => value is EmailChain` | Narrows an unknown value to an `EmailChain`: a total from-unknown guard over `format` and `messages`, validating `messages` recursively through `isEmailMessage`. |
316
316
 
317
317
  ```ts
318
318
  import { isEmailAttachment, isEmailChain, isEmailFormat, isEmailMessage } from '@orkestrel/msg'
@@ -338,9 +338,9 @@ The one implementing class, from [`MSG.ts`](../src/core/MSG.ts) — documented i
338
338
  heading following this table. `MSGError` is a class too, and sits in the [`### Errors`](#errors)
339
339
  table beside the guard that narrows to it.
340
340
 
341
- | Class | Kind | Summary |
342
- | ----- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
343
- | `MSG` | class | Parses raw `.eml` or `.msg` file bytes into a structured `EmailChain`, exposing — for `.msg` input — the raw MAPI field tree, attachment binary access, and CFB reconstitution. |
341
+ | Name | Kind | Signature | Summary |
342
+ | ----- | ----- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
343
+ | `MSG` | class | `new (input: MSGInput, options?: MSGOptions) => MSGInterface` | Parses raw `.eml` or `.msg` file bytes into a structured `EmailChain`, exposing — for `.msg` input — the raw MAPI field tree, attachment binary access, and CFB reconstitution. |
344
344
 
345
345
  ### `MSG`
346
346
 
@@ -360,7 +360,7 @@ msg.fields // undefined for 'eml' input; MSGFieldData for 'msg' input
360
360
 
361
361
  From [`factories.ts`](../src/core/factories.ts).
362
362
 
363
- | Factory | Kind | Signature | Summary |
363
+ | Name | Kind | Signature | Summary |
364
364
  | ----------- | -------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
365
365
  | `createMSG` | function | `(input: MSGInput, options?: MSGOptions) => Result<MSGInterface, MSGError>` | Creates an `MSGInterface` for raw `.eml` or `.msg` input and returns it inside a `Result`: every parse failure surfaces as a `Failure` carrying the `MSGError` instead of throwing, and an unexpected non-`MSGError` error still propagates. |
366
366
 
@@ -41,9 +41,9 @@ A `Shape` cell holds an interface's data members as bare names in braces, `?`
41
41
  marking an optional member and `plus` introducing its call-signature members,
42
42
  and a type alias's own type literal with a union's arms escaped as `\|`.
43
43
 
44
- | Type | Kind | Shape | Summary |
44
+ | Name | Kind | Signature | Summary |
45
45
  | ----------------------- | --------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
46
- | `NDJSONParserInterface` | interface | `{} plus parse, clear` | Represents the stateful NDJSON (newline-delimited JSON) stream-parser contract a consumer holds — a `parse` that turns each string chunk into the complete records decoded so far, and a `clear` that drops the buffered partial line. |
46
+ | `NDJSONParserInterface` | interface | `{ parse(), clear() }` | Represents the stateful NDJSON (newline-delimited JSON) stream-parser contract a consumer holds — a `parse` that turns each string chunk into the complete records decoded so far, and a `clear` that drops the buffered partial line. |
47
47
 
48
48
  Types a helper's parameter as `NDJSONParserInterface` and returns the records
49
49
  its `parse` call completes:
@@ -58,9 +58,9 @@ function feed(parser: NDJSONParserInterface, chunk: string): readonly Record<str
58
58
 
59
59
  ### Factories
60
60
 
61
- | API | Kind | Summary |
62
- | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63
- | `createNDJSONParser` | function | Creates an NDJSON (newline-delimited JSON) stream parser and returns it as an `NDJSONParserInterface` — a fresh `NDJSONParser` holding the buffer, so a caller holds the published contract rather than the class. |
61
+ | Name | Kind | Signature | Summary |
62
+ | -------------------- | -------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63
+ | `createNDJSONParser` | function | `() => NDJSONParserInterface` | Creates an NDJSON (newline-delimited JSON) stream parser and returns it as an `NDJSONParserInterface` — a fresh `NDJSONParser` holding the buffer, so a caller holds the published contract rather than the class. |
64
64
 
65
65
  #### Create a parser
66
66
 
@@ -78,9 +78,9 @@ parser.parse('\n') // [{ c: 3 }]
78
78
 
79
79
  ### Classes
80
80
 
81
- | API | Kind | Summary |
82
- | -------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
- | `NDJSONParser` | class | Decodes an NDJSON (newline-delimited JSON) stream statefully, implementing `NDJSONParserInterface` over a private buffer the instance owns — each `parse` call returns the records completed so far and reassembles a record split across chunk boundaries. |
81
+ | Name | Kind | Signature | Summary |
82
+ | -------------- | ----- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
+ | `NDJSONParser` | class | `new () => NDJSONParserInterface` | Decodes an NDJSON (newline-delimited JSON) stream statefully, implementing `NDJSONParserInterface` over a private buffer the instance owns — each `parse` call returns the records completed so far and reassembles a record split across chunk boundaries. |
84
84
 
85
85
  ## Methods
86
86