Skip to content

Commit 2c78f99

Browse files
authored
fix(mmx-octopus): v1.9.0 - keep every write inside the plugin dataDir, let the user create their own mmx agent (#119)
* fix(mmx-octopus): keep every write inside the plugin's own dataDir (v1.9.0) The official plugin marketplace rejected 1.8.0 because the plugin wrote into the Host's agent directory (a new agent.md) - outside its own dataDir, without the user asking for it, and never cleaned up on uninstall. This version applies the official fix A: the capability is removed outright. - Delete miniapp/node/agentprov.mjs (writes into the Host agent directory) and miniapp/scripts/agentprov-cli.mjs (the manual CLI). - Drop the "dedicated agent" tier: DEFAULT_AGENT_MODE / normalizeAgentMode / SELF_AGENT_NAME, the Host agent-root probing, and the temporary probe session. - Drop the POST /api/agent-mode route, the agentMode / agentStatus state fields and the "which agent she uses" choice in the panel (settings and first-run card). - Identity travels with every message again (withIdentity / assembleChatInput). - Writes are limited to four JSON files under context.dataDir, atomically. Reads are limited to package files, dataDir data and the Host agent list. The plugin adds, changes and deletes no agent. - Version 1.8.0 -> 1.9.0 (plugin.json / package.json / both READMEs). Self-test: 857 checks, 0 failures (new group "round 48", 16 checks). * feat(mmx-octopus): let the user create their own mmx agent (v1.9.0) The marketplace offered two acceptable fixes for 1.8.0. The previous commit applies fix A and removes the capability outright. This commit applies fix B: guide the user to create the agent, and let the plugin only recognise it. - Add miniapp/node/agentcard.mjs: a pure function that renders her character sheet (reads the package's own identity/AGENTS.md and identity/PERSONA.md) into an agent file the Host understands. It writes nothing at all. - Add the read-only route POST /api/agent-card: returns that text plus "found", a read-only probe of the Host agent list for an agent named mmx. - Add a "复制她的设定" button and a short how-to in the panel settings: copy the sheet, create an agent named mmx in the Host's Agent settings, paste it, save. Creating it is optional. - The agent name still has exactly one source: PET_AGENT_NAME in agentpick.mjs. agentcard.mjs only imports it. The plugin still writes no Host file: the user creates and deletes the agent, the plugin only finds it and falls back to "carried with every message". Docs: both market READMEs (What it does, Usage, Data & access, Known limits, Upgrading from 1.8.0) describe the new flow. Self-test: 871 checks, 0 failures (new group "round 49", 14 checks). * fix(mmx-octopus): restore the agent default and drop the 1.8.0 agent name (v1.9.0) Two fixes the marketplace reviewer asked for on PR #119. - state.mjs: restore "this.petAgent = null" in the constructor. Removing the "create a dedicated agent" mode took the initial value with it, so a fresh install had undefined and the snapshot was missing a field the contract declares as string or null. - state.mjs: drop the agent name 1.8.0 left behind. agentpick.mjs now exports LEGACY_SELF_AGENT_NAME ('mmx-octopus-agent'); when the state is loaded, a stored value equal to it is discarded, so an upgraded user no longer gets a session on that agent any more. Any other explicitly stored name is kept. - Also removed a stale comment about the old default and fixed one badly indented comment block. The legacy name now appears exactly once in the package, and only as the value to discard - never as something to create or to select. Docs: both market READMEs note that a saved state still pointing at the old agent is ignored by 1.9.0. Self-test: 880 checks, 0 failures (new group "round 50", 9 checks).
1 parent 93f09b9 commit 2c78f99

12 files changed

Lines changed: 384 additions & 969 deletions

File tree

‎plugins/antianqi/mmx-octopus/.minimax-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schemaVersion": 1,
33
"name": "mmx-octopus",
44
"displayName": "MMX 章鱼娘",
5-
"version": "1.8.0",
5+
"version": "1.9.0",
66
"description": "桌面上的 MMX 章鱼娘 —— MMX Agent 的可视化身体,也是你自己的专属聊天对象。她会反映 Agent 正在思考还是正在干活,还能被 Agent 和技能通过托管 MCP 直接指挥说话、换表情、挪位置。权限说明:本插件会读取你每个对话每轮的最终回复、标题与运行状态,用来判断 Agent 正在思考还是已经完成,并在你主动问她时用她自己的固定会话跑一轮 Agent,把回答直接说出来;她的对话历史只存在本机。",
77
"author": "antianqi",
88
"icon": "icon.png",

‎plugins/antianqi/mmx-octopus/README.md‎

Lines changed: 77 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ doing, and the Agent can tell her what to say.*
55

66
English | [简体中文](README.zh-CN.md)
77

8-
Author: [antianqi](https://github.com/antianqi) · Version: `1.8.0` ·
8+
Author: [antianqi](https://github.com/antianqi) · Version: `1.9.0` ·
99
Plugin ID: `mmx-octopus` · Category: `Productivity`
1010

1111
*The app interface is in Chinese.*
@@ -27,6 +27,14 @@ Plugin ID: `mmx-octopus` · Category: `Productivity`
2727
- **The Agent can drive her.** This package hosts an MCP server with four
2828
tools (below), so the Agent can make her speak, change her expression, move
2929
her, or read her state.
30+
- **She can answer with an agent of her own — if you make one.** The plugin
31+
never creates an agent for you and never writes one. If you want her to have
32+
her own, open the panel (Settings → 「想要更鲜明的性格?」) and press
33+
**「复制她的设定」** ("copy her settings"): it puts her character sheet on
34+
your clipboard. Paste it into a new agent named `mmx` in the Host's Agent
35+
settings, and the plugin finds that agent on its own (read-only) and answers
36+
with it. Skip the step and she answers with the default agent, her character
37+
sheet travelling with every message.
3038
- **She stays out of the way.** The floating window is frameless, transparent,
3139
always on top and click-through, so it never blocks the desktop. It is
3240
220 × 460 and can be dragged anywhere on the screen; the Agent can park it in
@@ -65,6 +73,8 @@ Nothing else is needed: no API key, no account, no dependency to install.
6573
2. Drag it to a corner, or let the Agent move it with `mmx_move`.
6674
3. Talk to the Agent as usual and watch her expression follow along.
6775
4. Open the panel and write to her — she answers in her own session.
76+
5. Optional: give her an agent of her own — copy her settings from the panel
77+
and paste them into a new agent named `mmx` (see "What it does").
6878

6979
### The Agent's four tools
7080

@@ -109,95 +119,66 @@ it like the rest of the port.
109119
- **What it reads** — this package's own files, read from
110120
`context.pluginRoot`: `miniapp/node/identity/AGENTS.md` and
111121
`miniapp/node/identity/STORY.md` (who she is), plus the page assets under
112-
`miniapp/client/`.
122+
`miniapp/client/`; and the list of agents the Host exposes, which it only
123+
reads to decide which agent answers for her.
113124
- **What it writes** — four JSON files under `context.dataDir`, the private
114-
directory the Host creates for this plugin:
125+
directory the Host creates for this plugin, and **nothing outside it**:
115126
`context.dataDir/state.json` (her expression, position, bubble and the Agent's
116127
busy state), `context.dataDir/chat.json` (your chat with her),
117128
`context.dataDir/diary.json` (her diary) and `context.dataDir/style.json`
118129
(how she has learned to write). Every write is atomic — a temporary file in
119130
the same directory, then a rename — so a crash cannot leave a half-written
120131
file behind.
121-
- **At most one new agent file outside `context.dataDir`** — since 1.8.0 the
122-
runtime **can add one agent of its own** to the Host's agent directory, so
123-
that her character sheet can live in that agent's system prompt instead of
124-
only in the message. **By default it adds one**: the panel has a
125-
two-way choice ("Which agent should she use"), and the default is "create a
126-
dedicated agent" — that tier adds the agent, so her character stays in that
127-
agent's system prompt (crisper personality, more lifelike replies).
128-
**You can switch back to "use an existing agent" at any time** — in that tier
129-
the plugin writes **not a single byte** outside its own data directory and
130-
her character sheet travels with the message only. The choice is asked
131-
**on first run**: the opening card asks for the tier first, then for her name and how she addresses you; you can
132-
change it in the panel at any time. Full disclosure:
133-
- **Which file** — exactly one: `<Host agent directory>/mmx-octopus-agent/agent.md`.
134-
The directory and the file are **new**; the Host picks it up without a
135-
restart.
136-
- **What is in it** — the same character sheet the plugin would otherwise
137-
send with every message (who she is, what she looks like, her rules), plus
138-
the frontmatter the Host expects (`name`, `description`, `displayName`).
139-
- **What is never touched** — **no existing agent is modified and no other
140-
file is written**: not your agents' `agent.md`, not the `AGENTS.md` of an
141-
agent workspace, not your project files. If the name `mmx-octopus-agent` is
142-
already taken by an agent that is not ours, the plugin **writes nothing and
143-
does not use it** — she keeps working on an existing agent (that other
144-
agent's file is never treated as ours).
145-
- **How it is written** — atomically (temporary file, then a rename), one
146-
write at a time, and only when the file does not exist yet: an existing
147-
file is never overwritten, so there is nothing to back up.
148-
- **How to remove it, or how to pick up a new version** — the file is
149-
**never rewritten in place**, so after you upgrade the package the old
150-
character sheet stays in it. Delete
151-
`<Host agent directory>/mmx-octopus-agent/` and the runtime adds it again on
152-
the next start, this time with the current version's sheet. If you would
153-
rather not have this agent at all, pick "use an existing agent" in the
154-
panel — the plugin then leaves it alone, and as long as you do not switch back to "create a dedicated agent" it will not be recreated.
155-
Nothing else on your machine is affected.
156-
- **How the directory is found — it is never guessed** — only from the
157-
workspace of a session the plugin itself created: the Host sets that
158-
workspace to the Mini App's own agent directory
159-
(`<Host agent directory>/<agent>/miniapps/<plugin-id>`), and the plugin
160-
takes its parent. It does **not** walk up the filesystem looking for a
161-
folder called `agents` (a project of yours could contain one, and the
162-
file would land in your project), and it does **not** derive the
163-
directory from `context.dataDir`. If that one path does not identify the
164-
directory, the plugin writes **nothing** and falls back to sending her
165-
character sheet with every message, exactly as before.
166-
- **One session of its own** — to learn that path the plugin may create one
167-
session through the Host's Agent API. Such sessions belong to the plugin
168-
and do **not** show up in your chat list; the plugin reuses that session
169-
as hers instead of creating another one.
132+
- **No file outside `context.dataDir`** — since 1.9.0 the runtime writes
133+
**nothing else at all**: no agent file, nothing under the Host's agent
134+
directory, nothing in your project. The only files it touches are the four
135+
JSON files listed above.
136+
- **No choice in the panel any more.** The 1.8.0 panel's two-way choice
137+
("Which agent should she use" — "create a dedicated agent" vs "use an
138+
existing agent") is gone, and so is the manual `agentprov-cli.mjs` command
139+
that came with it. There is nothing left to switch.
140+
- **Your own `mmx` agent, if you make one.** The panel's **「复制她的设定」**
141+
button only hands you her character sheet as text — it writes nothing. You
142+
paste it into a new agent named `mmx` in the Host's Agent settings; the
143+
plugin then finds that agent through the Host's agent list and answers
144+
with it, reading it only. Creating, editing and deleting that agent stay
145+
yours; the plugin only ever reads the agent list.
146+
- **It still reads the Host's agent list — read-only.** The plugin reads the
147+
agents the Host exposes and, if you have an agent named `mmx`, that is the
148+
one she answers with. Your agent is never modified and never written to.
149+
With no `mmx` agent she falls back to the default agent.
150+
- **Her character sheet travels with the message.** With no dedicated agent
151+
to hold it, her identity (who she is, what she looks like, her rules) is
152+
carried in the prompt of every turn — see "How her identity reaches her"
153+
below.
170154
- **Leftovers from earlier versions** — versions before 1.7.0 wrote an `AGENTS.md`
171155
into the workspace of the agent that has this Mini App installed, to carry her
172156
identity there. That is no longer written and no longer needed. If you are
173157
upgrading from an earlier version the old file may still be there
174158
(`agents/<agent>/miniapps/<plugin-id>/AGENTS.md`) and you can delete it — the
175159
runtime never touches it, because a plugin must not write outside its own
176-
data directory.
177-
- **How her identity reaches her** — **twice, on purpose**. Her character
178-
sheet (who she is, what she looks like, her rules) is read from this
179-
package's own `miniapp/node/identity/AGENTS.md` and passed inside each
160+
data directory. What 1.8.0 may have left behind is covered under
161+
"Upgrading from 1.8.0" below.
162+
- **How her identity reaches her** — **on every turn, in the message**. Her
163+
character sheet (who she is, what she looks like, her rules) is read from
164+
this package's own `miniapp/node/identity/AGENTS.md` and passed inside each
180165
prompt, so it is never missing from a turn. Because that travels in the
181166
conversation, the Host's context compaction may drop it — that is why it is
182-
sent again every turn. Since 1.8.0 — and only once you pick "create a
183-
dedicated agent" in the panel — the same sheet is also written into the
184-
system prompt of the agent added above (the file disclosed above), which
185-
survives compaction; if that file cannot be written, the per-turn copy
186-
remains and nothing changes for you.
167+
sent again every turn. Since 1.9.0 this is the only channel: the sheet is
168+
no longer written into any agent file, so the per-turn copy is the one and
169+
only copy.
187170
- **Sessions read** — the package declares `session.read`. It reads the title,
188171
the running state and the final reply of a turn, to tell whether the Agent is
189172
thinking or has finished, and to summarise the turn. The board in the panel
190173
lists the running sessions and refreshes every 30 seconds.
191174
- **Agent turns it runs** — it declares `session.run`, and it runs **one Agent
192175
turn per message you send her in the chat area**, in her own session. The
193176
turn runs through the Host Agent, so it carries the capabilities the Host
194-
grants that agent; it reads the Host's agent list to look for an agent
195-
dedicated to the Mini App — in the default mode ("create a dedicated
196-
agent") the one it adds itself comes first (see
197-
above) and yours is only used when that one is not there; with neither, it
198-
falls back to the default agent. If you pick "use an
199-
existing agent" in the panel, only your own `mmx` is used (or the default agent when there is none),
200-
and the one it could add is never touched. It never runs turns on your own sessions.- **Agent turns it starts on its own** — besides your messages, the runtime starts
177+
grants that agent; it reads the Host's agent list and, if you have an agent
178+
named `mmx`, that is the one it answers with (your agent is only read,
179+
never modified); with no `mmx` agent it falls back to the default agent.
180+
It never runs turns on your own sessions.
181+
- **Agent turns it starts on its own** — besides your messages, the runtime starts
201182
a few turns by itself, and **each of them uses your model quota**:
202183
- **Idle talk** — **off by default**; turn it on in the panel: Settings →
203184
「她没人的时候自己说话」 ("She talks when you are away"). Once on, after 20
@@ -229,13 +210,41 @@ it like the rest of the port.
229210
- **State location** — `context.dataDir`. Treat it as opaque: it may move
230211
between versions, so do not hard-code it.
231212

213+
### Upgrading from 1.8.0
214+
215+
1.9.0 changes what the plugin does with the Host's agents, not just the
216+
version number. **It no longer creates an agent file anywhere**, and with it
217+
the panel's "create a dedicated agent / use an existing agent" choice and the
218+
manual `agentprov-cli.mjs` command are gone as well.
219+
220+
- **If you used 1.8.0** and let it create its own dedicated agent, the Host
221+
may still have the leftover directory
222+
`<Host data dir>/agents/mmx-octopus-agent/`. You can **delete it by hand** —
223+
nothing in it is needed any more.
224+
- **1.9.0 never creates that directory and never touches it.** The only files
225+
it writes are the four JSON files under `context.dataDir`.
226+
- **Your own `mmx` agent still wins.** If you have an agent named `mmx`, she
227+
answers with it — read-only; the plugin never modifies it.
228+
- **1.9.0 also hands you her settings.** The panel's **「复制她的设定」** button
229+
gives you her character sheet as text, so you can put it into an agent named
230+
`mmx` that you create yourself. The plugin no longer creates that agent for
231+
you — it only recognises it.
232+
233+
- **If your saved state still points at the old agent, 1.9.0 ignores it.**
234+
1.8.0 could have stored `mmx-octopus-agent` in the plugin's state file. 1.9.0
235+
drops that name when it loads the state, so she answers with your own `mmx`
236+
agent if you have one, and with the Host's default agent otherwise.
237+
232238
## Known limits
233239

234240
- The interface is Chinese only.
235241
- There is no voice: a bubble is text.
236242
- Her body animation only covers the moments the clips cover; between clips the
237243
`pose` fallback runs.
238244
- She answers in whatever agent the Host resolves for her.
245+
- Without an agent named `mmx` of your own, her character sheet travels in the
246+
message instead, and the Host's context compaction may drop it — which is
247+
why it is sent again every turn.
239248

240249
## License
241250

0 commit comments

Comments
 (0)