Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1982699
feat: add OpenPhotoShop image editing MiniApp
Oct 19, 2026
9a89169
refactor: rename community app to MiniMax Photo
Oct 19, 2026
5ee1942
feat(photo): visualize AI brush edits on the canvas
Oct 19, 2026
a434304
feat(photo): bundle a reusable image editing skill
Oct 19, 2026
1897859
feat(photo): render real sequential brush strokes and smooth paths
Oct 19, 2026
a08acef
docs(photo): guide tonal planning and brush validation
Oct 19, 2026
ad65a84
feat(photo): record the rendered canvas without desktop capture
Oct 19, 2026
9d75887
Support bounded console logs in Photo PTC scripts
Oct 19, 2026
072093a
Clarify Photo engine tools and clipped shading guidance
Oct 19, 2026
75696ee
Correct the PTC table reference
Oct 19, 2026
1199ecf
Check reference likeness before refining shading
Oct 19, 2026
e5a2e56
docs: avoid unnecessary reference imports for drawing
Oct 19, 2026
05bd163
Add bounded reference contour tracing workflow
Oct 19, 2026
a54dd5b
Align MCP package identity and document native drawing validation
Oct 19, 2026
70ca695
Explain drawing and recording in all help languages
Oct 19, 2026
51d1268
Record native multilingual help acceptance
Oct 19, 2026
4a4ee55
Fix default pressure for point-based brush strokes
Oct 19, 2026
8070f09
Release Photo 0.2.24 with verified point pressure
Oct 19, 2026
8848227
Document native pressure brush settings
Oct 19, 2026
0308a23
Preserve contour groups for reference drawing workflows
Oct 19, 2026
416b733
Require current-session editor and bounded drawing payloads
Oct 19, 2026
3475877
Expose exact editor identity for multi-page workflows
Oct 19, 2026
89c7d8a
Record native cross-session editor identity verification
Oct 19, 2026
45e24b7
Document native single-turn drawing evidence
Oct 19, 2026
c9d8568
Reduce showcase image payload without resizing
Oct 19, 2026
7812517
Record compressed package native acceptance
Oct 19, 2026
6b17294
Clarify required generated image result submission
Oct 19, 2026
6a87d9e
Record generated image return and open verification
Oct 19, 2026
2218cd0
Record native image edit round-trip acceptance
Oct 19, 2026
6722a66
Render assistant Markdown replies with safe structured formatting
Oct 19, 2026
e74d3ba
Document native assistant formatting verification
Oct 19, 2026
8d5dee6
Record native project reopen and recovery checks
Oct 19, 2026
27a1b25
Record native 12 megapixel canvas verification
Oct 19, 2026
8c7dc48
Guide editor tool discovery and typed parameters
Oct 19, 2026
f384d2d
Document guided export recovery in native 0.2.30
Oct 19, 2026
f985ced
Reject unsupported export paths before queuing editor jobs
Oct 19, 2026
c803d5f
Verify export validation in native MiniMax Code
Oct 19, 2026
bf208ea
Verify autonomous in-app image generation and opening
Oct 19, 2026
2143c38
Refresh public installation and verification status
Oct 19, 2026
4d4550e
Add optional contour preview to reference tracing helper
Oct 19, 2026
00e0f9c
Package reference tracing preview as 0.2.32
Oct 19, 2026
9ea3fa8
Record native 0.2.32 installation verification
Oct 19, 2026
d8279e8
Record layered PSD round-trip and agent import gap
Oct 19, 2026
0988a8d
Add explicit local image and project import tool
Oct 19, 2026
aef3944
Release 0.2.33 and verify native agent PSD import
Oct 19, 2026
47834d6
Reject invalid pixel coordinates before editor submission
Oct 19, 2026
fb836ab
Release 0.2.34 with verified pixel input validation
Oct 19, 2026
a8a8867
Refresh delivery documentation for verified 0.2.34
Oct 19, 2026
b83df27
docs: clarify traced stroke coordinates and record single-turn showcase
Oct 20, 2026
6c36d4f
fix: normalize imported project file extensions
Oct 20, 2026
5885dfe
chore: release Photo 0.2.35 with native project import verification
Oct 20, 2026
367eb13
docs: align showcase timing with latest verified run
Oct 20, 2026
9303f01
docs: record native crop resize and undo workflow
Oct 20, 2026
6da154c
docs: verify in-app AI grayscale editing and export
Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques

