Skip to content

MiniApp capability wishlist / MiniApp 能力愿望单 #9

Open

Description

@MyPrototypeWhat

This is the single place to ask for runtime capabilities that MiniApps do not have yet — things the Minimax Code would need to provide, such as new context APIs, window behaviour, or surface options. Maintainers fold the comments into the list below on a regular basis; popular items get split into their own issues when work starts.

Not for this issue: bugs in a specific MiniApp, or ideas for a new MiniApp. Please open a separate issue for those.

How to request a capability

Reply with a comment that covers:

  1. Capability — one line, what you want the Minimax Code to offer.
  2. Use case — what you are trying to build, and why it cannot be done with the current context / miniapp.json contract.
  3. Proposed shape (optional) — the API, manifest field, or UI you imagine.

Before posting, scan the list and the existing comments. If the same request is already there, add a 👍 to that comment instead of a new one — reactions are how we rank demand.


简体中文

这里统一收集 MiniApp 目前还不具备的运行时能力,也就是需要 Minimax Code 侧提供的东西,例如新的 context API、窗口行为、surface 配置项等。维护者会定期把评论整理进上方列表;热门需求在开始实现时会拆成独立 issue 跟进。

不属于本 issue 的内容:某个具体 MiniApp 的 bug、新 MiniApp 的点子,请另开 issue。

如何提需求

在评论里写清楚:

  1. 能力:一句话说明希望 Minimax Code 提供什么。
  2. 使用场景:你想做什么,以及为什么现有的 context / miniapp.json 契约做不到。
  3. 期望形态(可选):你设想的 API、manifest 字段或界面。

发评论前先看一遍上方列表和已有评论。如果已经有人提了同样的需求,请直接给那条评论点 👍,不要重复提——我们按 reaction 数量排优先级。

