[codex] Support WPS document attachments#979
Merged
Merged
Conversation
- route OOXML macro/template variants (.xlsm/.pptm/.ppsx etc.) through officeparser via Buffer so it sniffs by content instead of failing the extension whitelist - parse RTF with a built-in brace-aware extractor instead of handing it to officeparser (which never supported RTF) — no new dependency - replace the extension-lookup-only test with real extractTextFromFile calls over generated OOXML/RTF fixtures Co-Authored-By: Claude <noreply@anthropic.com>
The skip-state was modeled as a counting stack, so a destination that is
both \*-marked AND a known skip destination (e.g. {\*\generator ...},
present in virtually every Word/WordPad RTF) got pushed twice but popped
once — leaking a skip entry that suppressed all following body text. The
feature returned empty and threw on the most common RTF inputs.
- model skip state as a single skipDepth (group level), set once and
cleared when that group closes — no double-marking possible
- honor \ucN fallback-char count (was hardcoded to 1)
- add regression tests with {\*\generator} and {\*\listtable}/\info
groups that fail without this fix
- declare jszip as a devDependency (test fixture builder; was only
resolving via mammoth's transitive hoist)
Co-Authored-By: Claude <noreply@anthropic.com>
Yuan-lai-ru-ci
pushed a commit
to Yuan-lai-ru-ci/Profer
that referenced
this pull request
Jul 10, 2026
本次提交合并了两部分内容(工作树原有大量未提交改动,文件交织无法干净拆分): 一、之前会话的在途工作(计费/代管/团队协作等,非本次新增) - server: relay 令牌链路、credits 预扣/结算/退款、pricing-cache、 billing/proxy-usage/request-log utils + 测试、admin pricing/activation-codes - 客户端: 402 额度不足充值引导、侧栏余额条、凭证口径统一等 二、本次从 Proma 上游移植的 changelog 功能 - proma-ai#988-994 session-core 包 + proma CLI + session-cleaner skill - 新增 packages/session-core/(解析/分组/转录/渲染/渐进式读取,12 测试过) - 新增 apps/cli/(proma session info/outline/search/export/list) - 新增 apps/electron/scripts/build-cli.ts(bun --compile 自包含二进制) - electron package.json 加 @proma/session-core 依赖 + build:cli 入三条 build 链 - electron-builder.yml extraResources 加 resources/bin → bin - config-paths.ts 加 getBundledCliPath() - agent-orchestrator.ts sdkEnv 注入 PROMA_CLI - proma-ai#979 WPS/Office 附件解析 - document-parser.ts 支持 OOXML 宏/模板格式 + 内建 RTF 提取器(9 测试过) - attachment-service.ts 扩充 mime 类型与可解析扩展名 注: server-rel.tar.gz 发布产物已加入 .gitignore,不入库。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
Chat mode already enriches non-image attachments by extracting text before sending the prompt, but the attachment picker and document parser only covered a narrower Office/PDF set. WPS-specific extensions could be excluded or fall into weak fallback paths, and WPS-exported PDFs could fail when pdf-parse produced no text.
Validation