Skip to content
Closed
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-bot/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "minimax-bot",
"displayName": "MiniMax Bot",
"version": "0.7.5",
"version": "0.7.6",
"description": "Turn MiniMax Code into an always-on team of Bots. A Chief Bot helps you build the team; in group chats the admin answers and @mentions hand work to other members. Every Bot has its own octopus avatar and memory, with scheduled tasks and usage stats.",
"author": "MiniMax Code",
"icon": "icon.png",
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Copy this directory, including the hidden `.minimax-plugin/` directory, into the
- **Language**: English and Chinese. By default it follows the operating system's preferred language (the first English or Chinese entry in `navigator.languages`; other languages fall back to English), or you can fix it under Settings → General → Language. The interface, errors, system notices, Chief's default setup, the context Bots receive and the MCP tool descriptions all switch; replies the Bots wrote and text you entered stay as they are.
- **Reactions**: react to finished Bot replies in private and group chats. The quick bar offers 👍 ❤️ 🙌 😂 😭 😮, and more emoji can be browsed by category or searched in English or Chinese. Each message holds one reaction: picking a new one replaces it, and picking the same one again removes it. Reactions are saved locally, survive refreshes and restarts, and sync to other open windows. They do not trigger a Bot reply and are not sent to the model.
- **Reply actions**: the reaction, copy, quote-reply and open-session buttons sit at the bottom-left of a reply, under its last line. A long reply therefore keeps its actions within reach at the end of the text instead of pushing them off the top of the message. The reaction indicator sits directly above that row and is painted with the app's own tag colours, so it follows the light and dark themes.
- **Folded working messages**: the Host records a text part for every turn a Bot takes between two tool calls, so a reply that worked for a while arrives with many parts. The newest three bubbles stay in the open, exactly where the flat layout put them, the answer among them. The earlier ones keep their own shape but move into a folded area above them: one line says how many of them there are, and opening it shows them in a fixed height area with its own scrollbar, so the conversation above stays in reach. Hovering a bubble of such a reply tells what that bubble said, the way the task rows and the attachments do.
- **Working messages of one reply**: the Host records a text part for every turn a Bot takes between two tool calls, so a reply that worked for a while arrives with many parts, and the page draws one bubble per part. The bubbles keep the official shape and order, and a small gap between them tells them apart instead of letting them read as one block of text.

## 0.7.0 Reliable delegation and result delivery

Expand Down
77 changes: 26 additions & 51 deletions plugins/minimax-ai/minimax-bot/miniapp/client/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -816,58 +816,12 @@ button {
display: flex;
flex-direction: column;
align-items: flex-start;
/* One reply can carry many bubbles, one per recorded part. Without a gap between them they
read as one block of text; a small one tells them apart, the way the task rows do. */
gap: 4px;
max-width: 100%;
}

/* The earlier bubbles of a long reply. The Host records a text part per assistant turn, so a
reply that ran a dozen tools arrives with dozens of bubbles; they live here instead, behind a
one line summary. The area that opens has a fixed height and its own scrollbar, so opening
it never makes the feed grow. */
.bubble-fold {
max-width: min(88%, 680px);
margin: 2px 0;
border: 1px solid var(--line);
border-radius: 14px;
background: var(--tag);
overflow: hidden;
}

.bubble-fold > summary {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
font-size: 12.5px;
color: var(--muted);
cursor: pointer;
list-style: none;
user-select: none;
}

.bubble-fold > summary::-webkit-details-marker { display: none; }
.bubble-fold > summary:hover { color: var(--ink); background: var(--hover); }
.bubble-fold > summary svg { flex: none; transition: transform 120ms ease; }
.bubble-fold[open] > summary svg { transform: rotate(180deg); }

.bubble-fold-closed { display: inline; }
.bubble-fold-open { display: none; }
.bubble-fold[open] > summary .bubble-fold-closed { display: none; }
.bubble-fold[open] > summary .bubble-fold-open { display: inline; }

/* The fixed height with a scrollbar is the point of the fold: the bubbles inside it scroll,
the feed around it does not. */
.bubble-fold-body {
max-height: min(320px, 40vh);
overflow-y: auto;
overscroll-behavior: contain;
padding: 2px 10px 10px;
display: flex;
flex-direction: column;
gap: 6px;
}

.bubble-fold-body .bubble { max-width: 100%; }

.msg.user .bubble-wrap {
align-items: flex-end;
/* The width bound belongs here, not on .bubble: this wrapper is shrink-to-fit, so a
Expand Down Expand Up @@ -2765,14 +2719,30 @@ fieldset.field {
display: flex;
flex-direction: column;
gap: 4px;
/* A few rows stay fully visible. More than the cap scrolls here instead of pushing the transcript off screen. */
flex: 0 1 auto;
min-height: 0;
max-height: min(280px, 40%);
}