| MiniApp | What it does | Author |
| --- | --- | --- |
| [MiniMax Photo](plugins/webguhui/minimax-photo/) | Layered image editing with an in-app AI assistant, local recovery and programmatic editing tools | [WebGuHui](https://github.com/WebGuHui) |
| [AI Office](plugins/cristinamadureira353-svg/ai-office/) | Manage five model-powered employees in a pixel office: client tasks, chats, breaks, meetings and quota-aware offline states; uses your own API keys | [最爱双皮奶](https://github.com/cristinamadureira353-svg) |
| [Token Usage Board](plugins/amszuidas/mcode-token-usage-board/) | Explore local Token usage by date, model, and session, including input, output, and cache usage | [amszuidas](https://github.com/amszuidas) |
| [Token Usage Board](plugins/yanhy2000/mcode-usage-monitor/) | Watch local Token usage, output speed, and cache hit rate in near real time; filter by time range, model, and session | [yanhy2000](https://github.com/yanhy2000) |
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求

| MiniApp | 功能 | 作者 |
| --- | --- | --- |
| [MiniMax Photo](plugins/webguhui/minimax-photo/) | 图层图片编辑、应用内 AI 助手、本地恢复与程序化编辑工具 | [WebGuHui](https://github.com/WebGuHui) |
| [AI 事务所](plugins/cristinamadureira353-svg/ai-office/README.zh-CN.md) | 五位真实模型员工的像素事务所:接单、聊天、休息和开会,额度耗尽时角色暂停;使用玩家自己的 API Key | [最爱双皮奶](https://github.com/cristinamadureira353-svg) |
| [Token 用量看板](plugins/amszuidas/mcode-token-usage-board/README.zh-CN.md) | 按时间、模型和会话查看本机 Token 用量,包含输入、输出和缓存用量 | [amszuidas](https://github.com/amszuidas) |
| [Token 用量看板](plugins/yanhy2000/mcode-usage-monitor/README.zh-CN.md) | 近实时查看本机 Token 用量、输出速度与缓存命中率,可按时间范围、模型和会话筛选 | [yanhy2000](https://github.com/yanhy2000) |
Expand Down
2 changes: 2 additions & 0 deletions plugins/webguhui/minimax-photo/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Unified patches contain single-space context lines for blank source lines.
docs/photocraft/*.patch whitespace=-blank-at-eol
5 changes: 5 additions & 0 deletions plugins/webguhui/minimax-photo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
releases/
__pycache__/
*.log
evidence/
20 changes: 20 additions & 0 deletions plugins/webguhui/minimax-photo/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schemaVersion": 1,
"name": "minimax-photo",
"displayName": "MiniMax Photo",
"version": "0.2.35",
"description": "本地图像编辑、图层、选区、调色与工程管理。",
"author": "WebGuHui",
"icon": "icon.png",
"category": "Design & Sites",
"exampleQueries": [
"打开 MiniMax Photo,编辑一张图片"
],
"apps": [],
"mcpServers": [
"servers.mcp.json"
],
"skills": [
"skills/minimax-photo/SKILL.md"
]
}
21 changes: 21 additions & 0 deletions plugins/webguhui/minimax-photo/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 WebGuHui and MiniMax Photo contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 76 additions & 0 deletions plugins/webguhui/minimax-photo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# MiniMax Photo

[简体中文](README.zh-CN.md)

An image-editing MiniApp for MiniMax Code. Edit layers, selections and colors yourself, or ask the in-app assistant to inspect the canvas, perform reversible edits and generate images with the tools available in your Host.

The main editor is an adapted [PhotoCraft](https://github.com/storytold/photocraft) WebAssembly build. The MiniApp adds onboarding examples, a movable and collapsible assistant, recovery snapshots, image-result handling and programmatic tool composition. It does not bundle Electron, model weights or API keys. This is a community project, not an Adobe product or an official MiniMax app.

![MiniMax Photo welcome page with generated example images](docs/preview.png)

## Features

- Layered editing with import, undo/redo, project saving and flattened PNG export.
- Three bundled AI-generated examples: product photography, portrait and coffee poster.
- In-app Agent chat with tool progress, permission prompts, cancellation, retained drafts and conversation continuation.
- MCP tools for image requests, canvas inspection, editor commands and programmatic composition in an isolated QuickJS worker. See [tool guide](docs/agent-tools.zh-CN.md).
- Local recovery of the active artwork and assistant state.
- Simplified Chinese, Traditional Chinese, English and Japanese in the main interface and help. The optional legacy editor remains Chinese.

## Install and open

Requires MiniMax Code **3.1.2 or later**. Copy this entire directory, including `.minimax-plugin`, to `<dataDir>/plugins/minimax-photo/` while the client is closed. The default data directory is `~/.minimax`; use your configured directory if different. Do not copy the `webguhui` author directory. Restart the client, enable the plugin and ask it to open **MiniMax Photo**.

No dependency installation or compilation is needed to use the committed runtime files. The GitHub plugin-import flow does not install these MiniApp packages; follow the repository's manual installation instructions.

Open an image or example, edit it, then use **More → Save project** to retain layers, or **Export PNG** for a flattened image. The `.pcraft` project format is inherited from PhotoCraft. Open the AI assistant and send a request inside the app. Generated results open as new artworks; they do not replace the original automatically.

When updating, save important projects, stop active AI work and close the client before replacing the complete plugin directory. This public `minimax-photo` package is a separate installation from the development `retouch-lab` package: it does not migrate that package's private state. Saved `.pcraft` and legacy `.retouch.json` files remain supported. Uninstalling the plugin may leave its Host-managed private data behind.

The bundled [editing skill](skills/minimax-photo/SKILL.md) guides command discovery, batched edits, preview checks and recovery. It uses task-dependent strategies rather than subject-specific drawing templates.

## Tested environment

Tested on macOS Apple Silicon in MiniMax Code, initially with client **3.1.3-preview.4675**. Package **0.2.35** was installed on 2026-10-20; all 98 installed files matched the release. The runtime ZIP is **14,263,623 bytes**, without Electron or model weights.

- A single in-app request generated an image, returned it automatically and opened it as a new artwork. Semantic image editing also has a successful native Host test.
- Layered project reopening, recovery, four-language help, examples, draft retention and assistant collapse were exercised. Version-specific evidence is in [validation notes](docs/validation.md).
- A 4000×3000 canvas completed 100 strokes, one-stroke undo and PNG export. One export took about 1.33 seconds; drawing included display delays, so this is not a rendering benchmark or competitor comparison.
- In 0.2.34, AI opened a layered PSD through `editor_open_file`, preserving editable text and a vector shape. Invalid pixel coordinates were rejected without changing the document.
- In 0.2.31, unsupported export paths fail before a job is queued; valid exports return usable PNG paths. Package, PTC, drawing and all 69 community checks pass.

One historical open failure required a restart; its cause is unresolved. Natural-language tasks can still misuse tools and are not guaranteed to finish autonomously. The latest single-request reference sketch on 0.2.34 took 15 minutes 45 seconds; eye details and shading still need improvement. The 0.2.35 Skill changes have not yet been measured for drawing speed. Windows, stable-client compatibility, complex PSD fidelity and every editor command have not been fully tested. This is not a claim of Photoshop parity or better performance than PhotoCraft.

## Data & access

The editor_open_file tool reads an explicitly supplied local PNG/JPEG/WebP/PSD/pcraft file (up to 32 MB), checks its header, and sends a private copy to the connected editor as a new document. It does not scan directories or modify the original file. The task payload is stored under the plugin data directory; tool replies omit the file bytes.

- The Node service binds only to the Host-provided loopback address. It reads bundled assets from the plugin directory and stores projects, recovery snapshots, assistant drafts/replies/session IDs, image requests/results, editor jobs and exports under opaque `context.dataDir` paths. It does not read Host configuration, credentials or conversation databases.
- Images selected through file inputs are read in the page. Save/export uses the browser download dialog. The backend can read a PNG path supplied to `submit_image_result`; this is a privileged Agent tool, not an arbitrary-file HTTP endpoint. The Agent may write generated files into its working directory before returning them.
- This package declares `agentAccess: ["session.run"]`. Sending a request runs a Host Agent that can access files, shell and MCP tools under Host permissions. Requests include the user's instructions and current artwork context; image tasks may include a reference image. Model/provider traffic is handled by the Host and its selected tools, not by an embedded API key.
- The MiniApp backend makes no direct external service requests. Provider destinations depend on the Host's enabled services; there is no fixed provider-host list in this package. The app does not automatically approve permission requests.
- PTC uses a Node worker thread with a QuickJS VM and a bounded editing API. It has no direct filesystem or network API. The MiniApp itself starts no shell subprocess; Host Agent tools may do so after a user request.
- Browser storage holds language/window preferences. Domain state is stored in the Node private directory. Recovery checks only the active document every few seconds and does not replace saving a project. Avoid editing the same assistant conversation in two windows; stale writes are rejected.
- Recovery and generated files are retained locally with no automatic retention cleanup. Back up important projects independently. A stopped or unknown-result request is not automatically resent.

![MiniMax Photo editor showing a generated product photograph](docs/editor.png)

## Development

See [build instructions](docs/build.md), [user guide](docs/user-guide.zh-CN.md) and [validation notes](docs/validation.md). A normal browser preview supports editing but cannot run Host Agent tasks.

## License and attribution

Original MiniApp code is MIT licensed; see [LICENSE](LICENSE). PhotoCraft is MIT OR Apache-2.0 and retains its own credits. Its pinned source and our patch are documented in [build instructions](docs/build.md). Third-party fonts, icons, UI dependencies and QuickJS retain their licenses in [licenses/](licenses/). The example images were generated with Codex's image-generation tool, not supplied by PhotoCraft or Adobe. They are illustrative single-layer images, not editable design templates. No proprietary RetouchPi source or assets are included.

AI edits show a short completion replay: brush paths and their bounding area, or a canvas highlight for other edits. Toggle it in More → Show AI edit activity. This is a visual overlay after an edit succeeds, not an animated mouse or incremental pixel execution; it does not enter exports or undo history.

### Visible drawing

PTC `await editor.draw({strokes, intervalMs:550})` draws an array of `paint.stroke` parameters in order (1–96 strokes, 100–600 ms between strokes). Every stroke updates the real canvas and has its own undo step. Failures preserve completed strokes. `editor.edit` continues to commit atomically. The bundled Skill covers reference composition and tonal drawing.

Strokes also accept absolute SVG-style path command arrays (`M`, `L`, `Q`, `C`, `Z`), sampled by the tool. This avoids repeatedly implementing curve interpolation in Agent scripts.

### Canvas recording

More → Record drawing process records the editor's own canvas at up to 20 fps, including its editor controls, without desktop capture permissions or other windows. Stop recording, then use More → Save recording to download a WebM video. The recording stays in memory so a cancelled save can be retried; clear the buffer after saving to begin another recording. Closing/reloading the app loses unsaved video and prompts before leaving. Recording stops at 60 minutes or 256 MiB. Browser background throttling can reduce frame rate. It records actual rendered changes; it does not reconstruct missed strokes or turn atomic edits into animation.
55 changes: 55 additions & 0 deletions plugins/webguhui/minimax-photo/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# MiniMax Photo

[English](README.md)

运行在 MiniMax Code 中的图片编辑器。你可以手动编辑图层、选区和颜色,也可以直接在应用里的 AI 助手输入需求,让 Agent 读图、改图或调用宿主提供的生图工具。

编辑器基于开源 PhotoCraft 的 WebAssembly 版本,增加了示例引导、可拖动和收起的助手、作品恢复、图片回传,以及程序化组合调用。没有打包 Electron、模型权重或 API 密钥。这是社区作品,不是 Adobe 产品,也不是 MiniMax 官方应用。

![MiniMax Photo welcome page with generated example images](docs/preview.png)

附带 [图片编辑 Skill](skills/minimax-photo/SKILL.md),指导 Agent 按需发现命令、组合批量编辑、检查预览和从失败处继续。策略不绑定特定题材,用户可以直接附图描述需求。

## 安装与使用

需要 MiniMax Code 3.1.2 或更新版本。退出客户端,将本目录完整复制到 `<dataDir>/plugins/minimax-photo/`,保留隐藏的 `.minimax-plugin` 目录;默认 `<dataDir>` 为 `~/.minimax`。不要多套一层 `webguhui` 目录。重启并启用插件,向 Agent 说“打开 MiniMax Photo”。无需安装 npm 依赖。客户端的 GitHub 插件导入不支持此类包,请按社区仓库的手动安装流程操作。

打开图片或示例后即可编辑。“更多 → 保存工程”保留图层,“导出 PNG”保存合并图片。AI 返回的图片会作为新作品打开。工程格式 `.pcraft` 来自 PhotoCraft。

开源版使用新插件 ID `minimax-photo`,与开发版 `retouch-lab` 分开安装,不自动迁移旧版的内部备份和 AI 对话。已有 `.pcraft` 和旧版 `.retouch.json` 文件仍可打开。升级前先保存工程、停止 AI 并退出客户端,再替换完整插件目录。

## 已验证环境

在 macOS Apple Silicon 的 MiniMax Code 中验收,初始客户端版本为 3.1.3-preview.4675。当前包 **0.2.35** 已于 2026-10-20 实际安装,98 个文件与发布包一致,运行 ZIP **14,263,623 字节**,不含 Electron 或模型权重。

- 应用内一句需求完成文生图、自动回传和新画布打开;语义改图也已有真实宿主成功记录。
- 旧版分层工程重开与自动保存恢复、四语言帮助、示例打开、草稿保留和助手收起已验证;不同项目与版本详见 [验收说明](docs/validation.md)。
- 4000×3000 画布完成 100 笔、单笔撤销和 PNG 导出。单次导出约 1.33 秒;绘制包含展示间隔,不作为纯渲染或竞品性能结论。
- 0.2.34 AI 通过文件导入工具打开分层 PSD,可编辑文字与矢量形状保留;无效取色坐标明确拒绝,文档版本不变。
- 0.2.31 错误导出路径参数会在入队前被拒绝;正常导出返回可用 PNG 路径。打包、PTC、逐笔与社区 69 项检查通过。

仍存在一次历史打开失败后需重启恢复的记录,根因未确认。自然语言任务可能出现工具误用,不能保证每次都自主完成;最近一次 0.2.34 附图素描单轮耗时 15 分 45 秒,眼睛和排线仍需改善;0.2.35 Skill 修订的提速效果尚未验证。Windows、稳定客户端、复杂 PSD 和全部编辑命令未全面验证,不声称完整兼容 Photoshop 或性能全面超过 PhotoCraft。

## 数据与权限

`editor_open_file` 读取明确提供的本机 PNG/JPEG/WebP/PSD/pcraft 文件(最多 32 MB),检查文件头后交给编辑器作为新文档打开。不扫描目录、不修改原文件。任务内容保存在插件数据目录,工具回复不含文件字节。

应用在宿主分配的本机端口运行,工程备份、草稿、回复、会话编号、图片和编辑任务存入宿主提供的 `context.dataDir`。不读取宿主配置、密钥或会话数据库。选择文件在页面中完成,保存使用下载对话框。图片回传 MCP 工具可读取 Agent 指定的 PNG 路径;不是任意文件下载接口。

发送需求会运行宿主 Agent,它可以按宿主权限使用文件、Shell 和 MCP;需求和参考图片可能交给用户配置的模型服务。应用不自带密钥,不自动批准权限。后台不直接请求外部服务,也不自行启动 Shell 子进程;Agent 工具可能执行这些操作。PTC 运行于独立 QuickJS 工作线程,仅暴露编辑 API。

自动备份只覆盖当前活动作品,存在几秒间隔;不要替代手动保存。不要同时在两个窗口修改同一 AI 会话,过期写入会被拒绝。本地备份和生成文件暂不自动清理;卸载插件后宿主私有数据可能仍然保留。

## 文档与许可

[用户手册](docs/user-guide.zh-CN.md) · [构建说明](docs/build.md) · [Agent 工具](docs/agent-tools.zh-CN.md)

新增 MiniApp 代码采用 MIT;PhotoCraft、字体、图标和 QuickJS 的原许可证保留在 `licenses/`。展示图片由 Codex 生图工具制作,是单层示例图片。没有包含修图派的专有源码或素材。

AI 编辑成功后会短暂回放画笔轨迹和范围框;其他修改显示画布高亮。可在“更多 → 显示 AI 操作轨迹”关闭。提示层不进入图片导出或撤销记录;这是操作完成后的回放,不是逐像素执行动画。

### 逐笔绘制

PTC 的 `await editor.draw({strokes, intervalMs:550})` 按顺序绘制 `paint.stroke` 参数数组(1–96 笔,间隔 100–600 ms)。每笔真实更新画布并单独撤销;失败时保留已完成笔触。`editor.edit` 仍是整批提交。素描构图和明暗指导见插件 Skill。

笔触支持 SVG 风格的绝对路径命令数组(`M`、`L`、`Q`、`C`、`Z`),由工具采样曲线,避免 Agent 反复编写插值算法。
Loading