From 8d5df9743ad8d4b78711628d83e872c3ddc7362e Mon Sep 17 00:00:00 2001 From: start3208 <250462097+start3208@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:15:53 +0800 Subject: [PATCH 1/5] Add GitHub Star Shelf: searchable GitHub stars with plain-language AI explanations --- README.md | 1 + README.zh-CN.md | 1 + .../github-star-shelf/.gitattributes | 3 + .../.github/workflows/ci.yml | 58 ++ .../start3208/github-star-shelf/.gitignore | 8 + .../.minimax-plugin/plugin.json | 20 + plugins/start3208/github-star-shelf/LICENSE | 21 + plugins/start3208/github-star-shelf/README.md | 140 ++++ .../github-star-shelf/README.zh-CN.md | 140 ++++ .../github-star-shelf/docs/preview-dark.png | Bin 0 -> 228292 bytes .../github-star-shelf/docs/preview.png | Bin 0 -> 229290 bytes plugins/start3208/github-star-shelf/icon.png | Bin 0 -> 1574 bytes .../miniapp/client/actions.js | 406 ++++++++++ .../github-star-shelf/miniapp/client/api.js | 60 ++ .../github-star-shelf/miniapp/client/app.js | 31 + .../miniapp/client/index.html | 14 + .../github-star-shelf/miniapp/client/md.js | 566 +++++++++++++ .../github-star-shelf/miniapp/client/state.js | 62 ++ .../miniapp/client/style.css | 418 ++++++++++ .../github-star-shelf/miniapp/client/ui.js | 358 +++++++++ .../miniapp/client/view-detail.js | 588 ++++++++++++++ .../miniapp/client/view-dialogs.js | 435 ++++++++++ .../miniapp/client/view-main.js | 327 ++++++++ .../github-star-shelf/miniapp/miniapp.json | 38 + .../miniapp/node/lib/agent.mjs | 756 ++++++++++++++++++ .../miniapp/node/lib/env.mjs | 282 +++++++ .../miniapp/node/lib/github.mjs | 491 ++++++++++++ .../miniapp/node/lib/mcp.mjs | 252 ++++++ .../miniapp/node/lib/search.mjs | 158 ++++ .../miniapp/node/lib/service.mjs | 533 ++++++++++++ .../miniapp/node/lib/store.mjs | 168 ++++ .../miniapp/node/lib/util.mjs | 105 +++ .../miniapp/node/prompts/common.md | 38 + .../miniapp/node/prompts/explain-cloud.md | 16 + .../miniapp/node/prompts/explain-local.md | 16 + .../miniapp/node/prompts/manage.md | 18 + .../miniapp/node/prompts/notes.md | 19 + .../github-star-shelf/miniapp/node/server.mjs | 218 +++++ .../start3208/github-star-shelf/package.json | 17 + .../github-star-shelf/servers.mcp.json | 12 + .../github-star-shelf/test/ai.test.mjs | 337 ++++++++ .../github-star-shelf/test/app.test.mjs | 366 +++++++++ .../github-star-shelf/test/client.test.mjs | 191 +++++ .../github-star-shelf/test/env.test.mjs | 280 +++++++ .../github-star-shelf/test/github.test.mjs | 482 +++++++++++ .../test/helpers/fake-gh.mjs | 75 ++ .../test/helpers/fake-git.mjs | 50 ++ .../test/helpers/fixtures.mjs | 73 ++ .../github-star-shelf/test/helpers/host.mjs | 71 ++ .../test/helpers/no-network.mjs | 34 + .../test/helpers/sandbox.mjs | 97 +++ .../test/helpers/stub-agent.mjs | 111 +++ .../github-star-shelf/test/helpers/world.mjs | 123 +++ .../github-star-shelf/test/hygiene.test.mjs | 154 ++++ .../github-star-shelf/test/live.test.mjs | 23 + .../test/portability.test.mjs | 355 ++++++++ 56 files changed, 9616 insertions(+) create mode 100644 plugins/start3208/github-star-shelf/.gitattributes create mode 100644 plugins/start3208/github-star-shelf/.github/workflows/ci.yml create mode 100644 plugins/start3208/github-star-shelf/.gitignore create mode 100644 plugins/start3208/github-star-shelf/.minimax-plugin/plugin.json create mode 100644 plugins/start3208/github-star-shelf/LICENSE create mode 100644 plugins/start3208/github-star-shelf/README.md create mode 100644 plugins/start3208/github-star-shelf/README.zh-CN.md create mode 100644 plugins/start3208/github-star-shelf/docs/preview-dark.png create mode 100644 plugins/start3208/github-star-shelf/docs/preview.png create mode 100644 plugins/start3208/github-star-shelf/icon.png create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/actions.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/api.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/app.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/index.html create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/md.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/state.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/style.css create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/ui.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/view-detail.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/view-dialogs.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/client/view-main.js create mode 100644 plugins/start3208/github-star-shelf/miniapp/miniapp.json create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/agent.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/env.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/github.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/mcp.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/search.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/service.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/store.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/lib/util.mjs create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/prompts/common.md create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/prompts/explain-cloud.md create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/prompts/explain-local.md create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/prompts/manage.md create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/prompts/notes.md create mode 100644 plugins/start3208/github-star-shelf/miniapp/node/server.mjs create mode 100644 plugins/start3208/github-star-shelf/package.json create mode 100644 plugins/start3208/github-star-shelf/servers.mcp.json create mode 100644 plugins/start3208/github-star-shelf/test/ai.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/app.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/client.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/env.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/github.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/fake-gh.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/fake-git.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/fixtures.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/host.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/no-network.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/sandbox.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/stub-agent.mjs create mode 100644 plugins/start3208/github-star-shelf/test/helpers/world.mjs create mode 100644 plugins/start3208/github-star-shelf/test/hygiene.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/live.test.mjs create mode 100644 plugins/start3208/github-star-shelf/test/portability.test.mjs diff --git a/README.md b/README.md index 4cbcc4c1..56c07524 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques | [Site QA](plugins/lonelyguy-se1/site-qa/) | Check local HTML/robots/sitemap for SEO and accessibility gaps, then ask the agent to fix them (Mini App + skill/CLI). Requires MiniMax Code 3.1.6 or later | [LonelyGuySE1](https://github.com/LonelyGuy-SE1) | | [H3-Image-Executor](plugins/liddalidd/h3-image-executor/) | Turn one sentence into verified 4K images: it plans the shot list, searches for reference images, generates, reviews each image by looking at it, corrects colour cast, runs a bounded fix loop and delivers the result with an acceptance report; multi-image runs generate a character sheet first so the same subject stays the same subject. Needs an H3-Image endpoint and key you configure yourself. Requires MiniMax Code 3.1.6 or later | [liddalidd](https://github.com/liddalidd) | | [Express Media](plugins/andre-1998/express-media/) | Compress a video to the size each platform accepts and report whether it fits; the bundled limits table shows where every number comes from | [Andre-1998](https://github.com/Andre-1998) | +| [GitHub Star Shelf](plugins/start3208/github-star-shelf/) | Turn your GitHub stars into collections you can search and ask the AI to explain in plain language: from the README alone, or after it has read a shallow clone of the code. One session per project, your own notes, and collections the Agent can arrange | [start3208](https://github.com/start3208) |
Preview: Cutline diff --git a/README.zh-CN.md b/README.zh-CN.md index 1f6223d7..d64998a5 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -93,6 +93,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求 | [Site QA](plugins/lonelyguy-se1/site-qa/) | 检查本地 HTML/robots/sitemap 的 SEO / 无障碍问题,再让 Agent 修复(Mini App + skill/CLI)。需要 MiniMax Code 3.1.6 或更高版本(说明文档为英文) | [LonelyGuySE1](https://github.com/LonelyGuy-SE1) | | [H3-Image-Executor](plugins/liddalidd/h3-image-executor/README.zh-CN.md) | 把一句话需求跑成经过校验的 4K 图片:规划分镜、检索参考图、生成、看图评审、色偏校正、有限次修正,最后交付图片和验收报告;多图任务会先生成角色设定图锁定主体外观。需要自备 H3-Image 接口地址和 Key。需要 MiniMax Code 3.1.6 或更高版本 | [liddalidd](https://github.com/liddalidd) | | [急件 · 视频投递](plugins/andre-1998/express-media/README.zh-CN.md) | 把视频压到各平台能收的体积,并如实告诉你发不发得出去;内置上限表标明每个数字的来源 | [Andre-1998](https://github.com/Andre-1998) | +| [GitHub 收藏夹](plugins/start3208/github-star-shelf/README.zh-CN.md) | 把 GitHub Star 分进收藏夹,按名称、README 和备注搜索;让 AI 用大白话讲清每个项目:只看 README 讲,或读一遍浅克隆的代码再讲。一个项目一个会话,可以写备注,也能让 Agent 整理收藏夹 | [start3208](https://github.com/start3208) |
预览:Cutline diff --git a/plugins/start3208/github-star-shelf/.gitattributes b/plugins/start3208/github-star-shelf/.gitattributes new file mode 100644 index 00000000..b24f7cde --- /dev/null +++ b/plugins/start3208/github-star-shelf/.gitattributes @@ -0,0 +1,3 @@ +# 统一用 LF:Mini App 的内容摘要按字节算,Windows 上把换行转成 CRLF 会让同一个版本算出不同的摘要 +* text=auto eol=lf +*.png binary diff --git a/plugins/start3208/github-star-shelf/.github/workflows/ci.yml b/plugins/start3208/github-star-shelf/.github/workflows/ci.yml new file mode 100644 index 00000000..eb44d3d5 --- /dev/null +++ b/plugins/start3208/github-star-shelf/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + test: + name: test (${{ matrix.os }}, node ${{ matrix.node }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + node: [22, 24] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ matrix.node }} + # 全部离线:假 gh / 假 git / 假 AI,不访问 GitHub + - run: npm test + + package: + name: official package checks + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 22 + # 官方社区仓库(MiniMax-AI/MiniMax-Code-MiniApps)里的包校验脚本,固定在一个已验证过的提交上。 + # 只拉目录结构和 scripts/ 里的文件(不下载仓库里的截图和动图),几秒钟就好。 + # 想跟进它的新规则:把下面的哈希换成社区仓库的新提交,再看本地和 CI 是否仍然通过。 + - name: Fetch the community validator (pinned, scripts only) + run: | + git init --quiet "$RUNNER_TEMP/community" + cd "$RUNNER_TEMP/community" + git remote add origin https://github.com/MiniMax-AI/MiniMax-Code-MiniApps + git sparse-checkout set --cone scripts + git fetch --quiet --depth 1 --filter=blob:none origin cfcaa0f74fe08d2b40f598ae27e540c94f4bd026 + git checkout --quiet FETCH_HEAD + # 校验的是 git 跟踪的文件(不带 .git,和「从 Git 仓库导入」看到的一样);目录名必须等于插件 ID + - name: Validate this package + run: | + mkdir -p "$RUNNER_TEMP/pkg/github-star-shelf" + git archive HEAD | tar -x -C "$RUNNER_TEMP/pkg/github-star-shelf" + node "$RUNNER_TEMP/community/scripts/validate.mjs" "$RUNNER_TEMP/pkg/github-star-shelf" diff --git a/plugins/start3208/github-star-shelf/.gitignore b/plugins/start3208/github-star-shelf/.gitignore new file mode 100644 index 00000000..2c15a1cc --- /dev/null +++ b/plugins/start3208/github-star-shelf/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +.DS_Store +Thumbs.db +*.log +*.tmp +.env +.env.* +coverage/ diff --git a/plugins/start3208/github-star-shelf/.minimax-plugin/plugin.json b/plugins/start3208/github-star-shelf/.minimax-plugin/plugin.json new file mode 100644 index 00000000..6dc65de7 --- /dev/null +++ b/plugins/start3208/github-star-shelf/.minimax-plugin/plugin.json @@ -0,0 +1,20 @@ +{ + "schemaVersion": 1, + "name": "github-star-shelf", + "displayName": "GitHub 收藏夹", + "version": "1.2.0", + "description": "把 GitHub Star 导进收藏夹,用 AI 大白话讲清每个项目是干嘛的。云讲解不下载代码,本地讲解拉到缓存里看;一个项目一个会话,支持备注,按名称、README、备注搜索,AI 也能通过接口整理收藏夹。", + "author": "start3208", + "icon": "icon.png", + "category": "Other", + "exampleQueries": [ + "打开 GitHub 收藏夹", + "把我的 GitHub Star 整理成收藏夹", + "用大白话讲讲这个开源项目是干什么的" + ], + "apps": [], + "mcpServers": [ + "servers.mcp.json" + ], + "skills": [] +} diff --git a/plugins/start3208/github-star-shelf/LICENSE b/plugins/start3208/github-star-shelf/LICENSE new file mode 100644 index 00000000..384dd892 --- /dev/null +++ b/plugins/start3208/github-star-shelf/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 start3208 + +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. diff --git a/plugins/start3208/github-star-shelf/README.md b/plugins/start3208/github-star-shelf/README.md new file mode 100644 index 00000000..6e3fd904 --- /dev/null +++ b/plugins/start3208/github-star-shelf/README.md @@ -0,0 +1,140 @@ +# GitHub Star Shelf + +English | [简体中文](README.zh-CN.md) + +Turn your GitHub stars into a shelf you can actually use. **GitHub Star Shelf** is a [MiniMax Code](https://code.minimax.cn) Mini App: import your stars, sort them into collections, search names, READMEs and your own notes, and ask the AI to explain any project in plain language, either from its README alone or after it has read the real code. + +Plugin ID `github-star-shelf` · MIT licensed · the interface is in Chinese. + +![The project list, collections and an AI explanation](docs/preview.png) + +*Screenshots use sample data. The light and dark themes both follow MiniMax Code; [a dark screenshot](docs/preview-dark.png) is included.* + +## What it does + +- **Import** your stars with the GitHub CLI (`gh`), or the public stars of any user by name. READMEs are fetched in the background, so search can look inside them. +- **Collections and notes.** Sort projects into collections, keep your own notes, and let the AI add notes too. +- **Search** names, descriptions, topics, README text and notes (several words must all match). Filter by language or by explained / noted; sort by star date, stars, last push or name. +- **Cloud explanation.** The AI reads the project's metadata and README and explains it in plain language. No code is downloaded. +- **Local explanation.** A shallow clone goes into the AI's own workspace and the AI reads the real code. It never runs, installs or builds anything from the repository. +- **One session per project.** Follow-up questions stay with that project; start a fresh session whenever you like. Every permission request from the AI is shown in the page and waits for your answer. +- **MCP tools.** Twelve tools let the Agent list and search projects, manage collections, write notes and import stars. +- **Tools & locations.** The settings page shows which `gh` and `git` it found and where, lets you re-detect after installing one, or point it at your own. + +## Requirements + +- **MiniMax Code 3.1.6 or later** on macOS or Windows. Earlier versions cannot tell a Mini App where the AI session works, which the AI features need. +- **`git`**, for local explanations. +- **`gh`** (the GitHub CLI), logged in with `gh auth login`: optional but recommended. Without it the app reads public data anonymously, and GitHub allows only 60 such requests per hour per network. +- Node.js 22 or later is needed only to run the tests. The Mini App itself runs on MiniMax Code's own Node runtime. + +## Install + +**From Git** (MiniMax Code 3.1.11 or later): in the plugin marketplace click **Create**, choose **Import from Git repository** under **Mini App**, paste `https://github.com/start3208/github-star-shelf`, click **Preview**, check the permissions, then **Import**. Open it from plugin management, or ask the Agent to open GitHub Star Shelf. + +**By hand:** `git clone https://github.com/start3208/github-star-shelf`, then copy the folder **without `.git`** (but with the hidden `.minimax-plugin/`) to `/plugins/github-star-shelf/` (by default `~/.minimax/plugins/`) and restart MiniMax Code. You can also hand the folder to the Agent and ask it to publish it as a Mini App. + +## Use it + +1. Open the Mini App and click **Import**. If `gh` isn't logged in, type your GitHub username first. +2. Pick a project and choose **Cloud explanation** (README only) or **Local explanation** (reads the code too). +3. Ask follow-ups on the **Chat** tab, add notes, file projects into collections, or open the **AI tidy-up** panel and describe how you want the collections arranged. + +## How it finds your tools and folders + +Nothing about your machine is hard-coded. Instead: + +| What | How it is found | +| --- | --- | +| `gh`, `git` | 1) The path you set in **Settings → Tools & locations**. 2) Your `PATH`. 3) The usual install folders for your system: macOS `/opt/homebrew/bin`, `/usr/local/bin`, MacPorts; Linux `/usr/bin`, Linuxbrew, snap, Nix, `~/.local/bin`; Windows Program Files, `%LOCALAPPDATA%\Programs`, Scoop, Chocolatey. 4) Only if it is still missing: the `PATH` of your login shell. Each candidate is run with `--version` and must identify itself as `gh` or `git`, so a broken or look-alike program is skipped. | +| macOS `git` | `/usr/bin/git` is skipped when the Command Line Tools are not installed: it is only a placeholder that would pop up Apple's installer. | +| Windows | Only `.exe` / `.com` programs are used, and clones get `core.longpaths=true`. | +| AI workspace folder | Asked from MiniMax Code for each session (`workspaceDir`), because it differs per computer and per Agent. It is asked again after every start (when the page first asks for its state) and whenever the remembered folder is gone, so data moved to another computer follows. The settings page only displays the last one. | +| Data folder | Handed over by MiniMax Code (`dataDir`). | +| Clone cache | `cache/repos/__/` inside the AI workspace folder. Before cloning, the app checks that it is writable and has room (twice the repository size, at least 200 MB). | + +The offline tests fake other people's machines to cover this: a short `PATH`, tools in non-standard places, a broken or look-alike `gh`, the macOS placeholder `git`, folders whose names contain spaces, Chinese characters and quotes, unwritable or full disks, and a moved data folder. + +## Tested environment + +- **MiniMax Code 3.1.16 on macOS (Apple silicon)**, with `gh` 2.96 logged in and Apple's `git`. Version 1.1.0 was used through this window: imported stars, cloud and local explanations, notes, follow-ups and the settings page. +- **Install from Git:** the marketplace's *Import from Git repository* preview showed this package with its name, version, commit, declared permission (`agentAccess: session.run`) and the minimum version below, and the imported copy was used locally on the same machine. +- **Offline tests** (`npm test`, about 130 tests, under 30 s): Node 22, 24 and 26 on macOS (Apple silicon). CI runs Node 22 and 24 on Ubuntu and macOS. +- **The page** (1.2.0): rendered in headless Chrome against an isolated copy of the app with a fake `gh`, `git` and AI, in light and dark themes, at widths from 360 to 1400 px: no console errors and no horizontal scrolling. Those screenshots are the ones above. This is not a real-browser test suite: it lives outside this repository and does not run in CI. +- **Not verified:** Windows. The Windows folder rules are unit-tested with a simulated platform only, and the end-to-end tests need a POSIX `sh` to fake `gh` and `git`, so they are skipped there. Linux only runs in CI. The AI's permission confirmation card has only been exercised with a simulated Agent, because the real one never asked for a permission here. Whether "open session in sidebar" actually opens the sidebar cannot be seen from inside the page. GitHub Enterprise is not supported (`GH_HOST` is pinned to `github.com`). + +## Data & access + +**Files** + +- In the folder MiniMax Code gives the app (`dataDir`): `state.json` (collections, projects, notes, explanations, settings; written atomically, and a damaged file is set aside as `state.json.corrupt-