Repository navigation
补齐 MiniMax Photo 文件访问与构建校验说明 - #44
Merged
MyPrototypeWhat merged 1 commit intoOct 20, 2026
Merged
Conversation
Assisted-by: codex-cli reason:photo-review-followup
MyPrototypeWhat
approved these changes
Oct 20, 2026
MyPrototypeWhat
left a comment
Collaborator
There was a problem hiding this comment.
结论:APPROVE
感谢跟进 #36 的评审意见。我对照 PR head 的实际代码逐条核对,文档描述都准确:
submit_image_result(miniapp/node/agent-service.mjs):只要求是绝对路径,没有目录限制;用stat检查是不是普通文件、大小是否超过 16 MB(MAX_IMAGE = 16 * 1024 * 1024),再用validatePNG校验 PNG 内容,然后把副本原子写入插件数据目录的result.png,不改原文件,也没有确认步骤。中英文 README 的描述("任意本机 PNG、最多 16 MB、不限于工作目录或context.dataDir、无额外确认")都与代码一致。editor_open_file(miniapp/node/editor-file.mjs):只校验绝对路径、扩展名(png/jpg/jpeg/webp/psd/pcraft)、文件头和 32 MB 上限,没有目录白名单。与"对支持的格式也没有目录白名单"的说法一致。- WASM SHA-256:我本地计算的结果与
docs/build.md表中的值一致:photocraft_bg.wasm.gz:89574eab…1fb8a4✅- 解压后的
photocraft_bg.wasm:9993bdb9…501d4d✅
- 最低 3.1.2:本包声明了
agentAccess,需要 3.1.2 或更新版本,与仓库根 README 的说法一致。合入前validate对本包报README_MIN_VERSION_MISSING,这个 PR 合入后警告已消除。 - 检查:
npm run validate通过(0 errors);仓库测试用 Node 20 加显式文件列表运行node --test,69/69 通过。
非阻塞的小建议:
validate对本包还剩一个已有的ENTRY_STDOUT警告(miniapp/node/ptc-worker.mjs),和这个 PR 无关,可以以后顺手处理,或者说明一下为什么可以忽略。- 英文 README 写的是 "up to 16 MB",代码里的单位是 MiB(16×1024×1024)。build.md 里写的是 "16 MiB"。要统一的话可以都写成 MiB,不影响结论。
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.
跟进已合并的 #36 中的 review 建议,补齐 MiniMax Photo 的权限与构建说明。
submit_image_result可读取插件进程有权限访问的任意本机 PNG(最多 16 MB),不限于会话工作目录或插件数据目录;editor_open_file同样没有目录白名单。说明两者不会额外弹出文件选择确认框,原文件不被修改。采用 review 提出的明确披露方案,保留生成文件和用户图片位于不同目录的导入用法。验证:
npm run check通过,69/69;git diff --check通过;两个 SHA-256 从当前提交的文件实际计算。仅改文档,运行代码、包版本(0.2.35)和引擎文件未变,未新增测试或重跑宿主绘图验收。本包剩余 ENTRY_STDOUT 警告来自打包的 QuickJS/Emscripten worker。
editor-code.mjs创建独立 worker 时设置 stdout/stderr 为独立流并消费,不写入 Host 入口 stdout;沿用 #36 review 的处理建议,本次不为消除静态警告重写第三方产物。其他插件已有的 README 警告不在本次范围内。Need help on this PR? Tag
@codesmith-botwith what you need.