Activity

  1. avatasia commented on Oct 10, 2026

    @avatasia
    Contributor

    能力 / Capability

    Expose the id of the conversation that opened a Mini App, to both the Node entry and the client page.

    使用场景 / Use case

    I'm submitting a Mini App that renders a conversation's model trajectory. It can enumerate
    every session and read each message file, but it cannot tell which one it is supposed to
    display. Today it has to infer: it picks the conversation holding a live turn lease in
    <dataDir>/v2/sqlite/runtime-state.sqlite.

    That works, but it depends on an internal database schema that a single client update could
    invalidate, and it has a failure mode that is hard to detect — when no conversation is running
    a turn, it falls back to "most recently written file", which silently shows the previous
    conversation's content. I don't think a plugin should have to depend on that, or guess.

    This is not specific to my app. Trajectory viewers, Token dashboards, cost summaries and
    session quality reviews all need to know which conversation they are looking at.

    Why the current contract can't do it:

    • start(context) receives no session id.
    • window.mcode exposes only miniapp.message.append.
    • The page URL carries no query, hash, or referrer.

    期望形态 / Proposed shape

    Either would be enough (optional — happy with any):

    Node side — a read-only field on the context:

    export function start(context) {
      console.log(context.sessionId); // "mvs_..." or null
    }
  2. 7723qqq commented on Oct 20, 2026

    @7723qqq

    Ability to read and replace the unsent draft in the composer

    能力 / Capability

    让 Mini App 能读到、并替换当前会话输入框里还没发出去的那段草稿。现在只有 miniapp:composer-append(window.mcode.miniapp.message.append):只能追加、还要用户确认,读不到也改不了。

    使用场景 / Use case

    要做的功能:把用户随手写的一句草稿,扩展成同一条请求的完整写法——补上它真正指向的文件、模块和符号,说清要改什么、什么算做完——用户看过、确认后,再回填到输入框,由用户自己按 Send。

    这是 kimi-code TUI 里已有的 prompt-optimizer(输入框上 Ctrl+P,结果进 diff 面板,accept / discard)。随功能一起带过来的改写契约是:

    • 四条上限:草稿输入 8000 字符、继承上下文 6 轮、上下文 4000 字符、输出 8000 字符;
    • 超出部分按 …(truncated) 截断;
    • 指令是「把请求写出来,不是回答它」:纯文本,无前后缀,不解释改了什么,跟草稿同语言,宁可写长也不空转;
    • 三条后置检查:trim 后不得为空、不得超过 8000 字符、与原文相同时视为「没有变化」。

    为什么现有契约做不到——四件事缺一不可:

    1. 读当前未发送的草稿:window.mcode.miniapp 只有 message.append,页面没有任何读取输入框的途径。
    2. 读最近几轮用户消息:没有 API。kimi-code 取最近 6 轮、按 4000 字符截断,这里拿不到,所以「那个 bug」「继续」这类指代没有依据。
    3. 知道自己在哪个会话、工作目录在哪:start(context) 没有 sessionId,页面 URL 也不带 query / hash。这一条与上面 @avatasia 的请求是同一个,我在这里一并记上。
    4. 回填结果:只有 message.append(追加 + 用户确认),没有「替换」。

    我试过的绕法,为什么不成立:

    • 读 <dataDir>/v2/sessions/*/messages.jsonl 拿「用户最后发的一句话」。能跑,但依赖 Host 未文档化的磁盘格式,AGENTS.md 明确写着读 Host 文件没有受支持的 API;而且插件不知道自己开在哪个会话里,只能把最近 5 个会话列出来让用户挑——这等于把「猜」包装成了功能,不是解决办法。
    • UserPromptSubmit 钩子能读到 prompt,但 handler 超时被钳在 10 秒(MAX_TIMEOUT_MS = 10_000),做不完一次模型改写;输出字段里也没有替换 prompt 的项(suppressOriginalPrompt 只是兼容层里的一个未实现名称)。
    • agents/<name>.md 声明的子 agent 不会出现在 agents() 里(那个列表是用户配置的 agent),所以 agent.create({ agent }) 绑不上,只读约束无法通过它强制。

    我核过当前客户端的实际接口(MiniMax Code 3.1.3-inside.117):Mini App 桥一共 13 个通道,composer 只有 append;manifest 的 16 个字段里没有 composer / command / shortcut 一类。

    期望形态 / Proposed shape

    页面与 Node 各一组,最小可用即可(命名随意):

    // 页面:window.mcode.miniapp
    const draft = await miniapp.composer.getDraft();      // { text } | null
    await miniapp.composer.replaceDraft({ text });        // 语义同 append:仍需用户确认
    const turns = await miniapp.conversation.recentTurns({ maxTurns: 6, maxChars: 4000 });
    // Node:start(context)
    context.sessionId;  // "mvs_..." | null
    context.cwd;        // 当前会话的工作目录 | null

    若不想新增 replaceDraft,给 message.append 加一个 mode: 'replace' | 'append' 也能满足第 4 项。

    验收标准 / Acceptance criteria

    装上这个 Mini App 之后:

    1. 不用手动粘贴任何「上一轮上下文」,就能对着当前会话改写;
    2. 不读宿主私有文件(不碰 v2/sessions、v2/sqlite),也能知道当前会话与工作目录;
    3. 改写结果能直接回填到当前输入框,是替换而不是追加,用户确认后自己发送;
    4. 用户在确认框里取消时,输入框内容不变。
  3. 7723qqq commented on Oct 20, 2026

    @7723qqq

    承接上一条:把 Mini App 缺的能力一次列全

    上一条只写了 prompt-optimizer 一个功能要什么。评论里补一条完整的——一个 Mini App 现在只能待在自己的面板里,凡是「和用户正在做的事挨着」的能力都缺。

    现状(MiniMax Code 3.1.3-inside.117 实测):Mini App 桥共 13 个通道(agent-* 9 个、composer-append 1 个、window-* 3 个);manifest 16 个字段;Host Binding 只实现了 browser.use v1 和 computer.use v1;hook 有 11 个事件但 handler 超时钳在 10 秒。

    # 缺口 现状 挡住了什么(本仓库已上架的包为例)
    1 读输入框草稿 无 prompt-optimizer:任何「就地处理你正在写的东西」的 App(改写、翻译、查错、补全、模板)都要用户重打一遍
    2 替换草稿(不只是追加) 只有 message.append + 确认 同上:只能往后加,做不了「换成这个」
    3 会话身份 start(context) 无 sessionId,页面 URL 无 query/hash mmc-trajectory、两个 Token 看板:只能猜「最近写入的会话」,猜错就显示别人的内容
    4 工作目录 无 cwd 自驾规划、仓库透视、Git 提交树:所有「按当前项目做事」的 App 都得让用户粘路径
    5 最近几轮对话 无 API prompt-optimizer:「那个 bug」「继续」这类指代没有依据(kimi-code 取 6 轮 / 4000 字符)
    6 触发入口 只能先打开页面 没有 / 命令、没有工具栏按钮、没有快捷键。用户得「打开 App → 再切回对话」,这正是上一条里最难用的那一步
    7 UI 落点 无 不能往输入框工具条或消息动作行放一个入口,App 永远在侧栏里等你去点
    8 已发送消息的动作 页面不能改(但客户端 UI 已有编辑栏) 想「改一版重发」只能人工复制粘贴
    9 长任务 hook handler 钳在 10s(MAX_TIMEOUT_MS) 任何要在钩子里调一次模型的预处理都做不完
    10 替换本轮 prompt suppressOriginalPrompt 只是兼容层里未实现的名称 拦截后只能追加,模型会同时看到草稿和改写

    如果只能先做三件

    按本仓库现有 App 的实际阻塞程度排序:

    1. 读写草稿(Add Token Usage Board (mcode-usage-monitor) by yanhy2000 #1 + docs: 补充 About,明确面向开源社区贡献 MiniApp 插件 #2)—— 一句话就能解掉一整类 App 的往返;语义可以沿用 append 的确认框,加一个 mode: 'replace' 即可。
    2. 会话身份 + 工作目录 + 最近几轮(docs: 补充 About,明确面向开源社区贡献 MiniApp 插件 #3 + Add Model Manager mini app by ocoomber #4 + 全选后点「反选」没有变化(模型/会话筛选下拉) #5)—— 这三样是一组,缺一样就还是得猜。会话 id 那条 @avatasia 已经提过,我在这里只补 cwd 和 turns。
    3. 触发入口(mcode-usage-monitor: update to 1.2.0 #6 + Add git-tree: local Git commit graph viewer #7)—— 让 App 能被「当前上下文」唤起,而不是要求用户离开正在写的地方。

    #8–#10 是「更顺」而不是「能不能」,可以往后排。

    需要的话我可以把这张表拆成独立 issue 逐条跟进,或者按维护者的模板重写一遍。

  4. MyPrototypeWhat commented on Oct 21, 2026

    @MyPrototypeWhat
    CollaboratorAuthor

    感谢 @avatasia 和 @7723qqq 的详细需求,已记进愿望单。

    即将发布的能力,发布后会在这里更新:

    • 拿到当前打开的是哪个会话,以及它的工作目录
    • 列出最近的会话,并跟进某个会话的进度
    • 拿到会话最近一条回复的内容

    现有能力:往输入框追加文字(每次需要用户确认)。

    暂时还没有、仍在愿望单里的:读取/替换输入框草稿、一次读出最近几轮对话、/ 命令和工具栏按钮等触发入口。这些继续按 👍 数量排优先级。

    另外提醒一句:不建议插件直接读取宿主内部的数据库或会话文件(如 v2/sqlite、v2/sessions),这些结构随时可能变化,依赖它们的 PR 也不会被合并。


    Thanks @avatasia and @7723qqq for the detailed requests — they're on the wishlist.

    Shipping soon (we'll update this thread when they land):

    • Knowing which conversation is currently open, and its working directory
    • Listing recent conversations and following a conversation's progress
    • Reading a conversation's latest reply

    Already available: appending text to the composer (the user confirms each time).

    Not yet, still on the wishlist: reading/replacing the composer draft, reading the last several turns at once, and entry points like / commands or toolbar buttons. These stay ranked by 👍.

    One note: please don't have plugins read the host's internal database or session files (e.g. v2/sqlite, v2/sessions). Those formats can change at any time, and PRs that depend on them won't be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    capability-requestRequest for a runtime capability the Host should offer MiniAppsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions