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