ei-tui 0.3.5 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ei-tui",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "author": "Flare576",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,7 +36,15 @@ export async function handleRewriteScan(response: LLMResponse, state: StateManag
36
36
 
37
37
  const subjects = response.parsed as RewriteScanResult | undefined;
38
38
  if (!subjects || !Array.isArray(subjects) || subjects.length === 0) {
39
- console.log(`[handleRewriteScan] No extra subjects found for ${itemType} "${itemId}" — item is cohesive`);
39
+ console.log(`[handleRewriteScan] No extra subjects found for ${itemType} "${itemId}" — marking rewrite_checked`);
40
+ const human = state.getHuman();
41
+ if (itemType === "topic") {
42
+ const topic = human.topics.find(t => t.id === itemId);
43
+ if (topic) state.human_topic_upsert({ ...topic, rewrite_checked: true });
44
+ } else if (itemType === "person") {
45
+ const person = human.people.find(p => p.id === itemId);
46
+ if (person) state.human_person_upsert({ ...person, rewrite_checked: true });
47
+ }
40
48
  return;
41
49
  }
42
50
 
@@ -246,5 +254,14 @@ export async function handleRewriteRewrite(response: LLMResponse, state: StateMa
246
254
  newCount++;
247
255
  }
248
256
 
257
+ const updatedHuman = state.getHuman();
258
+ if (itemType === "topic") {
259
+ const original = updatedHuman.topics.find(t => t.id === itemId);
260
+ if (original) state.human_topic_upsert({ ...original, rewrite_checked: true });
261
+ } else if (itemType === "person") {
262
+ const original = updatedHuman.people.find(p => p.id === itemId);
263
+ if (original) state.human_person_upsert({ ...original, rewrite_checked: true });
264
+ }
265
+
249
266
  console.log(`[handleRewriteRewrite] Complete for ${itemType} "${itemId}": ${existingCount} existing updated, ${newCount} new created`);
250
267
  }
@@ -617,12 +617,12 @@ export function queueRewritePhase(state: StateManager): void {
617
617
  const itemsToScan: Array<{ item: DataItemBase; type: RewriteItemType }> = [];
618
618
 
619
619
  for (const topic of human.topics) {
620
- if ((topic.description?.length ?? 0) > REWRITE_DESCRIPTION_THRESHOLD) {
620
+ if ((topic.description?.length ?? 0) > REWRITE_DESCRIPTION_THRESHOLD && !topic.rewrite_checked) {
621
621
  itemsToScan.push({ item: topic, type: "topic" });
622
622
  }
623
623
  }
624
624
  for (const person of human.people) {
625
- if ((person.description?.length ?? 0) > REWRITE_DESCRIPTION_THRESHOLD) {
625
+ if ((person.description?.length ?? 0) > REWRITE_DESCRIPTION_THRESHOLD && !person.rewrite_checked) {
626
626
  itemsToScan.push({ item: person, type: "person" });
627
627
  }
628
628
  }
@@ -15,6 +15,7 @@ export interface DataItemBase {
15
15
  last_changed_by?: string; // Persona ID that most recently updated this item (stable UUID)
16
16
  persona_groups?: string[];
17
17
  embedding?: number[];
18
+ rewrite_checked?: boolean; // True after rewrite scan finds no changes. Cleared automatically when extraction upserts a fresh item.
18
19
  }
19
20
 
20
21
  export interface Fact extends DataItemBase {