Add antianqi/tool-map v0.2.0: persistent cross-platform tool inventory - #5
Open
antianqi wants to merge 1 commit into
Open
Add antianqi/tool-map v0.2.0: persistent cross-platform tool inventory#5antianqi wants to merge 1 commit into
antianqi wants to merge 1 commit into
Conversation
Generates a three-file catalog (tools.summary.md, tools.md, tools.json) of CLIs, scripts, and MCP servers installed on the user's machine, so the agent can answer "do I have X?", "where is Y?", "how do I run Z?" without re-scanning the filesystem every session. Plugin shape (Skill-only, zero external deps, no package.json): - skills/tool-map/SKILL.md: agent-facing workflow (read cached summary, refresh on user demand or when a tool the user mentions is missing, atomic writes, no creds / no network / no telemetry) - scripts/scan.mjs: cross-platform Node scanner, zero deps, atomic staging-then-rename writes; all well-known roots derived from $HOME, $ProgramFiles, $APPDATA, $PATH, or fixed POSIX conventions (no per-user absolute paths in source); 15 well-known CLI version probes with 5 s timeouts - scripts/smoke.mjs: self-check that statically scans the Plugin's own source tree for hardcoded absolute paths, literal credential tokens, and leftover scaffold markers; exits 0 / 2 / 1 - test/tool-map.test.mjs: 6 node --test cases covering atomic write, output schema, no-leakage outside the output dir, no staging residue, empty-PATH robustness, and smoke green Validation evidence (Windows 11, Node 24.18.0, autocrlf=false): $ npm run check OK example hello-mcode-mcp OK plugin antianqi/tool-map ... tests 6 pass 6 fail 0 $ node scripts/smoke.mjs OK scanned 2 files, 0 violations. Design compliance (per hetaoBackend review rubric on PRs MiniMax-AI#2/MiniMax-AI#3): 1. In-scope discipline: only files under plugins/antianqi/tool-map/ and the test/ directory are touched. No edits to repo-root files, no writes to ~/.minimax/, no ~/.openclaw*/ side effects. 2. Portability: scan.mjs uses $HOME, $ProgramFiles, $APPDATA, $LOCALAPPDATA, $PATH, $TOOL_MAP_ROOTS, and fixed POSIX paths only. smoke.mjs statically verifies no D:/C:/E:/ or /Users/ or /home/ literal in any .md/.mjs file. 3. Credential disclosure: README and SKILL.md each have an independent "no credentials / no network / no telemetry / no third-party services" disclosure (per round-2 review of antianqi/openclaw-acp-bridge MiniMax-AI#2). 4. Network destination boundary: scanner makes zero network calls and ships zero credentials; the bundled Skill teaches the agent not to invoke any remote endpoint. 5. Delivery model: zero `npm install` / `npm link` is required. The scanner runs as a plain `node ./scripts/scan.mjs` process with only Node built-ins. 6. Atomic / safe file operations: every output file is written via `<out>.staging-<pid>-<rand>` then `rename`. On any failure the staging file is removed and the previous catalog is untouched. 7. Lint / failure semantics: smoke.mjs exits 0 / 2 / 1; never swallows FAIL. 8. Test coverage: 6 node --test cases; smoke.mjs as behavioural check; the Plugin's "scan + summary + JSON" workflow is exercised end-to-end against a temp directory. 9. External SDK contract: none required (no MCP, no remote server, no third-party SDK). 10. Self-check coverage: smoke.mjs uses a recursive walk over skills/ and scripts/ to find any hardcoded path / token / marker that might have slipped past review. Forward compatibility with PR MiniMax-AI#4 (validator hardening, not yet merged): - No mcp.json is shipped, so cwd / env / headers hardening does not apply. The scan.mjs and SKILL.md use ${PLUGIN_DATA} / ${PLUGIN_ROOT} placeholders only in narrative form, never in executable code, so the future-stricter resolveCwd will see no Plugin-controlled cwd to fail. - SKILL.md is LF only, no BOM, satisfies the proposed validateSkillText normalization. (The merged main validator also accepts LF directly.) Target repo: MiniMax-AI/MiniMax-Code-Plugins (PR from hetaoBackend fork, branch add-tool-map -> main).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
plugins/antianqi/tool-mapv0.2.0: a Skill-only Plugin that generates and refreshes a persistent, cross-platform inventory of the CLI tools, scripts, and MCP servers installed on the user's machine, so the agent can answer "do I have X?", "where is Y?", "how do I run Z?" without re-scanning the filesystem every session.The catalog is written as three files (lightweight summary, full markdown, machine JSON) into the Plugin data directory, exposed to the agent as
${PLUGIN_DATA}. Subsequent turns read the cached summary; refresh only on user demand, when a tool the user mentions is missing, or when acommand not foundis reported in the same session.What's inside
plugin.json--$schema=agent-plugins.org/schemas/1.0.0/plugin.schema.json, name=tool-map, version=0.2.0, license=Apache-2.0README.md-- overview, Supported platforms table, four independent "no credentials / no network / no telemetry / no third-party services" disclosures, limitations, test evidenceLICENSE-- Apache-2.0 (full text, LF only, no BOM)skills/tool-map/SKILL.md-- agent-facing workflow: read cached summary, refresh rules, failure modes, cross-platform roots (frontmatter present, LF only)scripts/scan.mjs-- cross-platform Node scanner, zero external deps, atomic staging-then-rename writes; all well-known roots derived from$HOME,$ProgramFiles,$APPDATA,$LOCALAPPDATA,$PATH,$TOOL_MAP_ROOTS, or fixed POSIX conventions (no per-user absolute paths in source); 15 well-known CLI version probes with 5 s timeoutsscripts/smoke.mjs-- self-check that statically scans the Plugin's own source tree for hardcoded absolute paths, literal credential tokens, and leftover scaffold markers; exits0(clean) /2(violation) /1(internal)test/tool-map.test.mjs-- 6node --testcases covering atomic write, output schema, no-leakage outside the output dir, no staging residue, empty-PATH robustness, and smoke green (auto-discovered by the repo'snpm test)Validation
(One pre-existing test failure on Windows is unrelated to this Plugin:
test/hosted-plugins.test.mjs:15hard-codes the regex/plugins\/alice\/hello-world/uagainst stdout fromcreate-plugin.mjs, which produces backslash-separated paths on Windows. The repo's CI runs on Linux and the test passes there.)Design compliance (per hetaoBackend review rubric on PRs #2/#3)
plugins/<owner>/<name>/plugins/antianqi/tool-map/*andtest/tool-map.test.mjsare added; no edits to repo-root files, no writes to~/.minimax/, no~/.openclaw*/side effects.scan.mjsuses$HOME,$ProgramFiles,$APPDATA,$LOCALAPPDATA,$PATH,$TOOL_MAP_ROOTS, and fixed POSIX paths.smoke.mjsstatically verifies noD:\/C:\/E:\//Users///home/literal in any.md/.mjsfile.~/.ssh/.nodeprocess only.npm install/npm linkis required. The scanner runs as a plainnode ./scripts/scan.mjswith only Node built-ins.<out>.staging-<pid>-<rand>thenrename. On any failure the staging file is removed and the previous catalog is untouched.smoke.mjsexits0(clean) /2(violation) /1(internal); never swallows FAIL.node --testcases plus a behavioural smoke check; the scan + summary + JSON workflow is exercised end-to-end against a temp directory.smoke.mjswalksskills/andscripts/recursively and flags any hardcoded path / literal token / scaffold marker.Forward compatibility with PR #4 (validator hardening, not yet merged)
mcp.jsonis shipped, so the proposedcwd/env/headershardening does not apply. The${PLUGIN_DATA}and${PLUGIN_ROOT}placeholders appear in narrative text only, never in executablecwdvalues.SKILL.mdis LF-only with no UTF-8 BOM, satisfying the proposedvalidateSkillTextnormalization rule.Compatibility
%ProgramFiles%,%APPDATA%,%LOCALAPPDATA%resolved from environment.~/.local/bin,/usr/local/bin,/opt/homebrew/binwalked.~/.local/bin,~/.local/share/npm/bin,/usr/local/binwalked.Links
add-tool-maponantianqi/MiniMax-Code-Plugins-1antianqi:add-tool-map->MiniMax-AI:mainNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.