/* The rows keep the scroll area the official strip had: a few of them stay fully visible, the
rest scroll here instead of pushing the transcript off screen. The cap is a viewport share
because the strip sits inside a box that has no height of its own. */
.helper-rows {
display: flex;
flex-direction: column;
gap: 4px;
flex: 0 1 auto;
min-height: 0;
max-height: min(280px, 40vh);
overflow-y: auto;
overscroll-behavior: contain;
}

/* The fold button sits below the scroll area and takes a row of its own, so the strip keeps
the height budget the official one had. */
.helpers.has-fold .helper-rows {
max-height: min(248px, calc(40vh - 32px));
}

.helpers:empty {
display: none;
}
Expand Down Expand Up @@ -2821,6 +2791,11 @@ fieldset.field {
flex: none;
}

/* The fold of a long queue: the same small button as the stop action, under the rows it folds. */
.helper-more {
align-self: flex-start;
}

/* attachments waiting to be sent, above the input */
.attach-btn {
width: 32px;
Expand Down
118 changes: 46 additions & 72 deletions plugins/minimax-ai/minimax-bot/miniapp/client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ async function mountChat(chatId) {
const revision = ++mountRevision;
closeReactionPicker();
mounted = chatId;
helpersExpanded = false;
const target = targetOf(chatId);
ui.pillBar = h('div', { class: 'pill-bar' });
ui.feedInner = h('div', { class: 'feed-inner' });
Expand Down Expand Up @@ -938,90 +939,21 @@ function legacyParts(m) {
return parts;
}

/**
* The Host opens a text part for every assistant turn between two tool calls, so a reply that
* worked for a while arrives with dozens of them, and one bubble per part filled the screen.
* The newest bubbles stay in the open, exactly where the flat layout put them; the earlier ones
* fold away behind a one line summary.
*/
const FOLD_AFTER_PARTS = 3;

/** The bubble's own text, short enough to be a hover hint. */
function hintOf(text) {
const flat = String(text ?? '').replace(/\s+/g, ' ').trim();
return flat.length > 160 ? `${flat.slice(0, 160)}…` : flat;
}

/**
* The earlier bubbles of a long reply: folded behind a one line summary, and the area that
* opens has a fixed height with its own scrollbar, so the feed keeps its length.
*/
function foldView(m, parts, presentation) {
const inner = () =>
parts.map((part, index) => ({
key: `text:${index}`,
signature: JSON.stringify([part.text, presentation]),
create: () => h('div', { class: 'bubble', title: hintOf(part.text) }, markdownNode(part.text, m.chatId)),
update: (bubble) => {
markdownNode(part.text, m.chatId, bubble.firstElementChild);
bubble.title = hintOf(part.text);
return bubble;
},
}));
const body = h('div', { class: 'bubble-fold-body' });
reconcileChildren(body, inner());
return {
key: 'fold',
signature: JSON.stringify([parts.map((part) => part.text), presentation, locale()]),
create: () =>
h(
'details',
{ class: 'bubble-fold' },
h(
'summary',
{ class: 'bubble-fold-summary', title: t('fold.hint', { n: parts.length }) },
icon('down', 12),
h('span', { class: 'bubble-fold-closed' }, t('fold.show', { n: parts.length })),
h('span', { class: 'bubble-fold-open' }, t('fold.hide')),
),
body,
),
update: (node) => {
reconcileChildren(node.querySelector('.bubble-fold-body'), inner());
const summary = node.querySelector('.bubble-fold-summary');
if (summary) summary.title = t('fold.hint', { n: parts.length });
const closed = node.querySelector('.bubble-fold-closed');
if (closed) closed.textContent = t('fold.show', { n: parts.length });
return node;
},
};
}

/** Keep part order exactly as recorded; matching prefixes are not evidence of duplication. */
function partViews(m, inGroup) {
const parts = m.key ? [{ type: 'text', text: displayText(m) }] : m.parts ?? legacyParts(m);
const lastText = parts.findLastIndex((part) => part.type === 'text' && part.text?.trim());
const views = [];
const presentation = presentationKey();
const textParts = [];
parts.forEach((part, index) => {
if (part.type === 'text' && part.text?.trim()) textParts.push(index);
});
// The newest bubbles stay in the open, where the flat layout had them; the earlier ones fold.
const folded = textParts.length > FOLD_AFTER_PARTS ? textParts.slice(0, -FOLD_AFTER_PARTS) : [];
const foldedSet = new Set(folded);
if (folded.length) views.push(foldView(m, folded.map((index) => parts[index]), presentation));
parts.forEach((part, index) => {
const key = `part:${index}`;
if (part.type === 'text' && part.text?.trim()) {
if (foldedSet.has(index)) return;
views.push({
key,
signature: JSON.stringify([part.text, presentation, index === lastText ? [m.status, m.userReactions, m.reactionsRevision, displayText(m), m.sessionId, botById(m.botId)?.name] : null]),
create: () => updateBubbleControls(h('div', { class: 'bubble', title: folded.length ? hintOf(part.text) : undefined }, markdownNode(part.text, m.chatId)), m, index === lastText),
create: () => updateBubbleControls(h('div', { class: 'bubble' }, markdownNode(part.text, m.chatId)), m, index === lastText),
update: (bubble) => {
markdownNode(part.text, m.chatId, bubble.firstElementChild);
if (folded.length) bubble.title = hintOf(part.text);
return updateBubbleControls(bubble, m, index === lastText);
},
});
Expand Down Expand Up @@ -1298,12 +1230,33 @@ function helperElapsed(helper) {
return minutes < 1 ? t('helper.justStarted') : t('helper.minutes', { n: minutes });
}

/** How many job rows stay in the open before the rest folds into one line. */
const HELPER_ROWS_PREVIEW = 3;
let helpersExpanded = false;

/** Background helpers working for this chat: one line each, with a stop button. */
function renderHelpers() {
if (!ui.helpers) return;
const items = [...state.helpers, ...state.tasks].filter((x) => [x.chatId, x.originChatId, x.resultChatId].includes(mounted) && ['queued', 'running', 'waiting_for_tasks'].includes(x.status));
ui.helpers.replaceChildren(
...items.map((helper) => {
if (!items.length) {
ui.helpers.replaceChildren();
ui.helpers.classList.remove('has-fold');
return;
}
// The rows are the ones the official build draws, in the order it draws them. A busy chat
// keeps the first few in the open and folds the rest into one line, so the strip never
// grows into a wall of rows.
const preview = helpersExpanded ? items : items.slice(0, HELPER_ROWS_PREVIEW);
const hidden = items.length - preview.length;
// The rows keep the scroll area they had, and the fold button sits below it, so the button
// stays reachable however long the queue is.
let rows = ui.helpers.querySelector('.helper-rows');
if (!rows) {
rows = h('div', { class: 'helper-rows' });
ui.helpers.replaceChildren(rows);
}
rows.replaceChildren(
...preview.map((helper) => {
const bot = botById(helper.botId);
return h(
'div',
Expand All @@ -1329,6 +1282,27 @@ function renderHelpers() {
);
}),
);
ui.helpers.classList.toggle('has-fold', hidden > 0 || (helpersExpanded && items.length > HELPER_ROWS_PREVIEW));
// `replaceChildren` renders a null argument as the text "null", so the fold button is appended
// on its own, and only when there is something to fold.
ui.helpers.querySelector('.helper-more')?.remove();
if (hidden > 0 || (helpersExpanded && items.length > HELPER_ROWS_PREVIEW)) {
ui.helpers.append(
h(
'button',
{
type: 'button',
class: 'btn sm helper-more',
'aria-expanded': String(helpersExpanded),
onclick: () => {
helpersExpanded = !helpersExpanded;
renderHelpers();
},
},
hidden > 0 ? t('helper.more', { n: hidden }) : t('helper.collapse'),
),
);
}
}
setInterval(() => {
if (mounted && state.helpers.some((x) => x.chatId === mounted && x.status === 'running')) renderHelpers();
Expand Down
10 changes: 4 additions & 6 deletions plugins/minimax-ai/minimax-bot/miniapp/client/strings-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ export default {
'helper.justStarted': '刚开始',
'helper.minutes': '{n} 分钟',
'helper.stop': '停止',
'fold.show': '展开 {n} 条过程消息',
'fold.hide': '收起过程消息',
'fold.hint': '共 {n} 条过程消息,展开后在固定高度内滚动查看',
'helper.more': '还有 {n} 个任务',
'helper.collapse': '收起队列',
'event.helperStarted': '开始了:{title}',
'event.helper.done': '做完了:{title}',
'event.helper.blocked': '卡住了,需要你定一下:{title}',
Expand Down Expand Up @@ -470,9 +469,8 @@ export default {
'helper.justStarted': 'just started',
'helper.minutes': '{n} min',
'helper.stop': 'Stop',
'fold.show': 'Show {n} earlier messages',
'fold.hide': 'Hide earlier messages',
'fold.hint': '{n} earlier messages, they scroll inside the opened area',
'helper.more': '{n} more tasks',
'helper.collapse': 'Collapse queue',
'event.helperStarted': 'Started: {title}',
'event.helper.done': 'Finished: {title}',
'event.helper.blocked': 'Stuck and needs your decision: {title}',
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export function createMcpHandler({ team, engine }) {
result = {
protocolVersion: PROTOCOL_VERSIONS.includes(requested) ? requested : PROTOCOL_VERSIONS[0],
capabilities: { tools: { listChanged: false } },
serverInfo: { name: 'minimax-bot', version: '0.7.5' },
serverInfo: { name: 'minimax-bot', version: '0.7.6' },
instructions: t('mcp.instructions'),
};
break;
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minimax-bot",
"version": "0.7.5",
"version": "0.7.6",
"private": true,
"type": "module",
"mcode": {
Expand Down
Loading
Loading