ei-tui 0.9.3 → 0.9.4

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 (52) hide show
  1. package/package.json +4 -1
  2. package/src/README.md +1 -1
  3. package/src/core/context-utils.ts +2 -2
  4. package/src/core/handlers/heartbeat.ts +9 -1
  5. package/src/core/handlers/human-extraction.ts +4 -1
  6. package/src/core/handlers/human-matching.ts +5 -53
  7. package/src/core/handlers/index.ts +1 -51
  8. package/src/core/handlers/persona-generation.ts +1 -28
  9. package/src/core/handlers/utils.ts +2 -9
  10. package/src/core/heartbeat-manager.ts +3 -3
  11. package/src/core/message-manager.ts +6 -5
  12. package/src/core/orchestrators/ceremony.ts +4 -9
  13. package/src/core/orchestrators/extraction-chunker.ts +3 -3
  14. package/src/core/orchestrators/human-extraction.ts +17 -17
  15. package/src/core/orchestrators/index.ts +0 -1
  16. package/src/core/orchestrators/persona-topics.ts +1 -1
  17. package/src/core/orchestrators/room-extraction.ts +5 -5
  18. package/src/core/processor.ts +8 -21
  19. package/src/core/prompt-context-builder.ts +7 -6
  20. package/src/core/state/personas.ts +1 -17
  21. package/src/core/state-manager.ts +0 -66
  22. package/src/core/types/entities.ts +2 -3
  23. package/src/core/types/enums.ts +0 -2
  24. package/src/core/types/rooms.ts +1 -1
  25. package/src/integrations/claude-code/importer.ts +1 -1
  26. package/src/integrations/cursor/importer.ts +1 -1
  27. package/src/integrations/opencode/importer.ts +1 -1
  28. package/src/prompts/ceremony/index.ts +0 -10
  29. package/src/prompts/ceremony/types.ts +1 -42
  30. package/src/prompts/generation/index.ts +0 -3
  31. package/src/prompts/generation/types.ts +0 -15
  32. package/src/prompts/heartbeat/check.ts +18 -6
  33. package/src/prompts/heartbeat/types.ts +2 -1
  34. package/src/prompts/human/index.ts +0 -2
  35. package/src/prompts/human/types.ts +0 -16
  36. package/src/prompts/index.ts +0 -19
  37. package/src/prompts/reflection/index.ts +35 -5
  38. package/src/prompts/reflection/types.ts +1 -1
  39. package/src/prompts/response/index.ts +5 -0
  40. package/src/prompts/response/sections.ts +26 -0
  41. package/src/prompts/response/types.ts +3 -0
  42. package/tui/src/commands/registry.test.ts +10 -5
  43. package/tui/src/globals.d.ts +57 -0
  44. package/tui/src/util/yaml-persona.ts +8 -4
  45. package/tui/src/util/yaml-settings.ts +3 -3
  46. package/src/core/orchestrators/person-migration.ts +0 -55
  47. package/src/prompts/ceremony/description-check.ts +0 -54
  48. package/src/prompts/ceremony/expire.ts +0 -37
  49. package/src/prompts/ceremony/explore.ts +0 -77
  50. package/src/prompts/ceremony/person-migration.ts +0 -77
  51. package/src/prompts/generation/descriptions.ts +0 -91
  52. package/src/prompts/human/fact-scan.ts +0 -150
@@ -1,150 +0,0 @@
1
- import type { FactScanPromptData, PromptOutput } from "./types.js";
2
- import { formatMessagesAsPlaceholders } from "../message-utils.js";
3
-
4
- export function buildHumanFactScanPrompt(data: FactScanPromptData): PromptOutput {
5
- if (!data.persona_name) {
6
- throw new Error("buildHumanFactScanPrompt: persona_name is required");
7
- }
8
-
9
- const personaName = data.persona_name;
10
-
11
- const taskFragment = `# Task
12
-
13
- You are scanning a conversation to quickly identify what FACTS were provided or discussed by the HUMAN USER. Your ONLY job is to spot relevant FACTS - do NOT analyze them deeply. Just detect and flag.`;
14
-
15
- const specificNeedsFragment = `## Specific Needs
16
-
17
- Your job is to quickly identify:
18
- 1. Which FACTS were mentioned or relevant
19
- a. Only flag FACTS that were actually discussed, not just tangentially related
20
- b. Be CONSERVATIVE - only suggest genuinely important, long-term relevant FACTS
21
- i. Ignore: greetings, small talk, one-off mentions, jokes
22
- c. Be CLEAR - state your \`reason\` for including this FACT in the record with any evidence you used`;
23
-
24
- const guidelinesFragment = `# Guidelines
25
-
26
- 1. **Explicitness:**
27
- * **Focus only on what the user *explicitly states*.** Do not infer, assume, or guess based on context or general knowledge.
28
- * **Prioritize direct statements.** "I was born in 1985" is a fact. "I feel old now that it's 3030" isn't an explicit statement of their birth year.
29
- 2. **Objectivity and Verifiability:**
30
- * **Facts are objective and generally verifiable.** They are not subjective opinions, feelings, or temporary states.
31
- * **Focus on unchangeable or enduring attributes/events.**
32
- 3. **Specificity over Generality:**
33
- * If the user says "I live in a big city," do not extract "Location: big city." If they say "I live in New York," extract "Location: New York."
34
- 4. **Avoid Inference from Interests/Hobbies:**
35
- * If a user talks extensively about cooking, it's a Topic or Interest, not a Fact like "Job: Chef" unless they explicitly state they ARE a chef.
36
- 5. **CRITICAL - Entity Attribution:**
37
- * ONLY extract facts about THE HUMAN USER THEMSELVES, not facts about other people they mention.
38
- * **Extract**: "I was born in 1984" → User's birthday
39
- * **Extract**: "I'm a software engineer" → User's job
40
- * **DO NOT Extract**: "My wife was a theater major" → This is about the wife, NOT the user
41
- * **DO NOT Extract**: "My daughter is 10 years old" → This is about the daughter, NOT the user
42
- * **DO NOT Extract**: "My brother lives in Texas" → This is about the brother, NOT the user
43
- * If the user shares information about someone else, that belongs in PEOPLE tracking, not FACTS.`;
44
-
45
- const examplesFragment = `# Specific Examples
46
-
47
- **FACTS are:**
48
- - Biographical data (Core Identity):
49
- - type_of_fact: User's Name
50
- - First Last, Nickname, etc.
51
- - type_of_fact: Birthday
52
- - example: "July 15th, 1980"
53
- - type_of_fact: Birthplace
54
- - type_of_fact: Hometown
55
- - type_of_fact: Job
56
- - current job title, industry, or company
57
- - type_of_fact: Marital Status
58
- - married, single, divorced
59
- - type_of_fact: Gender
60
- - type_of_fact: Eye Color
61
- - type_of_fact: Hair Color
62
- - type_of_fact: Nationality/Citizenship
63
- - type_of_fact: Languages Spoken
64
- - type_of_fact: Educational Background
65
- - Other Important Dates
66
- - type_of_fact: Wedding Anniversary
67
- - type_of_fact: Job Anniversary
68
- - type_of_fact: Pet Ownership
69
- - Health & Well-being (Objective Conditions):
70
- - type_of_fact: Allergies
71
- - type_of_fact: Medical Conditions (if explicitly stated)
72
- - type_of_fact: Dietary Restrictions
73
-
74
- > NOTE: Dates themselves are not facts (e.g., "August 15th" is not a fact).
75
- > They are details OF facts (e.g., { "type_of_fact": "Birthday", "value_of_fact": "August 15th" }).
76
-
77
- **FACTS ARE NOT**
78
- - General Topic: Interests, hobbies, general subjects
79
- - These are tracked separately
80
- - Relationships: Wife, Husband, Daughter, Son, etc.
81
- - These are tracked separately
82
- - People's Names
83
- - These are tracked separately
84
- - Personas: AI personas they discuss
85
- - These are tracked separately
86
- - Characters: Fictitious entities from books, movies, stories, media, etc.
87
- - These are tracked separately`;
88
-
89
- const criticalFragment = `# CRITICAL INSTRUCTIONS
90
-
91
- ONLY ANALYZE the "Most Recent Messages" in the following conversation. The "Earlier Conversation" is provided for your context and has already been processed!
92
-
93
- The JSON format is:
94
-
95
- \`\`\`json
96
- {
97
- "facts": [
98
- {
99
- "type_of_fact": "The Fact Type from above",
100
- "value_of_fact": "The exact value of the fact",
101
- "reason": "The justification of including this specific fact"
102
- }
103
- ]
104
- }
105
- \`\`\`
106
-
107
- **Return JSON only.**`;
108
-
109
- const system = `${taskFragment}
110
-
111
- ${specificNeedsFragment}
112
-
113
- ${guidelinesFragment}
114
-
115
- ${examplesFragment}
116
-
117
- ${criticalFragment}`;
118
-
119
- const earlierSection = data.messages_context.length > 0
120
- ? `## Earlier Conversation
121
- ${formatMessagesAsPlaceholders(data.messages_context, personaName)}
122
-
123
- `
124
- : '';
125
-
126
- const recentSection = `## Most Recent Messages
127
- ${formatMessagesAsPlaceholders(data.messages_analyze, personaName)}`;
128
-
129
- const user = `# Conversation
130
- ${earlierSection}${recentSection}
131
-
132
- ---
133
-
134
- Scan the "Most Recent Messages" for FACTS about the human user.
135
-
136
- **Return JSON:**
137
- \`\`\`json
138
- {
139
- "facts": [
140
- {
141
- "type_of_fact": "The Fact Type from above",
142
- "value_of_fact": "The exact value of the fact",
143
- "reason": "The justification of including this specific fact"
144
- }
145
- ]
146
- }
147
- \`\`\``;
148
-
149
- return { system, user };
150
- }