chron-mcp 0.1.11 → 0.1.12

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/dist/index.js CHANGED
@@ -39,7 +39,7 @@ const os_1 = require("os");
39
39
  const path_1 = require("path");
40
40
  const index_1 = require("./db/index");
41
41
  const server_1 = require("./server");
42
- const VERSION = '0.1.11';
42
+ const VERSION = '0.1.12';
43
43
  // --version: quick install check, safe to run anywhere
44
44
  if (process.argv[2] === '--version' || process.argv[2] === '-v') {
45
45
  process.stdout.write(`chron-mcp ${VERSION}\n`);
package/dist/setup.js CHANGED
@@ -73,11 +73,37 @@ function configureClaudeCode() {
73
73
  // Try `claude mcp add` first — it's the official way
74
74
  try {
75
75
  (0, child_process_1.execSync)('claude mcp add chron -- npx -y chron-mcp', { stdio: 'pipe' });
76
- return { tool: 'Claude Code', status: 'added' };
77
76
  }
78
77
  catch {
79
78
  // Fall back to writing settings.json directly
80
- return configureTool('Claude Code', (0, path_1.join)((0, os_1.homedir)(), '.claude', 'settings.json'));
79
+ const result = configureTool('Claude Code', (0, path_1.join)((0, os_1.homedir)(), '.claude', 'settings.json'));
80
+ if (result.status === 'error')
81
+ return result;
82
+ }
83
+ // Also install the SessionStart hook so Claude auto-logs without manual tool calls
84
+ installClaudeCodeHook();
85
+ return { tool: 'Claude Code', status: 'added' };
86
+ }
87
+ function installClaudeCodeHook() {
88
+ // Copy skill file to ~/.chron/ so the hook can cat it
89
+ const skillSrc = (0, path_1.join)(__dirname, '..', 'skills', 'chron.skill.md');
90
+ const skillDst = (0, path_1.join)((0, os_1.homedir)(), '.chron', 'chron.skill.md');
91
+ if ((0, fs_1.existsSync)(skillSrc)) {
92
+ (0, fs_1.mkdirSync)((0, path_1.dirname)(skillDst), { recursive: true });
93
+ (0, fs_1.copyFileSync)(skillSrc, skillDst);
94
+ }
95
+ const settingsPath = (0, path_1.join)((0, os_1.homedir)(), '.claude', 'settings.json');
96
+ const settings = readJson(settingsPath);
97
+ if (!settings.hooks)
98
+ settings.hooks = {};
99
+ if (!settings.hooks.SessionStart)
100
+ settings.hooks.SessionStart = [];
101
+ const alreadyInstalled = settings.hooks.SessionStart.some((h) => Array.isArray(h.hooks) && h.hooks.some((c) => c.command?.includes('chron')));
102
+ if (!alreadyInstalled) {
103
+ settings.hooks.SessionStart.push({
104
+ hooks: [{ type: 'command', command: 'cat ~/.chron/chron.skill.md' }],
105
+ });
106
+ writeJson(settingsPath, settings);
81
107
  }
82
108
  }
83
109
  async function runSetup() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chron-mcp",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "mcpName": "io.github.SirinivasK/chron",
5
5
  "description": "Audit-grade timestamped logs for every AI conversation",
6
6
  "repository": {