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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques

| MiniApp | What it does | Author |
| --- | --- | --- |
| [K线价格行为实战台](plugins/alphamao1/kline-intuition-lab/) | A price-action training board for A-share traders: call every bar yourself in a 5-level blind run, then compare against a LightGBM model scored on the same rules, with a motif radar and an after-action review | [AlphaMao1](https://github.com/AlphaMao1) |
| [Postman Lite](plugins/ssugarr/postman-lite/) | A lightweight local API request tool: build requests, send them through a local proxy that sidesteps browser CORS limits, and inspect responses, with collections kept as plain JSON | [ssugarr](https://github.com/ssugarr) |
| [Weekly Planner](plugins/alanhean/weekly-planner/) | A local weekly planner: add tasks with a date and a priority, review them day by day, tick them off, and track the week's completion rate | [Alanhean](https://github.com/Alanhean) |
| [DeepSeek Chat Migration](plugins/danielwalnut/deepseek-chat-migration/) | Preview official DeepSeek web exports locally, restore branches and attachments, and import selected conversations as native MiniMax Code sessions with a bundled importer | [DanielWalnut](https://github.com/DanielWalnut) |
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求

| MiniApp | 功能 | 作者 |
| --- | --- | --- |
| [K线价格行为实战台](plugins/alphamao1/kline-intuition-lab/README.zh-CN.md) | A 股价格行为训练台:5 关盲判逐根 K 线自己下判断,再与同规则的 LightGBM 模型对账,附母题雷达与赛后复盘 | [AlphaMao1](https://github.com/AlphaMao1) |
| [Postman Lite](plugins/ssugarr/postman-lite/README.zh-CN.md) | 轻量的本地 API 请求工具:构建请求、通过本地代理转发(绕过浏览器 CORS 限制)、查看响应,集合以纯 JSON 保存 | [ssugarr](https://github.com/ssugarr) |
| [周计划](plugins/alanhean/weekly-planner/README.zh-CN.md) | 本地周计划:手动录入任务、日期与优先级,按天查看安排,勾选完成并跟踪本周完成率 | [Alanhean](https://github.com/Alanhean) |
| [DeepSeek 会话迁移](plugins/danielwalnut/deepseek-chat-migration/README_ZH.md) | 在本机预览 DeepSeek 网页版官方导出包,恢复分支和附件,并用自带的导入脚本把选中对话导入成 MiniMax Code 原生会话 | [DanielWalnut](https://github.com/DanielWalnut) |
Expand Down
20 changes: 20 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schemaVersion": 1,
"name": "kline-intuition-lab",
"displayName": "K线价格行为实战台",
"version": "2.0.0",
"description": "以 Al Brooks 价格行为学为理论底座的逐日动态推理训练台:PA-LightGBM 用 20 维纯价格行为特征逐日给出多头胜算分与 TreeSHAP 中文归因;闯关模式 5 关盲判对决(玩家与机器同 T+1、同手续费、10% 颗粒自由调仓,机器决策同拍后置亮牌),形态练习模式按 5 大母题刻意练习并支持 iFinD 动态出题,赛后给出价格行为结构诊断、操作诊断与机器学习对照复盘。",
"author": "AlphaMao1",
"icon": "icon.png",
"category": "Business",
"exampleQueries": [
"打开 K线价格行为实战台,开始一局 5 关连续盲判对决。",
"来一组「强趋势回踩 20EMA」专项练习,把正反形态对比着打。",
"看看我在 5 大价格行为母题上的识别准确率与跑赢机器的胜率。",
"把上一局错题整理成一段提问,发给 Agent 做深度复盘。",
"用 002415.SZ 动态生成一局价格行为关卡。"
],
"apps": [],
"mcpServers": [],
"skills": []
}
21 changes: 21 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 AlphaMao1

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
107 changes: 107 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# K线价格行为实战台 (`kline-intuition-lab`)

A price-action training board for Chinese A-share traders: it replays real daily candles and makes
you call each bar yourself, then scores you against a machine that was trained on the same rules.

It is for traders who want to train the one skill that reading charts cannot teach on its own:
committing to a position, bar by bar, and finding out afterwards whether the read was right.

## What it does

- **闯关模式 (Level mode)** — a 5-level run of blind calls. For every bar you decide buy, sell, or
hold. The machine decides the same bar under the same rules (T+1 lock, 0.075% one-way commission,
10% position granularity) and shows its card after yours, so the comparison stays honest.
- **形态练习 (Pattern drills)** — deliberate practice on five price-action motifs (强趋势回踩,
区间震荡, 假突破, 关键位反转, 趋势加速), with positive and negative examples shown side by side.
- **PA-LightGBM** — a gradient-boosted model over 20 price-only features gives a 0–100 bullish
win-probability score per bar, with a TreeSHAP explanation in plain Chinese naming the bars that
drove the number.
- **赛后复盘 (Review)** — after a run you get a price-action structure diagnosis, an operating
diagnosis, and a machine-learning comparison; the wrong bars land in a wrong-answer book, and the
Agent can take a prepared deep-review prompt.
- **动态出题 (Dynamic levels)** — with the iFinD connector connected, the app pulls any A-share
daily history and generates fresh levels for that symbol.

## Why it is useful

Reading a chart with hindsight is easy: every trend looks obvious after the fact. The gap this app
closes is decision quality under uncertainty — it removes hindsight, forces a commitment on every
bar, and keeps a record of your reasoning so you can measure it. The five-motif radar turns
"my sense is off" into a specific weakness you can drill next week.

## Install

Copy this directory, including the hidden `.minimax-plugin/`, into the MiniMax Code plugins
directory as `kline-intuition-lab/` (`~/.minimax/plugins/kline-intuition-lab/` by default; the root
README's Install section explains where that directory is). Restart MiniMax Code and ask the Agent
to "打开 K线价格行为实战台,开始一局 5 关连续盲判对决。"

The level mode, the pattern drills, the PA-LightGBM scoring, and the review all work offline out of
the box. Only **动态出题** needs extra setup, described below.

### Optional: dynamic levels with iFinD

Dynamic level generation needs two things:

1. The **iFinD** plugin connected in MiniMax Code, so the app can pull daily history through the
Host Connector.
2. A local **Python 3** environment with `numpy`, `pandas`, and `lightgbm` installed, because the
level generator and the LightGBM inference run in Python. Set `MINIAPP_PYTHON` to point at a
specific interpreter if `python` / `python3` is not the one you want.

Without both, every other mode still works and the app says so clearly when you ask for a dynamic
level.

## Tested environment

- MiniMax Code 3.1.19 on Windows 11. Installed from this directory, opened through the Agent, page
rendered; level mode, pattern drills, and the review were exercised with the bundled data.
- The dynamic level path was exercised against a connected iFinD account on the same machine.
- Python 3 with `numpy`, `pandas`, and `lightgbm` present in the environment.

## Data & access

- **Files read:** the bundled package assets under `miniapp/` (client bundle, the built-in level
pool `miniapp/node/data/curated_levels.json`, and the CSI 300 reference history
`miniapp/node/data/hs300.csv` and `miniapp/node/data_v2/000300.SH_hs300.csv`).
- **Files written:** none inside the package. Match history, the motif radar, the wrong-answer book,
and custom levels are written to the host-assigned `dataDir` as `pa_matches.json`,
`pa_records.json`, `pa_wrongbook.json`, and `custom_levels.json`. Writes are atomic (temp file
plus rename).
- **Network:** none of its own. The dynamic level path calls the iFinD market-data tool through the
Host Connector (`hostConnectorAccess.providers: ["thsifind"]`), so credentials stay in the Host.
- **Processes:** spawns a local Python interpreter (`python` / `python3`, or `MINIAPP_PYTHON`) for
level generation and model inference. Nothing is spawned for the offline modes.
- **Agent turns:** none. The app prepares a review prompt as text and hands it to the Agent only
when you ask for it; it never starts a turn by itself.
- **Conversations read:** none. No `agentAccess` is declared.
- **Tools called:** only the iFinD market-data tool listed above, and only for dynamic levels.
- **Microphone, camera, notifications:** none used.
- **Host navigation:** not read. No `hostAccess` is declared.
- **State:** all durable state lives in the host-assigned `dataDir`.

## Files

```text
.minimax-plugin/plugin.json Plugin manifest
package.json Mini App declaration
miniapp/miniapp.json Payload roots, Node entry, page route
miniapp/client/index.html The page served at /dashboard
miniapp/client/assets/ Built client bundle (no external CDN)
miniapp/node/server.mjs Node entry: serves the page and the API
miniapp/node/engine.mjs Game engine: bar-by-bar rules and scoring
miniapp/node/rules.mjs Motif taxonomy and scoring constants
miniapp/node/review.mjs Review text and the Agent review prompt
miniapp/node/store.mjs Durable state in dataDir
miniapp/node/pa_levels.mjs Level assembly and scoring helpers
miniapp/node/custom/ifind.mjs iFinD pull and dynamic level generation
miniapp/node/custom/levels_helper.py Python helper invoked for level generation
miniapp/node/custom/host-connector-value.mjs Host Connector value decoder
miniapp/node/py/ Price-action features, LightGBM engine, level scanner
miniapp/node/data/ Built-in level pool and CSI 300 reference history
icon.png Plugin icon
```

## License

[MIT](./LICENSE)
79 changes: 79 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# K线价格行为实战台 (`kline-intuition-lab`)

面向 A 股交易者的价格行为训练台:用真实日线回放,让你逐根 K 线自己下判断,再和同一套规则下的机器决策对账。

它面向那些想练"读图练不出来"的那一项能力:在不确定中逐根 K 线做决策,事后发现自己判断得准不准。

[English](./README.md) | 简体中文

## 它能做什么

- **闯关模式** — 5 关连续盲判对决。每根 K 线你决定买、卖或空仓;机器在同一套规则下(T+1 锁定、单边 0.075% 手续费、10% 颗粒度调仓)同时决策,并在你亮牌之后才亮自己的牌,保证对决公平。
- **形态练习** — 按 5 大价格行为母题(强趋势回踩、区间震荡、假突破、关键位反转、趋势加速)刻意练习,正反形态对比呈现。
- **PA-LightGBM** — 用 20 维纯价格行为特征训练梯度提升模型,逐日给出 0~100 的多头胜算分,并用 TreeSHAP 输出中文归因,指出是哪几根 K 线驱动了这个分数。
- **赛后复盘** — 一局结束后给出价格行为结构诊断、操作诊断与机器学习对照复盘;错题自动进错题本,也可以把准备好的深度复盘提问交给 Agent。
- **动态出题** — 连接 iFinD 连接器后,可拉取任意 A 股日线历史,为该标的实时生成新关卡。

## 为什么有用

事后看图很容易:趋势走出来之后,每一个形态都显得理所当然。这个应用补的是**不确定性下的决策质量**——去掉后视镜,逼你在每根 K 线上先落子,再留下判断记录并可以量化复盘。5 大母题雷达把"感觉不准"变成下一周可以针对性补练的具体短板。

## 安装

把本目录(含隐藏的 `.minimax-plugin/`)复制到 MiniMax Code 插件目录,命名为 `kline-intuition-lab/`(默认 `~/.minimax/plugins/kline-intuition-lab/`,具体路径见仓库根 README 的 Install 说明)。重启 MiniMax Code 后,让 Agent 执行"打开 K线价格行为实战台,开始一局 5 关连续盲判对决。"

闯关模式、形态练习、PA-LightGBM 打分和赛后复盘**开箱即用,无需联网**。只有**动态出题**需要额外配置,见下文。

### 可选:接入 iFinD 动态出题

动态出题需要两样东西:

1. 在 MiniMax Code 中连接 **iFinD** 插件,应用通过宿主连接器拉取日线历史。
2. 本地 **Python 3** 环境并安装 `numpy`、`pandas`、`lightgbm`——关卡生成与 LightGBM 推理在 Python 侧运行。若 `python` / `python3` 不是你想用的解释器,可用 `MINIAPP_PYTHON` 指定。

两者不齐时,其余模式照常可用;请求动态关卡时应用会明确说明原因。

## 测试环境

- MiniMax Code 3.1.19 / Windows 11。由本目录安装、经 Agent 打开、页面正常渲染;使用内置数据跑通了闯关模式、形态练习与赛后复盘。
- 动态出题在同一台机器上连接 iFinD 账号实测通过。
- 环境中的 Python 3 已安装 `numpy`、`pandas`、`lightgbm`。

## 数据与访问

- **读取文件:** `miniapp/` 下的随包资源(客户端构建产物、内置关卡池 `miniapp/node/data/curated_levels.json`,以及沪深 300 参考历史 `miniapp/node/data/hs300.csv` 与 `miniapp/node/data_v2/000300.SH_hs300.csv`)。
- **写入文件:** 不写入包内。战绩、母题雷达、错题本与自定义关卡写入宿主分配的 `dataDir`,分别为 `pa_matches.json`、`pa_records.json`、`pa_wrongbook.json`、`custom_levels.json`,采用原子写(临时文件 + rename)。
- **网络:** 应用自身不发起网络请求。动态出题通过宿主连接器调用 iFinD 行情工具(`hostConnectorAccess.providers: ["thsifind"]`),凭据始终留在宿主侧。
- **进程:** 动态出题与模型推理会拉起本地 Python 解释器(`python` / `python3`,或 `MINIAPP_PYTHON`)。离线模式不拉起任何子进程。
- **Agent 调用:** 不会主动发起。应用只在你要的时候生成一段复盘提问文本交给 Agent。
- **读取会话:** 不读取,未声明 `agentAccess`。
- **调用工具:** 仅上述 iFinD 行情工具,且只在动态出题时使用。
- **麦克风、摄像头、通知:** 均未使用。
- **宿主导航:** 不读取,未声明 `hostAccess`。
- **状态存放:** 全部持久化状态位于宿主分配的 `dataDir`。

## 文件说明

```text
.minimax-plugin/plugin.json 插件清单
package.json Mini App 声明
miniapp/miniapp.json 载荷根目录、Node 入口、页面路由
miniapp/client/index.html /dashboard 提供的页面
miniapp/client/assets/ 客户端构建产物(无外部 CDN)
miniapp/node/server.mjs Node 入口:提供页面与 API
miniapp/node/engine.mjs 游戏引擎:逐根 K 线规则与裁决
miniapp/node/rules.mjs 母题体系与计分常量
miniapp/node/review.mjs 复盘文本与 Agent 复盘提问
miniapp/node/store.mjs dataDir 内的持久化状态
miniapp/node/pa_levels.mjs 关卡组装与打分辅助
miniapp/node/custom/ifind.mjs iFinD 拉取与动态关卡生成
miniapp/node/custom/levels_helper.py 关卡生成调用的 Python 助手
miniapp/node/custom/host-connector-value.mjs 宿主连接器返回值解码
miniapp/node/py/ 价格行为特征、LightGBM 引擎、关卡扫描器
miniapp/node/data/ 内置关卡池与沪深 300 参考历史
icon.png 插件图标
```

## 许可

[MIT](./LICENSE)
Binary file added plugins/alphamao1/kline-intuition-lab/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/miniapp/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1440, height=940, initial-scale=1.0" />
<meta name="color-scheme" content="light" />
<title>K线价格行为实战台</title>
<script type="module" crossorigin src="./assets/index-CPL7xR3S.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D4hbCUEK.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
32 changes: 32 additions & 0 deletions plugins/alphamao1/kline-intuition-lab/miniapp/miniapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"schemaVersion": 1,
"artifacts": {
"client": [
"./miniapp/client"
],
"node": [
"./miniapp/node"
]
},
"runtime": {
"kind": "process",
"entry": "./miniapp/node/server.mjs",
"lifecycle": "on-demand"
},
"surface": {
"path": "/dashboard",
"window": {
"width": 1440,
"height": 940,
"minWidth": 1080,
"minHeight": 700,
"resizable": true
}
},
"mcpEndpoints": [],
"hostConnectorAccess": {
"providers": [
"thsifind"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const MAX_JSON_STRING_LAYERS = 4;

/**
* Decode the raw `HostConnectorCallResult.value` root without changing provider-owned fields.
*
* A probe may observe exactly one text-block array as a provider transport shape. Only when that
* exact shape appears, remove it once and decode JSON-looking strings from its `text`. Every other
* JSON value passes through unchanged and provider-owned fields are never traversed or rewritten.
*
* @param {unknown} value
* @returns {unknown}
*/
export function decodeHostConnectorValue(value) {
if (!isExactSingleTextBlockEnvelope(value)) return value;
let current = value[0].text;

for (let layer = 0; typeof current === 'string' && looksLikeEncodedJson(current); layer += 1) {
if (layer === MAX_JSON_STRING_LAYERS) {
fail(
'HOST_CONNECTOR_VALUE_NESTING_EXCEEDED',
`Host Connector value exceeded ${MAX_JSON_STRING_LAYERS} JSON string layers`,
);
}
try {
current = JSON.parse(current);
} catch {
fail('HOST_CONNECTOR_VALUE_MALFORMED_JSON', 'Host Connector value is not valid JSON');
}
}

return current;
}

function isExactSingleTextBlockEnvelope(value) {
if (!Array.isArray(value) || value.length !== 1 || !isRecord(value[0])) return false;
const block = value[0];
return Object.keys(block).length === 2 && block.type === 'text' && typeof block.text === 'string';
}

function looksLikeEncodedJson(value) {
const first = value.trimStart()[0];
return first === '"' || first === '{' || first === '[';
}

function isRecord(value) {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}

function fail(code, message) {
const error = new Error(message);
error.code = code;
throw error;
}
Loading