Repository navigation
A PDF's outline now says where it came from, vertical Japanese and Chinese text is read in reading order, and misaka usage counts a run's cards.
Update
misaka update --applyAn install from a release archive is updated by running the installer again:
curl -fsSL https://raw.githubusercontent.com/Luciole-Studio/Misaka-Agent/main/scripts/install.sh | shirm https://raw.githubusercontent.com/Luciole-Studio/Misaka-Agent/main/scripts/install.ps1 | iexRestart MISAKA after updating. A document already indexed keeps its pages and its outline as they are. One that has no outline is asked for one once more the next time it is indexed.
Documents
- An outline says where it came from, or why there is none.
doc_outline,misaka doc add,doc scananddoc treename the source: the file's bookmarks, bookmarks with detected sections under them, headings detected from the page layout, headings a text file states, or headings MinerU marked. Where there is no outline they say whether the file states none, the format has none, the document is under 20 pages, or the reader failed on the file. The attempt is kept in the document'smeta.json. - A PDF the outline reader fails on is not read again on every index. Only "none found" was remembered. Ten real PDFs that fail took 129 s and then 138 s to index twice, and now take 128 s and then 0.2 s.
- The outline reader is upstream PageIndex at 340b853, run in a process of its own. It has ten minutes, and a page PDFium cannot load no longer leaves handles open in MISAKA's process. On 258 real PDFs of 20 pages or more, failed reads went from 11 to 3. A PDF with bytes before its
%PDF-header keeps its bookmarks, and AES-encrypted PDFs are read (PyCryptodome is a dependency now). - A file with deep bookmarks is outlined by them alone. The reader also hung headings it detected on the pages under such bookmarks, and a chapter title printed above its first section came back as that section's child. In 43 real PDFs 952 of 4,386 outline entries were not the file's bookmarks. Those files are also read ten times faster, 180 s to 18 s for the 43.
- Pages of vertical text are read down their columns.
pdftotext -layoutread such a page across its columns, one character at a time, and neitherdoc_findnordoc_verifycould find anything on it. In one research run a paper printed 顧問 on eight pages and the search found none. On the same seven PDFs and the same question, two Japanese papers were read as text on 11 of 59 and 21 of 32 pages before, and on all of them after; page images were viewed 47 times before and 3 after. In 238 real PDFs, 131 pages of 4 documents change and the other 36,874 are the same byte for byte. - A page number printed with its digits apart is not read as single digits. A journal that prints "4 5 4" was given printed page numbers such as 1, 3 and 5 on 25 of a paper's 32 pages.
Research
misaka usagecounts the cards of a run started from the command line. Such a run stores no session folder on its cards, and the report left them out: one run showed $0.91 of $2.52.
Extensions
- MISAKA's own parts and pi's extensions are dispatched by the one runner. Two things an extension author can see: a handler's
updatedInputfromtool_callnow reaches the next handler and the tool, and onagent_settledMISAKA's parts run before extensions. A headless session'sreload()also sends extensionssession_start.
Repository
- The READMEs,
docs/and the port notes are removed, and#comments are stripped from the source. 765 of the 772 Python files this touched keep the same syntax tree.
Known issues
- Indexing can wait fifteen minutes on MinerU. Three
doc_addcalls made at once started three MinerU runs, one of them stopped using the processor, and MISAKA waited its full 900 s before running it again. Ten cards waited behind it. Not changed in this release. - A detected outline can be thin or wrong. Of 11 real PDFs that gained an outline from page layout, 4 have two or three entries that are no guide to the document. The outline says an entry can be wrong.
- Documents indexed before this release keep their text and outlines. A vertical page stays scattered and an outline keeps its extra entries until the document is indexed afresh.
OCR 1/102indoc_listis read by models as "OCR is 1 of 102 pages done". It means one page of 102 was read by OCR.- On Windows every page is read by PDFium, which on one gazetteer dropped 140 of a page's 410 characters. Whether Windows installs lose characters on such files was not checked.
- A relay that renames tools can stop
/research. SettingsupportsMidConvoToolChangestofalseon that model inmodels.jsonavoids it, as before.
Internal
tests/test_pdf_outline.pyindexes PDFs it builds with the real outline reader, which no document test had entered.tests/test_pageindex_vendored.pyfails on any byte of difference from upstream.tests/test_vertical_text.pybuilds a PDF set in columns and a table of one-digit cells.tests/test_parts_and_extensions_dispatch.pyruns 24 dispatch scenarios through the real SDK entry.- The full suite ran on macOS: 13,134 passed, 67 skipped, none failed. On Windows 11 the ten test files this release touches for documents and usage ran: 80 passed, 6 skipped. Linux was not run.