Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-pet/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "minimax-pet",
"displayName": "MiniMax Pet",
"version": "0.9.0",
"version": "0.9.2",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
3 changes: 3 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Version **0.9.0** adds two settings. **Task notifications** sets how many second

Version **0.9.0** also gives the desktop window one fixed size, tall enough for the open card. Earlier versions grew the window when a card opened, which moved it on screen and made the pet jump for a frame; now opening or closing a card only shows or hides it. The area above the pet is transparent and passes clicks through to whatever is behind it.

Version **0.9.2** keeps the desktop window at its intended size while dragging by sending the configured size with each move, rather than carrying forward unexpected native bounds. The desktop task card is centered and capped at 264 CSS pixels; it can still fit narrower windows with the existing 8-pixel side gutters. Permissions and dependencies are unchanged.

Version **0.8.1** fixes the desktop card: the title truncates to one line, only the reply scrolls, and the actions stay pinned, so a long title or reply no longer pushes 返回任务 / 打开对话 out of the card. Expanding the card also grows the window instead of squeezing the reply into one line.

Version **0.8.0** aligns the panel with the MiniMax Code design language: 24px page margins and section gaps, 14px/22px body copy with 12px/18px supporting text, 32px minimum control height, 12px cards and 8px controls, 0.5px borders on desktop overlays, and press/focus states. The desktop pet keeps its 280px layout with the same tokens.
Expand Down Expand Up @@ -47,6 +49,7 @@ Earlier local prototypes use a different plugin ID. The Host gives `minimax-pet`
- An earlier UI version was exercised on macOS in a MiniMax Code development build: three tabs, wide/narrow layouts, task reading, real session/ask activity, import/delete, and desktop round trips. Version 0.6.0 has Node/DOM tests (including the open and theme paths against a simulated Host), an isolated HTTP smoke test, and a browser check of the panel layout outside the Host.
- The default atlas is checked by actual PNG decoding, frame coverage and deterministic rebuild tests. The separate octopus icon is checked by PNG decoding and visual review. On 2026-10-26, the packaged Skill was exercised with a real Agent in the macOS development build to create, validate, preview and import a custom v2 pet; all nine animation previews and the four cardinal mouse-look directions were checked. This does not replace released-client acceptance.
- Version 0.9.0 has Node/DOM tests for the card timer, the preference round trip and the copy of both languages (every key the page uses must exist in both), plus a browser check of the panel and desktop window in both languages against a simulated Host. Not verified for 0.9.0: the language the real client reports on any given install, and both languages inside a real MiniMax Code window.
- Version 0.9.2 was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). With the task card open, four automated pointer drags moved the real window without cumulative width or height growth. A physical mouse and other display configurations were not tested for this fix.
- Not verified for 0.6.0: opening a conversation or following the theme inside a real MiniMax Code 3.1.11+ window (panel or desktop pet), any Windows GUI, and released-client installation or GUI acceptance on 3.1.6. Automated tests use synthetic data and do not prove those paths.

## Data & access
Expand Down
4 changes: 4 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

**0.9.0** 把桌面窗口固定成一个尺寸,本来就放得下展开的卡片。之前点开卡片会把窗口撑高,窗口在屏幕上跟着移动,桌宠会跳一下;现在开合卡片只显示或隐藏,不动窗口。桌宠上方是透明区域,点击会穿透到底下的窗口。

**0.9.2** 拖拽时同时发送坐标与当前缩放对应的窗口尺寸,不再沿用宿主异常放大的尺寸。桌面任务卡居中,宽度上限为 264 CSS 像素;窗口较窄时仍会缩小并保留两侧各 8 像素的留白。权限和依赖不变。

**0.8.1** 修复桌面卡片:标题单行截断,只有回复区滚动,底部操作固定在卡片内;长标题或长回复不再把「返回任务 / 打开对话」顶出卡片。展开卡片时窗口同步变高,回复不会被压成一行。

