English · 简体中文
Codex, Pi and OpenCode, beside your paper in Zotero.
Smart Paper Translator adds an Agents sidebar to Zotero's PDF reader. Ask about a passage while it's still in view, attach a figure to your question, and return to the conversation when you reopen the paper. It connects to the Codex, Pi or OpenCode you already use on your computer.
Download · Get started · Report an issue
Keep the paper open while you work through it with an agent in the sidebar.
Select text in the PDF and choose Add to Agents. The passage and its page location appear in your draft, ready for a question such as "What assumption is this argument making?" You can add several passages before sending.
For a figure, equation, or table, use the screenshot button in the reader toolbar or sidebar and drag over the PDF. The capture comes from the PDF itself, without Zotero's interface or annotations. A selection spanning pages becomes one image per page.
Selections and screenshots stay in the draft until you send them. Image questions need a model that accepts images; if yours doesn't, the draft is kept so you can change models.
The screenshot and its page location stay with the question, ready to reopen in the conversation.
Choose Open in separate window in the PDF's Agents sidebar, then drag the chat wherever you like. Your draft, the reply in progress, and any pending approval move with it. Adding a selection or screenshot from the PDF doesn't pull focus away from the reader.
The window stays with its PDF even if you switch or close the reader tab. You can open a window for another PDF, or use Show chat window in the sidebar to find an existing one. Closing the chat window or choosing Return to sidebar doesn't stop the reply or switch tabs. Closing the owning Zotero main window closes its chat windows.
Use Reply size above the conversation to enlarge or reduce the agent’s answer text (80%–200%). Click the percentage to reset. A detached window starts at the sidebar’s size; adjusting it afterward won’t change the sidebar. Temporary branches have their own controls. Sizes are not saved across restarts.
Each PDF keeps its own conversation. Codex, Pi and OpenCode have separate histories, drafts, and model settings, and the sidebar remembers which agent you last used for that paper. Switching agents opens that agent's history without refreshing models. After initial setup, use Reload to pick up newly configured models before sending your first message. New conversation also refreshes the selected agent's list before archiving anything. A failed refresh leaves the old conversation and drafts intact; retry without preparing the adapter again. If the selected model is gone, choose another before sending. Only the model catalog is shared across papers, not your selections.
GPT-family models show thinking as a progress line above the input. Other models show a separate thought block, expanded during generation and collapsed afterward, with thinking… above the input. This also applies to temporary branch chats.
You can choose the model and thinking level in the sidebar. The available levels follow the selected model, including Pi's max where supported. After restarting Zotero, you can read the saved history and resume the same agent session when you send another message.
OpenCode also offers Build, Plan, and your local custom modes under Run mode. Each paper keeps its own choice; a new session follows OpenCode’s local default. Changes are saved after OpenCode confirms them.
Select text inside a completed Agent reply and click Ask in branch. A separate, resizable window opens with just the title, conversation and input area; opening it sends nothing. Write a question or click Explain this passage, then keep asking follow-ups in that window. The main conversation, draft, and reading position stay unchanged.
The branch uses the current Agent, model, and thinking level. Its first question includes the selection, the source reply and original question, plus a separate PDF copy—not the entire chat. Each main Zotero window allows one branch; replacing it asks for confirmation. Switching papers does not change an open branch.
Closing the branch discards its in-memory chat and removes the plugin's temporary workspace. This is not a zero-retention mode for your Agent or model provider. Codex Full Access is not inherited, and temporary workspaces are not security sandboxes.
Replies support tables, code, and mathematical notation, along with Mermaid diagrams. Text is selectable and copyable, including while a reply is streaming. Tool calls appear in expandable cards, with content built only when opened and scroll positions preserved during updates. Each tool's saved raw output is capped at 64 KiB; oversized output keeps its tail, and older histories are trimmed to the same limit when loaded.
When an agent writes a local HTML chart and includes a visualize marker in its answer, the sidebar previews it after the reply finishes. You can use the chart's controls or open a larger view. Charts run without network access, with D3 included in the plugin.
An interactive chart from the conversation, shown beside the passage it explains.
The current local build is 0.1.73, targeting macOS with Zotero 10.0.4 and retaining Zotero 9 support. The plugin declares compatibility with Zotero 9.0–10.0.x. The Agents sidebar works in PDF tabs in Zotero's main window; standalone reader windows are not supported.
PDF screenshots are enabled on the individually verified 9.0.6 and 10.0.4 versions. Use the original PDF view for screenshots; Zotero 10's reflowed Reading Mode is not supported for capture. Other patch versions keep screenshots disabled until their private PDF.js bridge has been checked.
Version 0.1.40 adds Windows drive/UNC path handling for shared runtime discovery and PDF attachments, plus native drive-path conversion for Codex View Image. Full Windows agent startup, especially Pi and OpenCode, has not been validated; the tested target remains macOS.
- Download the
.xpifile from Releases. - Open Zotero's plugin manager, choose the option to install from a file, and select the downloaded XPI.
- Open a PDF in the main Zotero window. Find Agents in the right sidebar.
Updates are installed manually from a newer XPI. The local 0.1.73 build is dist/smart-paper-translator-0.1.73.xpi. Chinese PDFs now default to local sans-serif fonts (PingFang on macOS, Microsoft YaHei on Windows), 12pt body text and 1.75 line spacing, with explicit heading sizes. Under Settings → Smart Paper Translator → 论文全文翻译 → 中文 PDF 字体, choose serif or a custom installed font family (for example, PingFang SC or 思源黑体). No fonts are downloaded; an empty/missing custom font falls back to the default stack. Code and equations retain dedicated fonts. Changes affect the next PDF only—not Markdown, model configuration or translation checkpoints. For a completed task, use 更多操作 → 重新生成中文 PDF to generate a new attachment from the saved translation without translating again or deleting the old attachment.
The previously added Markdown issues list shows source excerpts, reasons and full-document line numbers. With a verified unified-document mapping, “Locate and edit” opens the corresponding source block; saving rechecks the list. It shows the first issue per block, paginates up to 200 issues and discloses the limit; fix these and recheck for more. Checks do not rewrite content, upload files or call models. Legacy documents without reliable page mappings are clearly marked rather than given guessed locations. Python dependency checks now accept numeric release versions with three or more components, including PyMuPDF 1.27.2.3, while retaining PyMuPDF >=1.24.4,<2, requests >=2.31,<3, and the local PDF capability check. Dependency errors distinguish missing imports, unrecognized versions, old/unsupported versions and failed PDF capabilities; this does not certify every accepted release. Side-by-side native radio controls replace the PDF-mode dropdown to avoid the reported overlapping options. Switching preserves the current page; refusing to discard unsaved edits restores the previous choice. The full-paper window now has stage-specific primary actions, adjustable columns, a single-pane layout for narrow windows, direct page navigation and a separate recovery view. Original text remains readable during model translation; preview image downloads wait, while editing and configuration stay locked. Failed passages have short source excerpts and original-page navigation only when the unified document provides an exact mapping. The right pane always shows recognized source text, not the Chinese translation.
0.1.60–0.1.65 progress and completed translations remain usable. After PDF failure, choose 重试生成中文 PDF or export Markdown without translating again. Completed tasks offer confirmed regeneration under 更多操作, adding a new attachment without deleting the old one. The 0.1.65 image-cache/download safeguards and Windows local-save fixes remain, as do the print host, CSP and sandbox. Protocols from 0.1.59 and earlier still require fresh source confirmation and translation, but no PDF reupload/reparse. Concurrency (default 5, range 1–8), saved-paragraph progress and prose limits are unchanged. The 0.1.70 layout checks used a synthetic browser, not live Zotero or real-paper PDF export/attachment import.
You need a working local installation of the agent you choose, with its login and models configured. Codex and Pi also need Node.js and npm; OpenCode uses native ACP and does not need Node / npx configuration. The plugin does not include those programs. Pi requires Pi 0.85.1 or later and Node.js 22.19.0 or later.
For Codex or Pi:
- Open Zotero settings, then Smart Paper Translator → Agents (ACP).
- Select the paths to Node and
npx-cli.jsin the shared runtime section, then click Check Node / npx. Paths can be selected from detected installations, entered manually, or chosen with the file picker. - In the Codex or Pi tab, select that agent's executable and click Prepare and inspect (准备并检测).
| Agent | Adapter prepared by the plugin |
|---|---|
| Codex | @agentclientprotocol/codex-acp@1.6.2 |
| Pi | pi-acp@0.0.33 |
Preparation downloads the pinned adapter and checks the connection and model options without sending a prompt. Once it finishes, choose your defaults and send a question from the sidebar. Normal chat startup uses the cached adapter; it won't download or upgrade packages in the background.
Codex and Pi share the Node / npx runtime and keep their own model settings. The screenshot above shows the existing Pi panel.
For OpenCode 1.18.30 or a newer stable 1.x version, open the OpenCode tab, select the local executable (including installations in ~/.opencode/bin), and click Detect OpenCode (检测 OpenCode). If the path is empty, detection selects the first local candidate; existing or manually entered paths are kept. You can then choose default model and thinking options. Detection uses an independent empty session and temporary database, sends no prompt, and removes temporary data when done. It does not download dependencies. If something is missing, first run opencode in your terminal to complete login and dependency setup, then inspect again.
Version 0.1.39 fixes detection errors caused by terminal title codes in OpenCode output and incomplete reads of large model catalogs.
OpenCode chat disables automatic upgrades, background model catalog refresh, and npm downloads. Its accompanying HTTP server binds to 127.0.0.1 on a random port with a random process password and mDNS disabled. A changed executable path or version requires a fresh inspection; saved paper conversations remain available.
If a path or model is missing, use the path refresh or agent inspection controls in settings. With NVM, check the Node path selected in Zotero: it may differ from the one your terminal uses. Detailed setup and troubleshooting are in the technical reference (Chinese).
The reader also has selection translation and an abstract/glossary panel. These use a separately configured translation API, with a DeepSeek preset and support for OpenAI Chat Completions compatible services.
- Translate a selected passage and reuse its cached translation. Automatic selection translation is optional and off by default.
- Read the translated abstract and saved terms in a floating panel. Uncached abstracts are translated when you open a PDF, once the translation service is configured.
- Delete terms you no longer need, or disable selection translation for one PDF while keeping Add to Agents available.
- Click a smart tag in the library column to list all matching articles in that item's library, across collections. Click an article title to locate it in the library. Matching uses the full tag name with normalized whitespace and ignores letter case. Results are paginated and use existing tags only.
- Click 编辑 (Edit) or + 标签 in an empty cell to add, rename, or delete tags, then save. Manual tags support any language, up to 20 tags of 64 characters each, including items without an abstract. Saved edits take priority over automatic generation; clearing all tags keeps the list empty. They stay in the plugin's local cache and do not change Zotero's native tags.
You can use the Agents sidebar without configuring the translation API.
This local 0.1.65 build fixes Windows worker_failed after a successful dependency check: preview images and layout PDFs now use writable descriptors for atomic-file synchronization, and cache validation reads full file metadata instead of treating normal Windows cache files as invalid. Keep the existing Python environment and task progress; reopen the full-paper window after upgrading and click 加载预览. All 70 offline Python tests passed on Windows with Python 3.13.9, PyMuPDF 1.28.2 and requests 2.32.5. Native Zotero and real OXR behavior were not tested.
This adds a separate PDF → Markdown → Chinese PDF workflow, not an Agent chat. This build's native image output has not been verified. Prior user-run synthetic printing succeeded, but a generated 0.1.64 PDF was subsequently reported to lack images. Release-specific evidence and remaining native verification gaps are recorded in the technical reference.
- Select DeepSeek in the translation settings and configure its address, model and key. Full-paper translation shares these settings, but has separate translation/proofreading prompts and a fixed Simplified Chinese target.
- Under 论文全文翻译 (Full-paper translation), select an existing Python 3.9+ environment with PyMuPDF >=1.24.4,<2 and requests >=2.31,<3, then click 检测本地依赖. You prepare dependencies yourself; the plugin never installs them. The default OXR address is
https://free-oxr.somark.ai/api/v1and can be changed. - Open a PDF attached to a regular paper in an editable library and click 全文译 in the main-window Reader toolbar. Opening the window does not upload the PDF or call a model; source previews can automatically download and cache public HTTP/HTTPS images without another confirmation. 上传 PDF 并解析 asks before uploading the PDF to OXR. A collapsible list shows each actual page range (up to 20 pages per block, split further by size), waiting-to-upload/queued/parsing/completed states, completed block counts and elapsed time—not an estimated percentage. Expand or collapse it at any time; updates preserve your choice. Closing pauses local work; submitted remote jobs may continue.
- The right pane defaults to the source for the PDF page on the left. Select a paragraph, equation, table or image block, then use 编辑一段 to edit and save it. 预览全文 shows the complete source, including saved edits, with a return-to-page button; it does not show the translation. New parses assemble one editable document from OXR's page blocks, so page preview, full preview and translation share the same source. Layout may differ from OXR's original Markdown, which is kept as a backup; no extra per-page parsing requests are made. Older tasks require confirmation before conversion, with the previous source/checkpoint archived. Edits require fresh translation confirmation. Missing page data requires separately confirmed 重新上传并解析; failure keeps the old work and imported attachments are not deleted. Algorithm pseudocode renders math while ordinary code remains literal. Check equations, tables and bibliography before confirming; References/Bibliography entries and inline citation markers stay unchanged, and unsupported HTML remains source text.
- Choose 并发数 (default 5, range 1–8), then click 确认并开始翻译 / 重试 and confirm the destination, model and concurrency. The setting is saved per task and can only change while idle or paused. Different paragraphs run concurrently; each still follows translation → proofreading → format validation. The progress bar counts only validated, durably saved paragraphs and shows translating/reviewing/saving/waiting/failed counts; 100% does not mean PDF import is complete. Format failures retry up to three rounds. A final failure stops new work, lets active paragraphs finish and save, then pauses. You can pause immediately to cancel active requests. Failed drafts remain separate. 重新翻译此段 starts only the selected unfinished paragraph from its confirmed source, without reusing its failed draft or touching other checkpoints; 继续未完成段落 resumes the task, reusing valid saved drafts and regenerating invalid ones. Unsaved edits can be discarded after confirmation, so failed draft validation never blocks retry. Optional manual repair is collapsed under 高级: source parts are shown as read-only JSON; edit only the draft's
textvalues, keeping everyidand its order; 保存草稿 saves locally but still requires model review, and 放弃未保存修改 restores the saved draft without any request. Both model passes returntranslationsarrays ofid/textobjects. The plugin restores numbering, line breaks, equations, code and links from the local source; missing parts or changed structure are rejected. Parts within one paragraph are sent together, not as separate requests. A successful, confirmed run automatically attempts PDF generation and import; if export fails, keep/export the Markdown and retry 生成并保存中文 PDF later.
The Chinese PDF is a new attachment under the same paper. PDF preparation reuses cached images and safely downloads missing ones; failed download, validation or decoding stops output rather than saving a missing-image PDF. After an earlier successful import, 重新生成中文 PDF reuses the saved translation and adds a new attachment after confirmation; it does not delete the old one or repeat model calls. The Reader's 中文 / 英文原文 control switches attachments; the original PDF and annotations are untouched. Reflow changes layout and page numbers, and annotations do not transfer. Markdown is exportable but is not added as a Zotero attachment. Saved source edits persist before translation confirmation; closing warns before discarding unsaved edits. Approved work and completed paragraphs remain local.
Source previews and PDF image preparation support public HTTP/HTTPS URLs, arbitrary hosts and paths, signed parameters and up to five cross-origin redirects, so changing the parsing API does not require an OXR-specific URL layout or filename extension. Downloads omit cookies/authentication headers and do not persist redirect signatures. Each hop is checked, with DNS preflight before connecting; local/private destinations, file URLs, scripts and SVG are blocked. The whole chain shares a 15-second timeout, byte and image-size limits. Domain DNS results may use the proxy Fake-IP range 198.18.0.0/15; requests retain the original hostname. Direct URLs to that range, internal names and other private DNS results remain blocked. This range alone does not prove a proxy is present: the exception trusts the current network's routing. HTTP is unencrypted; DNS preflight is not an absolute network sandbox. Failed images keep their Markdown and can be retried. PDF preparation uses the same controlled backend; the print document only receives validated embedded images and cannot access the network. Markdown export does not download images.
Local PDF copies, OCR results, original backups, editable page documents, image caches, confirmed Markdown and checkpoints are stored under smart-paper-translator/fulltext/ in Zotero's data directory, unencrypted and outside Zotero sync. The imported Chinese attachment follows Zotero's normal attachment/sync settings. OXR receives uploaded PDF content; image services referenced in the source and their redirect destinations receive image requests; the configured DeepSeek endpoint receives paragraph text, excluding protected image data and URLs. Review each service's retention policy before proceeding.
Opening the Agents sidebar or switching agents reads local history without requesting model output. Your first message gives the selected agent a copy of the PDF in a workspace for that paper. Later messages include your question and any selections or screenshots you attach. The agent can still read the PDF in its workspace.
The agent runs locally, but its configured model provider may receive paper content and prompts. Codex uses its existing account and configuration, including Skills and MCP; Pi and OpenCode use their own login, models, permissions, and extensions. Agent chat does not automatically modify Zotero items or import generated files; full-paper translation imports its Chinese PDF only after the separate confirmation described above.
Codex starts in approval mode. You can enable Full Access for the current conversation to allow network access and file operations outside its workspace. Pi and OpenCode follow their local tool and extension configuration. OpenCode permission requests appear in the conversation. The paper workspace is not a security sandbox for Full Access, Pi, or OpenCode.
OpenCode image questions require explicit image support in the inspected model catalog. When a model cannot accept PDFs directly, the first question references a text snapshot in the paper workspace.
Regular chat histories, PDF copies, and screenshots are stored in separate codex-acp/, pi-acp/, and opencode-acp/ directories under smart-paper-translator/ in your Zotero data directory. These files are not encrypted or included in Zotero sync. Text and selection drafts last only for the current Zotero run; screenshot drafts can be restored after a restart. Translation API keys are stored in Mozilla Login Manager.
Read AGENTS.md before changing plugin code. Runtime files live in plugin/; tests and build tools stay outside the XPI. Development checks require Node.js 22, Python 3, and Info-ZIP.
npm run check
sh scripts/build.sh
shasum -a 256 -c dist/SHA256SUMS
unzip -t dist/smart-paper-translator-0.1.73.xpiBuild output goes to dist/. Automated tests and static archive checks are the default delivery checks; native Zotero parsing and UI testing run only when separately requested. The technical reference (Chinese) covers adapter behavior, storage, rendering limits, and historical validation results.
If you report a bug, include your plugin and Zotero versions, the selected agent, and steps to reproduce it. Remove API keys and private paper content from logs and screenshots.



