oh-my-adhd 0.2.4 β†’ 0.2.6

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.
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { getThreads, getThread, OPEN_SIGNAL, DONE_SIGNAL, extractFieldBrain } from "../../lib/brain.js";
2
+ import { getThreads, getThread, OPEN_SIGNAL, DONE_SIGNAL, extractFieldBrain, updateManifestEntry } from "../../lib/brain.js";
3
3
  import { runConsolidationIfDue } from "../../lib/consolidate.js";
4
4
  import { git } from "../utils.js";
5
5
  export function registerWikiRecall(server) {
@@ -72,6 +72,16 @@ export function registerWikiRecall(server) {
72
72
  const gapHours = isNaN(new Date(t.updatedAt).getTime())
73
73
  ? null
74
74
  : Math.round((Date.now() - new Date(t.updatedAt).getTime()) / 3600000);
75
+ // Back-fill manifest cache so stop hook sees correct is_open next time
76
+ updateManifestEntry(t.id, {
77
+ is_open,
78
+ is_done: isDone,
79
+ capture_count,
80
+ last_action: last_action.slice(0, 160),
81
+ next_action: next_action || undefined,
82
+ blocker: blocker || undefined,
83
+ title,
84
+ }).catch(() => { });
75
85
  return {
76
86
  threadId: t.id,
77
87
  title,
@@ -136,8 +146,16 @@ export function registerWikiRecall(server) {
136
146
  // Lead entry β€” the most important thread, formatted as a direct question
137
147
  const top = sorted[0];
138
148
  const others = sorted.slice(1);
149
+ // Stale-open threads: split by depth of abandonment
150
+ const GHOST_THRESHOLD_H = 336; // 2 weeks
151
+ const topIsGhost = top.is_open && top.status === "stale" && (top.gap_hours ?? 0) >= GHOST_THRESHOLD_H;
139
152
  // Lead section header
140
- if (top.is_open) {
153
+ if (topIsGhost) {
154
+ lines.push("## πŸ’€ 아직도 ν•  κ±°μ•Ό?\n");
155
+ const weeks = top.gap_hours !== null ? Math.floor(top.gap_hours / 168) : null;
156
+ lines.push(`_${weeks ? `${weeks}μ£Ό` : "μ˜€λž«λ™μ•ˆ"} λͺ» λ΄€μ–΄. 계속할 건지, 정리할 건지 κ²°μ •ν•΄μ€˜._\n`);
157
+ }
158
+ else if (top.is_open) {
141
159
  lines.push("## μ–΄μ œ 멈좘 κ³³\n");
142
160
  }
143
161
  else {
@@ -154,20 +172,40 @@ export function registerWikiRecall(server) {
154
172
  if (top.blocker)
155
173
  lines.push(`> β›” λ§‰νžŒκ²ƒ: ${top.blocker}`);
156
174
  // Call to action
157
- if (top.is_open) {
158
- lines.push(`>`);
175
+ lines.push(`>`);
176
+ if (topIsGhost) {
177
+ lines.push(`> β†’ μ΄μ–΄μ„œ? \`wiki_dump({ threadId: "${top.threadId}", content: "계속" })\``);
178
+ lines.push(`> β†’ 정리? \`wiki_dump({ threadId: "${top.threadId}", content: "κ²°μ •: 이 ν”„λ‘œμ νŠΈ μ’…λ£Œ" })\``);
179
+ }
180
+ else if (top.is_open) {
159
181
  lines.push(`> μ΄μ–΄μ„œ 갈까? (thread: \`${top.threadId}\`)`);
160
182
  }
161
183
  else {
162
- lines.push(`>`);
163
184
  lines.push(`> thread: \`${top.threadId}\``);
164
185
  }
165
- // Stale-open threads the user has forgotten β€” flag them separately
166
- const forgottenThreads = others.filter(t => t.is_open && t.status === "stale");
186
+ // Stale-open threads: split by depth of abandonment
187
+ const ghostThreads = others.filter(t => t.is_open && t.status === "stale" && (t.gap_hours ?? 0) >= GHOST_THRESHOLD_H);
188
+ const forgottenThreads = others.filter(t => t.is_open && t.status === "stale" && (t.gap_hours ?? 0) < GHOST_THRESHOLD_H);
167
189
  const activeOthers = others.filter(t => !(t.is_open && t.status === "stale"));
190
+ // Ghost projects: 2+ weeks untouched β€” direct question
191
+ if (ghostThreads.length > 0) {
192
+ lines.push("\n---");
193
+ lines.push("## πŸ’€ 아직도 ν•  κ±°μ•Ό?");
194
+ lines.push(`_${Math.floor(GHOST_THRESHOLD_H / 168)}μ£Ό 이상 λͺ» λ΄€μ–΄. 계속할 건지, 정리할 건지 κ²°μ •ν•΄μ€˜._`);
195
+ for (const t of ghostThreads) {
196
+ const weeks = t.gap_hours !== null ? Math.floor(t.gap_hours / 168) : null;
197
+ const gapStr = weeks !== null ? `${weeks}μ£Ό μ „` : "";
198
+ const preview = t.next_action || t.last_action?.replace(/^(?:κ²°μ •|κ°€μ„€|λ§‰νžŒκ²ƒ|λ‹€μŒν• κ²ƒ|λΈ”λ‘œμ»€|μš”μ•½)\s*:\s*/i, "").slice(0, 80) || "";
199
+ lines.push(`πŸ’€ **${t.title}**${gapStr ? ` (${gapStr})` : ""}`);
200
+ if (preview)
201
+ lines.push(` λ§ˆμ§€λ§‰: ${preview}`);
202
+ lines.push(` β†’ μ΄μ–΄μ„œ? \`wiki_dump({ threadId: "${t.threadId}", content: "계속" })\``);
203
+ lines.push(` β†’ 정리? \`wiki_dump({ threadId: "${t.threadId}", content: "κ²°μ •: 이 ν”„λ‘œμ νŠΈ μ’…λ£Œ" })\``);
204
+ }
205
+ }
168
206
  if (forgottenThreads.length > 0) {
169
207
  lines.push("\n---");
170
- lines.push("## πŸ“Œ 잊고 있던 κ±° (μ—΄λ €μžˆλŠ”λ° μ˜€λž«λ™μ•ˆ λͺ» λ΄„)");
208
+ lines.push("## πŸ“Œ 잊고 있던 κ±°");
171
209
  for (const t of forgottenThreads) {
172
210
  const gap = gapLabel(t.gap_hours);
173
211
  const preview = t.next_action || t.last_action?.replace(/^(?:κ²°μ •|κ°€μ„€|λ§‰νžŒκ²ƒ|λ‹€μŒν• κ²ƒ|λΈ”λ‘œμ»€|μš”μ•½)\s*:\s*/i, "").slice(0, 80) || "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-adhd",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
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": {