Skip to content
Open
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/antianqi/mmx-octopus/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "mmx-octopus",
"displayName": "MMX 章鱼娘",
"version": "1.7.0",
"version": "1.8.0",
"description": "桌面上的 MMX 章鱼娘 —— MMX Agent 的可视化身体,也是你自己的专属聊天对象。她会反映 Agent 正在思考还是正在干活,还能被 Agent 和技能通过托管 MCP 直接指挥说话、换表情、挪位置。权限说明:本插件会读取你每个对话每轮的最终回复、标题与运行状态,用来判断 Agent 正在思考还是已经完成,并在你主动问她时用她自己的固定会话跑一轮 Agent,把回答直接说出来;她的对话历史只存在本机。",
"author": "antianqi",
"icon": "icon.png",
Expand Down
85 changes: 70 additions & 15 deletions plugins/antianqi/mmx-octopus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ doing, and the Agent can tell her what to say.*

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

Author: [antianqi](https://github.com/antianqi) · Version: `1.7.0` ·
Author: [antianqi](https://github.com/antianqi) · Version: `1.8.0` ·
Plugin ID: `mmx-octopus` · Category: `Productivity`

*The app interface is in Chinese.*
Expand Down Expand Up @@ -110,39 +110,94 @@ it like the rest of the port.
`context.pluginRoot`: `miniapp/node/identity/AGENTS.md` and
`miniapp/node/identity/STORY.md` (who she is), plus the page assets under
`miniapp/client/`.
- **What it writes** — and **nothing else**. Four JSON files under
`context.dataDir`, the private directory the Host creates for this plugin:
- **What it writes** — four JSON files under `context.dataDir`, the private
directory the Host creates for this plugin:
`context.dataDir/state.json` (her expression, position, bubble and the Agent's
busy state), `context.dataDir/chat.json` (your chat with her),
`context.dataDir/diary.json` (her diary) and `context.dataDir/style.json`
(how she has learned to write). Every write is atomic — a temporary file in
the same directory, then a rename — so a crash cannot leave a half-written
file behind. **No file outside `context.dataDir` is ever written**: not the
Host's `agent.md`, not the `AGENTS.md` of the agent's workspace, nothing else.
file behind.
- **At most one new agent file outside `context.dataDir`** — since 1.8.0 the
runtime **can add one agent of its own** to the Host's agent directory, so
that her character sheet can live in that agent's system prompt instead of
only in the message. **By default it adds one**: the panel has a
two-way choice ("Which agent should she use"), and the default is "create a
dedicated agent" — that tier adds the agent, so her character stays in that
agent's system prompt (crisper personality, more lifelike replies).
**You can switch back to "use an existing agent" at any time** — in that tier
the plugin writes **not a single byte** outside its own data directory and
her character sheet travels with the message only. The choice is asked
**on first run**: the opening card asks for the tier first, then for her name and how she addresses you; you can
change it in the panel at any time. Full disclosure:
- **Which file** — exactly one: `<Host agent directory>/mmx-octopus-agent/agent.md`.
The directory and the file are **new**; the Host picks it up without a
restart.
- **What is in it** — the same character sheet the plugin would otherwise
send with every message (who she is, what she looks like, her rules), plus
the frontmatter the Host expects (`name`, `description`, `displayName`).
- **What is never touched** — **no existing agent is modified and no other
file is written**: not your agents' `agent.md`, not the `AGENTS.md` of an
agent workspace, not your project files. If the name `mmx-octopus-agent` is
already taken by an agent that is not ours, the plugin **writes nothing and
does not use it** — she keeps working on an existing agent (that other
agent's file is never treated as ours).
- **How it is written** — atomically (temporary file, then a rename), one
write at a time, and only when the file does not exist yet: an existing
file is never overwritten, so there is nothing to back up.
- **How to remove it, or how to pick up a new version** — the file is
**never rewritten in place**, so after you upgrade the package the old
character sheet stays in it. Delete
`<Host agent directory>/mmx-octopus-agent/` and the runtime adds it again on
the next start, this time with the current version's sheet. If you would
rather not have this agent at all, pick "use an existing agent" in the
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.
Nothing else on your machine is affected.
- **How the directory is found — it is never guessed** — only from the
workspace of a session the plugin itself created: the Host sets that
workspace to the Mini App's own agent directory
(`<Host agent directory>/<agent>/miniapps/<plugin-id>`), and the plugin
takes its parent. It does **not** walk up the filesystem looking for a
folder called `agents` (a project of yours could contain one, and the
file would land in your project), and it does **not** derive the
directory from `context.dataDir`. If that one path does not identify the
directory, the plugin writes **nothing** and falls back to sending her
character sheet with every message, exactly as before.
- **One session of its own** — to learn that path the plugin may create one
session through the Host's Agent API. Such sessions belong to the plugin
and do **not** show up in your chat list; the plugin reuses that session
as hers instead of creating another one.
- **Leftovers from earlier versions** — versions before 1.7.0 wrote an `AGENTS.md`
into the workspace of the agent that has this Mini App installed, to carry her
identity there. That is no longer written and no longer needed. If you are
upgrading from an earlier version the old file may still be there
(`agents/<agent>/miniapps/<plugin-id>/AGENTS.md`) and you can delete it — the
runtime never touches it, because a plugin must not write outside its own
data directory.
- **How her identity reaches her** — in the message, every turn. Her character
sheet (who she is, what she looks like, her rules) is read from this package's
own `miniapp/node/identity/AGENTS.md` and passed inside each prompt, so no
file has to be written for it. Because it travels in the conversation, the
Host's context compaction may drop it — that is why it is sent again every
turn.
- **How her identity reaches her** — **twice, on purpose**. Her character
sheet (who she is, what she looks like, her rules) is read from this
package's own `miniapp/node/identity/AGENTS.md` and passed inside each
prompt, so it is never missing from a turn. Because that travels in the
conversation, the Host's context compaction may drop it — that is why it is
sent again every turn. Since 1.8.0 — and only once you pick "create a
dedicated agent" in the panel — the same sheet is also written into the
system prompt of the agent added above (the file disclosed above), which
survives compaction; if that file cannot be written, the per-turn copy
remains and nothing changes for you.
- **Sessions read** — the package declares `session.read`. It reads the title,
the running state and the final reply of a turn, to tell whether the Agent is
thinking or has finished, and to summarise the turn. The board in the panel
lists the running sessions and refreshes every 30 seconds.
- **Agent turns it runs** — it declares `session.run`, and it runs **one Agent
turn per message you send her in the chat area**, in her own session. The
turn runs through the Host Agent, so it carries the capabilities the Host
grants that agent; it reads the Host's agent list once to look for an agent
dedicated to the Mini App, and falls back to the default agent when there is
none. It never runs turns on your own sessions.
- **Agent turns it starts on its own** — besides your messages, the runtime starts
grants that agent; it reads the Host's agent list to look for an agent
dedicated to the Mini App — in the default mode ("create a dedicated
agent") the one it adds itself comes first (see
above) and yours is only used when that one is not there; with neither, it
falls back to the default agent. If you pick "use an
existing agent" in the panel, only your own `mmx` is used (or the default agent when there is none),
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
a few turns by itself, and **each of them uses your model quota**:
- **Idle talk** — **off by default**; turn it on in the panel: Settings →
「她没人的时候自己说话」 ("She talks when you are away"). Once on, after 20
Expand Down
51 changes: 41 additions & 10 deletions plugins/antianqi/mmx-octopus/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

作者:[antianqi](https://github.com/antianqi) · 版本:`1.7.0` ·
作者:[antianqi](https://github.com/antianqi) · 版本:`1.8.0` ·
插件 ID:`mmx-octopus` · 分类:`Productivity`

## 它做什么
Expand Down Expand Up @@ -87,28 +87,59 @@ English | [简体中文](README.zh-CN.md)
- **读什么** —— 读这个包自己的文件,从 `context.pluginRoot` 读:
`miniapp/node/identity/AGENTS.md` 和 `miniapp/node/identity/STORY.md`(她是谁),
以及 `miniapp/client/` 下的页面素材。
- **写什么** —— 而且**只写这些**。`context.dataDir` 下四个 JSON 文件,也就是宿主给这个包建的私有目录:
- **写什么** —— `context.dataDir` 下四个 JSON 文件,也就是宿主给这个包建的私有目录:
`context.dataDir/state.json`(她的表情、位置、气泡,以及 Agent 忙不忙),
`context.dataDir/chat.json`(你和她的聊天),
`context.dataDir/diary.json`(她的日记)、`context.dataDir/style.json`(她学到的语气)。
每次落盘都是原子的 —— 先写同目录临时文件,再改名 —— 所以崩了也不会留下半个文件。
⚠️ **`context.dataDir` 之外一个文件都不写**:不改宿主的 `agent.md`,不写 agent 工作区里的
`AGENTS.md`,别的更不写。
- **`context.dataDir` 之外最多新增一个 agent 文件(1.8.0 起)** —— **默认新增**:面板上有一组
二选一(「她用哪个 agent」),**默认是「建专属 agent」** ⇒ 运行时会在**宿主的 agent 目录里新增一个
属于自己的 agent**,好让她的设定能待在那个 agent 的 system prompt 里,不只活在消息里
(这样她的性格更鲜明、回复更拟人)。
**你随时能切回「用现有 agent」** ⇒ 那一档插件**一个字节都不往宿主目录写**,她的设定只随消息带。
这一档**在第一次运行时就问**:首启那张卡片里先选「建专属 agent」还是「用现有 agent」,
再选她叫什么、她怎么称呼你;之后随时能在设置里改。 完整披露:
- **写哪个文件** —— 只有一个:`<宿主的 agent 目录>/mmx-octopus-agent/agent.md`。
目录和文件都是**新建的**,宿主**不用重启**就能认到它。
- **里面写什么** —— 就是插件本来每轮随消息送的那份设定(她是谁 / 她长什么样 / 她的规矩),
外加宿主要的 frontmatter(`name` / `description` / `displayName`)。
- **哪些绝不碰** —— **不改任何已有的 agent,也不写别的文件**:不改你的 agent 的 `agent.md`,
不写 agent 工作区里的 `AGENTS.md`,不碰你的项目文件。要是 `mmx-octopus-agent` 这个名字
已经被别的 agent 占了,插件就**什么都不写、也不用它** —— 她照样用现有 agent 说话
(那个别人的 agent 不会被当成我们自己的用)。
- **怎么写** —— 原子写(先写临时文件再改名),一次只写一个,而且**只在文件不存在时**写:
已存在的文件绝不覆盖 ⇒ 没有需要备份的旧文件。
- **怎么移除它 / 怎么拿到新版本** —— 这个文件**永远不会被就地改写**,所以升级插件之后,
里面还是旧的那份设定。删掉 `<宿主的 agent 目录>/mmx-octopus-agent/` 整个目录,
下次启动它会按当前版本的设定重新加上。想彻底不要这个 agent:面板上选「用现有 agent」,
插件就不碰它了 —— 只要不切回「建专属 agent」,删掉的目录不会被重建。
别的什么都不受影响。
- **这个目录怎么找 —— 绝不靠猜** —— **只从插件自己建的那个会话的工作目录**认:宿主把那个会话的
工作目录设成「Mini App 自己的 Agent 目录」(`<宿主的 agent 目录>/<agent>/miniapps/<plugin-id>`),
插件取它的上一层。**不会**在文件系统里上溯找名为 `agents` 的目录(你的项目里正好有一层
叫 `agents` 的话,文件就会落进你的项目),**也不会**从 `context.dataDir` 反推。认不出来就
**一个字节都不写**,退回「每轮随消息带设定」的老路,一切照旧。
- **它自己那个会话** —— 为了问出这个路径,插件可能会通过宿主的 Agent API 建一个会话。
这种会话归插件自己,**不会出现在你的聊天列表里**;而且插件会把它**复用成她的会话**,
不再另建一个。
- **老版本留下的东西** —— 1.7.0 之前的版本会把一份 `AGENTS.md` 写进「装了本插件的那个 agent」
的工作区,用来把她的身份放在那儿。**现在不再写了,也不再需要它**。从老版本升级的话,
那份文件可能还在(`agents/<agent>/miniapps/<plugin-id>/AGENTS.md`),可以直接删 ——
运行时不会去动它:**插件不许写自己 dataDir 之外的文件**。
- **她的身份怎么送到她那儿** —— **随消息带,每一轮都带**。她的底稿、样子和规矩从本包自己的
`miniapp/node/identity/AGENTS.md` 读出来,拼进每次的提示词里,所以**不需要为此写任何文件**。
⚠️ 代价:身份层走的是会话历史 ⇒ 宿主做上下文压缩时可能把它压掉(所以每轮都重发一份)。
- **她的身份怎么送到她那儿** —— **两条腿走**。她的底稿、样子和规矩从本包自己的
`miniapp/node/identity/AGENTS.md` 读出来,拼进每次的提示词里,所以每一轮都带着它。
⚠️ 代价:这一份走的是会话历史 ⇒ 宿主做上下文压缩时可能把它压掉(所以每轮都重发一份)。
1.8.0 起,**你在面板上选了「建专属 agent」之后**,同样一份设定也写进了上面那个新增 agent
的 system prompt(压缩压不掉);万一那个文件写不成,每轮随消息带的那份照样在,你什么都不用管。
- **读哪些会话** —— 这个包声明了 `session.read`。它读一轮对话的标题、运行状态和最终回复,
用来分辨 Agent 是在想还是做完了,也用来给这一轮做摘要。面板里的看板列出正在跑的会话,
每 30 秒刷新一次。
- **会跑哪些 Agent 轮次** —— 它声明了 `session.run`,并且**你在聊天区给她发的每一句话,
都在她自己的会话里跑一轮 Agent**。这一轮走宿主的 Agent,因此带着宿主给那个 agent 的权限;
它会读一次宿主的 agent 列表,找有没有专属于这个 Mini App 的 agent,没有就退回默认 agent。
它不会去跑你自己的会话。
- **它自己会起的那些轮次** —— 除了你发的消息,运行时还会自己起几轮,**每一轮都花你的模型额度**:
它会读宿主的 agent 列表,找有没有专属于这个 Mini App 的 agent ——
**默认档(「建专属 agent」)优先用插件自己新增的那个**(见上面),它没有才用你的 `mmx`;
都没有就退回默认 agent。你在面板上选了「用现有 agent」的话,就只用你自己那个 `mmx`(没有就退回默认 agent),
插件新增的那个**一次都不碰**。它不会去跑你自己的会话。- **它自己会起的那些轮次** —— 除了你发的消息,运行时还会自己起几轮,**每一轮都花你的模型额度**:
- **闲话**:**默认关着**,要她主动开口自己在面板里开:设置 → 「她没人的时候自己说话」。
开了以后,你安静 20 分钟后她可能自己开口;一小时最多 2 轮,两轮之间至少隔 45 分钟。
**同一个开关也能再关掉**。
Expand Down
Loading
Loading