Skip to main content

Home Mail Room

@zts/home-mail-roomv2026.11.07.1· MIT· 14d agoBEHAVIORSWORKFLOWSREPORTSACCEPTED WARNINGS
01README

File scanned post. Scanned letters (PDFs) dropped into Inbound/Incoming are read on this machine by an installed @zts/qianfan-ocr behavior, in batches, and filed into a FileCabinet of sender folders. The scanner reads letters and moves them to ReadyToFile, or to Failed when they cannot be read; the filer files every letter it can on its own and holds the rest for a person; the review behavior serves a local page where a person files or skips the held letters. The process-incoming workflow runs it all.

02Behaviors3
@zts/home-mail-room/scannerv2026.11.07.1scanner.ts

Global Arguments

ArgumentTypeDescription
inboundDir?stringFolder holding Incoming, ReadyToFile and Failed; absolute, or relative to the repository
ocrBehavior?stringName of the @zts/qianfan-ocr behavior that reads the image; create and install it first
fn listIncoming(run: string, batchSize?: number, maxBatches?: number)
Split the letters in Incoming into batches, for scanBatch to read one at a time
ArgumentTypeDescription
runstringName the list incoming-<run>, so concurrent workflow runs keep their own
batchSize?numberLetters read with each load of the model
maxBatches?numberMost batches to list, 0 for all; the rest of Incoming waits for the next run
fn scanBatch(list: string, batch: number, page?: number, fraction?: number, retryFullPage?: boolean, dpi?: number, prompt?: string, maxNewTokens?: number)
Read one batch of listed letters with one load of the OCR model, then move each to ReadyToFile or Failed
ArgumentTypeDescription
liststringThe run listIncoming was given
batchnumberWhich of the list's batches
page?number1-based page to read
fraction?numberShare of the page, from the top, to read first
retryFullPage?booleanRead the whole page of a letter whose sender or date the top did not show
dpi?numberRender resolution
prompt?stringReplace the letter prompt
maxNewTokens?numberMost tokens the model may generate

Resources

details(90d)— What was read off a letter, named by its content: details-<short hash>
incomingList(7d)— The letters in Incoming, split into batches for a run
scanBatch(7d)— One batch: what became of each letter in it

Files

header(image/png)— The rendered part of the letter the details were read from
@zts/home-mail-room/filerv2026.11.07.1filer.ts

Global Arguments

ArgumentTypeDescription
scanner?stringThe @zts/home-mail-room/scanner instance that reads the letters
inboundDir?stringFolder holding ReadyToFile, Archived and Skipped; absolute, or relative to the repository
cabinetDir?stringFolder of sender folders letters are filed into; absolute, or relative to the repository
retention?stringHow long a filed or skipped letter's record is kept
fn fileReady()
Review every letter in ReadyToFile, filing those it can on its own and holding the rest for a person
fn decide(decisions: array)
Apply a person's decisions: file letters, with any fields they changed, or skip them
ArgumentTypeDescription
decisionsarray
fn renameSender(letters: array, sender: string)
Rename the sender of letters, remember it in the cabinet's senders.yaml, and re-review every open letter from that sender
ArgumentTypeDescription
lettersarrayLetters whose sender is renamed, with every open letter whose sender was read the same way
senderstringHow the sender is written from now on

Resources

letter(infinite)— One scanned letter: what was read off it, how to file it, and where it is
run(7d)— What one fileReady (file-ready) or decide (decisions) run did to each letter

Files

header(image/png)— The rendered top of the letter, copied from the scanner
@zts/home-mail-room/reviewv2026.11.07.1review.ts

Global Arguments

ArgumentTypeDescription
filer?stringThe @zts/home-mail-room/filer instance whose letters are reviewed
fn serve(port?: coerce.number)
Serve the review page on 127.0.0.1 until Ctrl-C: file or skip the letters the filer held
ArgumentTypeDescription
port?coerce.numberThe port on 127.0.0.1; 0 picks a free one
03Workflows1
@zts/home-mail-room/process-incoming62f96d0f-e5e1-49a1-999a-07c31fddfd46

Read every scanned letter in Inbound/Incoming, a batch at a time, then file everything waiting in ReadyToFile. Each batch is one step: the scanner reads its letters with one load of the OCR model and moves them to ReadyToFile, or to Failed when they cannot be read. A batch that fails leaves its letters in Incoming and the run goes on to the next. The filer then files every letter it can, including ones left by earlier runs, and holds the rest for the review page. Uses the behaviors named scanner

listSplit Incoming into batches
1.list-incoming
scanRead each batch with one load of the model
1.batch-${{ self.batch.index }}— Read one batch and move its letters on
fileFile every letter waiting in ReadyToFile
1.file-ready
04Reports2
@zts/home-mail-room/lettersmodel
letters_report.ts

The filer's letters: what its last run did, which wait for review, and which were filed or skipped, by whom

mail
@zts/home-mail-room/run-summaryworkflow
run_report.ts

What a process-incoming run did with each letter: read, failed or left in Incoming, then filed or held for review

mail
05Stats
A
93 / 100
Downloads
2
Archive size
3.1 MB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented0/1missing
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

07Platforms
08Labels