oh-my-adhd 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/bin/oh-my-adhd.mjs +17 -20
  2. package/package.json +1 -1
@@ -95,31 +95,28 @@ switch (cmd) {
95
95
 
96
96
  settings.hooks = settings.hooks || {};
97
97
 
98
- // SessionStart: wiki_recall (mcp_tool actually fires the tool, not just echo)
98
+ // SessionStart: write session-start timestamp for Stop hook
99
+ // (wiki_recall is invoked by CLAUDE.md instruction, not a hook — avoids chicken-and-egg MCP startup error)
99
100
  settings.hooks.SessionStart = settings.hooks.SessionStart || [];
100
- const alreadyHasRecall = settings.hooks.SessionStart.some((entry) =>
101
+
102
+ // Remove legacy mcp_tool wiki_recall hooks (they caused "SessionStart:startup hook error")
103
+ settings.hooks.SessionStart = settings.hooks.SessionStart.map((entry) => {
104
+ if (!Array.isArray(entry.hooks)) return entry;
105
+ const filtered = entry.hooks.filter(
106
+ (h) => !(h.type === "mcp_tool" && h.server === "oh-my-adhd" && h.tool === "wiki_recall")
107
+ );
108
+ return filtered.length === 0 ? null : { ...entry, hooks: filtered };
109
+ }).filter(Boolean);
110
+
111
+ const timestampCmd = `node -e "const{writeFileSync,mkdirSync}=require('fs'),{join}=require('path'),{homedir}=require('os');const d=process.env.OH_MY_ADHD_DIR||join(homedir(),'.oh-my-adhd');try{mkdirSync(d,{recursive:true})}catch{}writeFileSync(join(d,'.session-start'),String(Date.now()))"`;
112
+ const alreadyHasTimestamp = settings.hooks.SessionStart.some((entry) =>
101
113
  Array.isArray(entry.hooks) && entry.hooks.some(
102
- (h) => h.type === "mcp_tool" && h.server === "oh-my-adhd" && h.tool === "wiki_recall"
114
+ (h) => h.type === "command" && h.command?.includes(".session-start")
103
115
  )
104
116
  );
105
- if (!alreadyHasRecall) {
117
+ if (!alreadyHasTimestamp) {
106
118
  settings.hooks.SessionStart.push({
107
- hooks: [
108
- {
109
- type: "mcp_tool",
110
- server: "oh-my-adhd",
111
- tool: "wiki_recall",
112
- input: { limit: 5 },
113
- statusMessage: "어제 어디까지 했더라...",
114
- timeout: 15,
115
- },
116
- {
117
- type: "command",
118
- // Write session-start timestamp so Stop hook knows if a dump happened this session
119
- command: `node -e "const{writeFileSync,mkdirSync}=require('fs'),{join}=require('path'),{homedir}=require('os');const d=process.env.OH_MY_ADHD_DIR||join(homedir(),'.oh-my-adhd');try{mkdirSync(d,{recursive:true})}catch{}writeFileSync(join(d,'.session-start'),String(Date.now()))"`,
120
- timeout: 5,
121
- },
122
- ],
119
+ hooks: [{ type: "command", command: timestampCmd, timeout: 5 }],
123
120
  });
124
121
  }
125
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-adhd",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "ADHD second brain — zero-friction capture, auto context restore, unstick. MCP-native Claude Code plugin.",
5
5
  "author": "Yeachan Heo",
6
6
  "repository": {