oh-my-adhd 0.2.5 β 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 (
|
|
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,16 +172,18 @@ export function registerWikiRecall(server) {
|
|
|
154
172
|
if (top.blocker)
|
|
155
173
|
lines.push(`> β λ§νκ²: ${top.blocker}`);
|
|
156
174
|
// Call to action
|
|
157
|
-
|
|
158
|
-
|
|
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
186
|
// Stale-open threads: split by depth of abandonment
|
|
166
|
-
const GHOST_THRESHOLD_H = 336; // 2 weeks β "μ§μ§ μνμ§ κ²"
|
|
167
187
|
const ghostThreads = others.filter(t => t.is_open && t.status === "stale" && (t.gap_hours ?? 0) >= GHOST_THRESHOLD_H);
|
|
168
188
|
const forgottenThreads = others.filter(t => t.is_open && t.status === "stale" && (t.gap_hours ?? 0) < GHOST_THRESHOLD_H);
|
|
169
189
|
const activeOthers = others.filter(t => !(t.is_open && t.status === "stale"));
|
package/package.json
CHANGED