@muggleai/works 4.7.0 → 4.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/dist/{chunk-HDEZDEM6.js → chunk-44I5ROCB.js} +48 -17
- package/dist/{chunk-SMRMPHDD.js → chunk-OMLNCNSZ.js} +60 -27
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/README.md +1 -1
- package/dist/plugin/skills/muggle-test/SKILL.md +13 -1
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +13 -2
- package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +14 -21
- package/dist/plugin/skills/muggle-upgrade/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-works-npm-release/SKILL.md +198 -0
- package/dist/release-manifest.json +4 -4
- package/dist/{src-TX2KXI26.js → src-ZRUONWKV.js} +1 -1
- package/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/README.md +1 -1
- package/plugin/skills/muggle-test/SKILL.md +13 -1
- package/plugin/skills/muggle-test-feature-local/SKILL.md +13 -2
- package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +14 -21
- package/plugin/skills/muggle-upgrade/SKILL.md +1 -1
- package/plugin/skills/muggle-works-npm-release/SKILL.md +198 -0
- package/scripts/postinstall.mjs +45 -0
package/scripts/postinstall.mjs
CHANGED
|
@@ -754,8 +754,53 @@ async function extractTarGz(tarPath, destDir) {
|
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
+
/**
|
|
758
|
+
* Upsert the muggle MCP server entry into ~/.cursor/mcp.json.
|
|
759
|
+
* Reads the existing config, merges in the muggle server, and writes back.
|
|
760
|
+
* Preserves any other MCP servers the user has configured.
|
|
761
|
+
*/
|
|
762
|
+
function upsertCursorMcpConfig() {
|
|
763
|
+
const cursorMcpConfigPath = join(homedir(), ".cursor", "mcp.json");
|
|
764
|
+
const cursorDir = join(homedir(), ".cursor");
|
|
765
|
+
|
|
766
|
+
/** @type {{ mcpServers?: Record<string, unknown> }} */
|
|
767
|
+
let config = {};
|
|
768
|
+
|
|
769
|
+
if (existsSync(cursorMcpConfigPath)) {
|
|
770
|
+
try {
|
|
771
|
+
const raw = readFileSync(cursorMcpConfigPath, "utf-8");
|
|
772
|
+
const parsed = JSON.parse(raw);
|
|
773
|
+
|
|
774
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
775
|
+
log(`Warning: ~/.cursor/mcp.json has unexpected shape, skipping MCP config upsert.`);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
config = parsed;
|
|
780
|
+
} catch (error) {
|
|
781
|
+
log(`Warning: ~/.cursor/mcp.json is invalid JSON, skipping MCP config upsert.`);
|
|
782
|
+
log(` Parse error: ${error.message}`);
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
if (!config.mcpServers) {
|
|
788
|
+
config.mcpServers = {};
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
config.mcpServers.muggle = {
|
|
792
|
+
command: "muggle",
|
|
793
|
+
args: ["serve"],
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
mkdirSync(cursorDir, { recursive: true });
|
|
797
|
+
writeFileSync(cursorMcpConfigPath, `${JSON.stringify(config, null, 2)}\n`, "utf-8");
|
|
798
|
+
log(`Cursor MCP config updated at ${cursorMcpConfigPath}`);
|
|
799
|
+
}
|
|
800
|
+
|
|
757
801
|
// Run postinstall
|
|
758
802
|
initLogFile();
|
|
759
803
|
removeVersionOverrideFile();
|
|
760
804
|
syncCursorSkills();
|
|
805
|
+
upsertCursorMcpConfig();
|
|
761
806
|
downloadElectronApp().catch(logError);
|