**0.8.0** 按 MiniMax Code 的设计语言对齐面板:24px 页边距与区块间距、14px/22px 正文与 12px/18px 辅助文字、控件最小高度 32px、卡片 12px 与控件 8px 圆角、桌面浮层 0.5px 描边,并补齐按下与焦点状态。桌面宠物保持 280px 布局,沿用同一套 token。
Expand All @@ -40,6 +42,8 @@

更早的 UI 版本已在 macOS 开发版验收三页签、窄宽布局、真实任务与 ask、导入删除和桌面切换;0.6.0 运行 Node/DOM 测试(含模拟 Host 下的打开对话与主题路径)、隔离 HTTP smoke,并在 Host 之外用浏览器检查了面板布局。默认图集通过 PNG 解码、动画帧覆盖与确定性重建检查;独立的章鱼图标通过 PNG 解码和视觉检查。2026-10-26,已用 macOS 开发版中的真实 Agent 调用随包 Skill,完成自定义 v2 宠物的生成、校验、预览和导入,并检查九种动作预览与鼠标上/右/下/左四向注视。0.6.0 尚未在真实的 MiniMax Code 3.1.11+ 窗口(面板或桌面宠物)中验收打开对话和主题跟随,也未验收 Windows GUI、正式客户端安装或 3.1.6 正式版 GUI;合成数据测试不能证明这些路径。

0.9.2 已在 Windows 11 x64(构建 26200,屏幕缩放 150%)的 MiniMax Code **3.1.19.232** 中测试。任务卡展开时通过自动化指针连续拖拽四次,真实窗口发生位移,宽高未逐次累加。此修复未测试物理鼠标及其他显示配置。

## 数据与能力边界

