fathom-mcp 0.4.6 → 0.4.7
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/package.json +1 -1
- package/src/cli.js +28 -0
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -784,6 +784,29 @@ async function runUpdate() {
|
|
|
784
784
|
fs.mkdirSync(fathomDir, { recursive: true });
|
|
785
785
|
fs.writeFileSync(path.join(fathomDir, "version"), packageVersion + "\n");
|
|
786
786
|
|
|
787
|
+
// Ensure SessionStart hook is registered for Claude Code workspaces
|
|
788
|
+
const agents = found.config.agents || [];
|
|
789
|
+
const hasClaude = agents.includes("claude-code");
|
|
790
|
+
let hooksUpdated = false;
|
|
791
|
+
if (hasClaude) {
|
|
792
|
+
const claudeSettingsPath = path.join(projectDir, ".claude", "settings.local.json");
|
|
793
|
+
const claudeSettings = readJsonFile(claudeSettingsPath) || {};
|
|
794
|
+
const sessionStartCmd = "bash .fathom/scripts/fathom-sessionstart.sh";
|
|
795
|
+
const existingHooks = claudeSettings.hooks?.["SessionStart"] || [];
|
|
796
|
+
const hasSessionStart = existingHooks.some((entry) =>
|
|
797
|
+
entry.hooks?.some((h) => h.command === sessionStartCmd)
|
|
798
|
+
);
|
|
799
|
+
if (!hasSessionStart) {
|
|
800
|
+
claudeSettings.hooks = claudeSettings.hooks || {};
|
|
801
|
+
claudeSettings.hooks["SessionStart"] = [
|
|
802
|
+
...existingHooks,
|
|
803
|
+
{ hooks: [{ type: "command", command: sessionStartCmd, timeout: 10000 }] },
|
|
804
|
+
];
|
|
805
|
+
writeJsonFile(claudeSettingsPath, claudeSettings);
|
|
806
|
+
hooksUpdated = true;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
787
810
|
console.log(`\n ✓ Fathom hooks updated to v${packageVersion}\n`);
|
|
788
811
|
|
|
789
812
|
if (copiedScripts.length > 0) {
|
|
@@ -793,6 +816,11 @@ async function runUpdate() {
|
|
|
793
816
|
}
|
|
794
817
|
}
|
|
795
818
|
|
|
819
|
+
if (hooksUpdated) {
|
|
820
|
+
console.log("\n Registered hooks:");
|
|
821
|
+
console.log(" SessionStart → fathom-sessionstart.sh (version check)");
|
|
822
|
+
}
|
|
823
|
+
|
|
796
824
|
console.log(`\n Version written to .fathom/version`);
|
|
797
825
|
console.log(" Restart your agent session to pick up changes.\n");
|
|
798
826
|
}
|