只申请 `session.read`,读取 Host 对本插件可见的用户会话状态和所选会话最新回复,不直接读取 Host 数据库、日志、配置或凭据。状态和提醒只在页面内存中,关闭或静音不修改 Host 的任务或未读事实。
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-pet/miniapp/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2 id="connection-title" data-i18n="settings.connection">任务连接</h2>
<details class="panel-help">
<summary data-i18n="settings.help">版本与帮助</summary>
<div class="help-content">
<p class="muted">MiniMax Pet 0.9.0</p>
<p class="muted">MiniMax Pet 0.9.2</p>
<div class="row">
<span id="version-badge" class="badge" hidden></span>
<span id="source-badge" class="badge"></span>
Expand Down
19 changes: 15 additions & 4 deletions plugins/minimax-ai/minimax-pet/miniapp/client/pet-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ let panelDetailId = null;
const app = {
mode: 'standalone', // 'standalone' | 'inline' | 'window'
modeSwitching: false,
scaleChanging: false,
pets: [],
spriteUrls: new Map(),
pet: null, // LoadedPet from the player module
Expand Down Expand Up @@ -887,7 +888,7 @@ function noteInteraction() {
// ---------------------------------------------------------------------------

function onSpritePointerDown(e) {
if (app.mode !== 'window' || e.button !== 0 || !app.pet) return;
if (app.mode !== 'window' || app.restoringPosition || app.scaleChanging || e.button !== 0 || !app.pet) return;
noteInteraction();
if (app.menuOpen) closeMenu();
e.preventDefault();
Expand All @@ -909,7 +910,7 @@ function onSpritePointerDown(e) {

function onSpritePointerMove(e) {
const d = app.drag;
if (!d || e.pointerId !== d.pointerId) return;
if (!d || e.pointerId !== d.pointerId || app.scaleChanging) return;
const dx = e.screenX - d.startX;
const dy = e.screenY - d.startY;
if (!d.active) {
Expand All @@ -926,7 +927,12 @@ function onSpritePointerMove(e) {
}
updateDragDirection(d, e.screenX);
if (!d.win) return;
callBridge(() => win.update({ x: Math.round(d.win.x + dx), y: Math.round(d.win.y + dy) })).catch((error) => {
// On Windows a position-only update can return enlarged native bounds. Send the
// design size with the move, rather than carrying the enlarged bounds into the next one.
callBridge(() => win.update({
x: Math.round(d.win.x + dx), y: Math.round(d.win.y + dy),
width: DESK_WIDTH, height: deskHeight(prefs.scale),
})).catch((error) => {
const code = errCode(error);
if (code === 'not_permitted') console.debug('[pet] drag_move_rejected: not_permitted (target is off every display)');
else console.warn('[pet] drag_move_failed:', code, error);
Expand Down Expand Up @@ -1504,6 +1510,9 @@ async function deletePet(pet) {

function setScale(value) {
const intent = ++scaleIntent;
// Geometry stays with the size setting until its bounds and preference agree.
app.scaleChanging = true;
cancelDrag();
const current = () => !disposed && intent === scaleIntent;
scaleUpdates = scaleUpdates.then(async () => {
if (!current()) return;
Expand Down Expand Up @@ -1543,7 +1552,9 @@ function setScale(value) {
prefs.scale = value;
savePreferences({ scale: value });
renderScale();
}).catch(logError('scale_update'));
}).catch(logError('scale_update')).finally(() => {
if (intent === scaleIntent) app.scaleChanging = false;
});
return scaleUpdates;
}

Expand Down
3 changes: 3 additions & 0 deletions plugins/minimax-ai/minimax-pet/miniapp/client/pet.css
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,9 @@ html.mode-window .pet-sprite:focus-visible {
left: 8px;
right: 8px;
bottom: calc(var(--minimax-pet-height, 104px) + 8px);
/* Keep the 280px desk's two 8px gutters even if the native viewport becomes wider. */
max-width: 264px;
margin-inline: auto;
/* Use the space the expanded window provides, up to what the desk leaves above the pet. */
max-height: max(216px, calc(100% - var(--minimax-pet-height, 104px) - 24px));
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion sources/minimax-ai/minimax-pet/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "minimax-pet",
"displayName": "MiniMax Pet",
"version": "0.9.0",
"version": "0.9.2",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
3 changes: 3 additions & 0 deletions sources/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Version **0.9.0** adds two settings. **Task notifications** sets how many second

Version **0.9.0** also gives the desktop window one fixed size, tall enough for the open card. Earlier versions grew the window when a card opened, which moved it on screen and made the pet jump for a frame; now opening or closing a card only shows or hides it. The area above the pet is transparent and passes clicks through to whatever is behind it.

Version **0.9.2** keeps the desktop window at its intended size while dragging by sending the configured size with each move, rather than carrying forward unexpected native bounds. The desktop task card is centered and capped at 264 CSS pixels; it can still fit narrower windows with the existing 8-pixel side gutters. Permissions and dependencies are unchanged.

Version **0.8.1** fixes the desktop card: the title truncates to one line, only the reply scrolls, and the actions stay pinned, so a long title or reply no longer pushes 返回任务 / 打开对话 out of the card. Expanding the card also grows the window instead of squeezing the reply into one line.

Version **0.8.0** aligns the panel with the MiniMax Code design language: 24px page margins and section gaps, 14px/22px body copy with 12px/18px supporting text, 32px minimum control height, 12px cards and 8px controls, 0.5px borders on desktop overlays, and press/focus states. The desktop pet keeps its 280px layout with the same tokens.
Expand Down Expand Up @@ -47,6 +49,7 @@ Earlier local prototypes use a different plugin ID. The Host gives `minimax-pet`
- An earlier UI version was exercised on macOS in a MiniMax Code development build: three tabs, wide/narrow layouts, task reading, real session/ask activity, import/delete, and desktop round trips. Version 0.6.0 has Node/DOM tests (including the open and theme paths against a simulated Host), an isolated HTTP smoke test, and a browser check of the panel layout outside the Host.
- The default atlas is checked by actual PNG decoding, frame coverage and deterministic rebuild tests. The separate octopus icon is checked by PNG decoding and visual review. On 2026-10-26, the packaged Skill was exercised with a real Agent in the macOS development build to create, validate, preview and import a custom v2 pet; all nine animation previews and the four cardinal mouse-look directions were checked. This does not replace released-client acceptance.
- Version 0.9.0 has Node/DOM tests for the card timer, the preference round trip and the copy of both languages (every key the page uses must exist in both), plus a browser check of the panel and desktop window in both languages against a simulated Host. Not verified for 0.9.0: the language the real client reports on any given install, and both languages inside a real MiniMax Code window.
- Version 0.9.2 was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). With the task card open, four automated pointer drags moved the real window without cumulative width or height growth. A physical mouse and other display configurations were not tested for this fix.
- Not verified for 0.6.0: opening a conversation or following the theme inside a real MiniMax Code 3.1.11+ window (panel or desktop pet), any Windows GUI, and released-client installation or GUI acceptance on 3.1.6. Automated tests use synthetic data and do not prove those paths.

## Data & access
Expand Down
4 changes: 4 additions & 0 deletions sources/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

**0.9.0** 把桌面窗口固定成一个尺寸,本来就放得下展开的卡片。之前点开卡片会把窗口撑高,窗口在屏幕上跟着移动,桌宠会跳一下;现在开合卡片只显示或隐藏,不动窗口。桌宠上方是透明区域,点击会穿透到底下的窗口。

**0.9.2** 拖拽时同时发送坐标与当前缩放对应的窗口尺寸,不再沿用宿主异常放大的尺寸。桌面任务卡居中,宽度上限为 264 CSS 像素;窗口较窄时仍会缩小并保留两侧各 8 像素的留白。权限和依赖不变。

**0.8.1** 修复桌面卡片:标题单行截断,只有回复区滚动,底部操作固定在卡片内;长标题或长回复不再把「返回任务 / 打开对话」顶出卡片。展开卡片时窗口同步变高,回复不会被压成一行。

**0.8.0** 按 MiniMax Code 的设计语言对齐面板:24px 页边距与区块间距、14px/22px 正文与 12px/18px 辅助文字、控件最小高度 32px、卡片 12px 与控件 8px 圆角、桌面浮层 0.5px 描边,并补齐按下与焦点状态。桌面宠物保持 280px 布局,沿用同一套 token。
Expand All @@ -40,6 +42,8 @@

更早的 UI 版本已在 macOS 开发版验收三页签、窄宽布局、真实任务与 ask、导入删除和桌面切换;0.6.0 运行 Node/DOM 测试(含模拟 Host 下的打开对话与主题路径)、隔离 HTTP smoke,并在 Host 之外用浏览器检查了面板布局。默认图集通过 PNG 解码、动画帧覆盖与确定性重建检查;独立的章鱼图标通过 PNG 解码和视觉检查。2026-10-26,已用 macOS 开发版中的真实 Agent 调用随包 Skill,完成自定义 v2 宠物的生成、校验、预览和导入,并检查九种动作预览与鼠标上/右/下/左四向注视。0.6.0 尚未在真实的 MiniMax Code 3.1.11+ 窗口(面板或桌面宠物)中验收打开对话和主题跟随,也未验收 Windows GUI、正式客户端安装或 3.1.6 正式版 GUI;合成数据测试不能证明这些路径。

0.9.2 已在 Windows 11 x64(构建 26200,屏幕缩放 150%)的 MiniMax Code **3.1.19.232** 中测试。任务卡展开时通过自动化指针连续拖拽四次,真实窗口发生位移,宽高未逐次累加。此修复未测试物理鼠标及其他显示配置。

## 数据与能力边界

只申请 `session.read`,读取 Host 对本插件可见的用户会话状态和所选会话最新回复,不直接读取 Host 数据库、日志、配置或凭据。状态和提醒只在页面内存中,关闭或静音不修改 Host 的任务或未读事实。
Expand Down
26 changes: 26 additions & 0 deletions sources/minimax-ai/minimax-pet/dev/compact-pet-view.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
import { createRequire } from 'node:module';
import { createCompactPetView } from '../miniapp/client/compact-pet-view.mjs';
Expand Down Expand Up @@ -315,6 +316,31 @@ domTest('a markdown reply renders as structure in the detail, previews stay flat
assert.equal(node.querySelector('.md-heading').textContent, '结论');
});

domTest('the desktop task card caps its width and keeps its side gutters', async (t) => {
const [html, css] = await Promise.all([
readFile(new URL('../miniapp/client/index.html', import.meta.url), 'utf8'),
readFile(new URL('../miniapp/client/pet.css', import.meta.url), 'utf8'),
]);
const dom = new JSDOM(html);
t.after(() => dom.window.close());
const { document } = dom.window;
document.documentElement.classList.add('mode-window');
document.getElementById('desk').hidden = false;
const card = document.getElementById('workbench');
card.hidden = false;
const stylesheet = document.createElement('style');
stylesheet.textContent = css;
document.head.append(stylesheet);

// jsdom checks which declarations apply; it does not calculate layout dimensions.
const style = dom.window.getComputedStyle(card);
assert.equal(style.maxWidth, '264px');
assert.equal(style.marginInline, 'auto');
assert.equal(style.left, '8px');
assert.equal(style.right, '8px');
assert.equal(style.boxSizing, 'border-box');
});

domTest('a long title truncates on one line and a long reply cannot push the footer out', (t) => {
const h = harness(t);
const longTitle = '确认 mcode-data-analytics 数据获取状态并核对安全边界与聚合口径的最终结论';
Expand Down
41 changes: 41 additions & 0 deletions sources/minimax-ai/minimax-pet/dev/desk-interactivity.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,44 @@ test('the card never resizes the window, and the fixed height always fits it', a
assert.ok(deskHeight(scale) >= Math.ceil(208 * scale) + 216, `scale ${scale} leaves room for the card`);
}
});

function dragHarness(scale, overrides = {}) {
const updates = [];
const app = { mode: 'window', workbenchOpen: true, pet: {}, winPos: { x: -100, y: 160 }, oneShotToken: 0, ...overrides };
const context = vm.createContext({
app, prefs: { scale }, DRAG_THRESHOLD: 4,
els: { sprite: { setPointerCapture() {}, classList: { add() {} } } },
win: { update: async (patch) => updates.push({ ...patch }) },
callBridge: (run) => Promise.resolve(run()),
noteInteraction() {}, stopLook() {}, hideQuickbar() {}, refreshInteractivity() {}, updateDragDirection() {},
});
vm.runInContext(`${slice('const DESK_WIDTH', '// Saved positions')}\n${slice('function onSpritePointerDown(', 'function updateDragDirection(')}
globalThis.api = { onSpritePointerDown, onSpritePointerMove };`, context);
const pointer = { pointerId: 1, button: 0, screenX: 50, screenY: 70, preventDefault() {} };
context.api.onSpritePointerDown(pointer);
return { app, updates, move: (x, y) => context.api.onSpritePointerMove({ ...pointer, screenX: x, screenY: y }) };
}

test('desktop drag gives the Host absolute position and the same size on every move', () => {
// A position-only request was followed by growing native bounds on Windows. The page must
// keep requesting the designed size, not feed back whatever bounds the Host last reported.
for (const [scale, height] of [[0.5, 436], [0.75, 488], [1, 540]]) {
const h = dragHarness(scale);
h.move(51, 71); // Below the click/drag threshold.
h.move(85, 88);
h.app.winBounds = { width: 975, height: 1090 };
h.move(28, 60);
assert.deepEqual(h.updates, [
{ x: -65, y: 178, width: 280, height },
{ x: -122, y: 150, width: 280, height },
]);
assert.equal(h.app.workbenchOpen, true);
}
});

test('a drag cannot send its size while an intentional scale change owns the window', () => {
const h = dragHarness(0.5);
h.app.scaleChanging = true;
h.move(85, 88);
assert.deepEqual(h.updates, []);
});
Loading