eon-memory 1.1.0 → 1.2.1

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 (49) hide show
  1. package/package.json +11 -3
  2. package/src/init.js +197 -12
  3. package/src/tier_map.json +97 -0
  4. package/templates/agents/alignment-validator.md +181 -0
  5. package/templates/agents/analytics-agent.md +93 -0
  6. package/templates/agents/code-simplifier.md +75 -0
  7. package/templates/agents/code-verifier.md +81 -0
  8. package/templates/agents/communication-agent.md +100 -0
  9. package/templates/agents/deployment-manager.md +103 -0
  10. package/templates/agents/incident-responder.md +116 -0
  11. package/templates/agents/local-llm.md +109 -0
  12. package/templates/agents/market-analyst.md +86 -0
  13. package/templates/agents/opportunity-scout.md +103 -0
  14. package/templates/agents/orchestrator.md +91 -0
  15. package/templates/agents/reflection-engine.md +157 -0
  16. package/templates/agents/research-agent.md +76 -0
  17. package/templates/agents/security-scanner.md +94 -0
  18. package/templates/agents/system-monitor.md +113 -0
  19. package/templates/agents/web-designer.md +110 -0
  20. package/templates/hooks/.omc/state/agent-replay-24ba3c54-a19a-4384-85b9-5c509ae41c2c.jsonl +1 -0
  21. package/templates/hooks/.omc/state/idle-notif-cooldown.json +3 -0
  22. package/templates/hooks/.omc/state/subagent-tracking.json +7 -0
  23. package/templates/hooks/__pycache__/agent_trigger.cpython-312.pyc +0 -0
  24. package/templates/hooks/__pycache__/cwd_context_switch.cpython-312.pyc +0 -0
  25. package/templates/hooks/__pycache__/eon_client.cpython-312.pyc +0 -0
  26. package/templates/hooks/__pycache__/eon_memory_search.cpython-312.pyc +0 -0
  27. package/templates/hooks/__pycache__/hook_utils.cpython-312.pyc +0 -0
  28. package/templates/hooks/__pycache__/memory_quality_gate.cpython-312.pyc +0 -0
  29. package/templates/hooks/__pycache__/post_code_check.cpython-312.pyc +0 -0
  30. package/templates/hooks/__pycache__/post_compact_reload.cpython-312.pyc +0 -0
  31. package/templates/hooks/__pycache__/session_end_save.cpython-312.pyc +0 -0
  32. package/templates/hooks/__pycache__/smart_permissions.cpython-312.pyc +0 -0
  33. package/templates/hooks/__pycache__/stop_failure_recovery.cpython-312.pyc +0 -0
  34. package/templates/hooks/agent_trigger.py +220 -0
  35. package/templates/hooks/cwd_context_switch.py +94 -0
  36. package/templates/hooks/eon_client.py +565 -0
  37. package/templates/hooks/eon_memory_search.py +147 -0
  38. package/templates/hooks/hook_utils.py +96 -0
  39. package/templates/hooks/memory_quality_gate.py +97 -0
  40. package/templates/hooks/post_code_check.py +179 -0
  41. package/templates/hooks/post_compact_reload.py +59 -0
  42. package/templates/hooks/session_end_save.py +91 -0
  43. package/templates/hooks/smart_permissions.py +85 -0
  44. package/templates/hooks/stop_failure_recovery.py +57 -0
  45. package/templates/skills/goal-tracker.md +42 -0
  46. package/templates/skills/health-check.md +50 -0
  47. package/templates/skills/memory-audit.md +54 -0
  48. package/templates/skills/self-improvement-loop.md +60 -0
  49. package/templates/skills/x-alignment-check.md +68 -0
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: web-designer
3
+ description: Web and app design agent - professional UI/UX with MCP design tools and Playwright. Use for components, layouts, and design systems.
4
+ tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch
5
+ model: sonnet
6
+ ---
7
+
8
+ # Web Designer
9
+
10
+ You are a **web design agent**. Your purpose is to create professional, accessible, and performant web designs using available MCP design tools.
11
+
12
+ **Core Principles:**
13
+ 1. Design serves the user - never self-serving aesthetics
14
+ 2. Every decision must be justifiable - never "because it looks cool"
15
+ 3. Accessibility is not optional
16
+ 4. Store design decisions in memory for consistency
17
+
18
+ ---
19
+
20
+ ## Pre-Check: Load Context
21
+
22
+ Before designing, load design context:
23
+
24
+ ```
25
+ Use eon_search tool: query="<YOUR_TOPIC> design ui", n_results=5
26
+ ```
27
+
28
+ Only once you have context: design. Never work without knowing existing styles.
29
+
30
+ ---
31
+
32
+ ## MCP Tools (Design Servers + Playwright)
33
+
34
+ Use `ToolSearch` to load these tools before using them:
35
+
36
+ | Server | Tool Prefix | Use For |
37
+ |--------|-------------|---------|
38
+ | **ui-ux-pro** | `mcp__ui-ux-pro__*` | Design system, palettes, fonts, UX guidelines, landing patterns |
39
+ | **21st-dev-magic** | `mcp__21st-dev-magic__*` | Generate React/TSX components from descriptions |
40
+ | **nano-banana** | `mcp__nano-banana__*` | Generate/edit images, logos, mockups via AI |
41
+ | **stitch** | `mcp__stitch__*` | Design full pages/screens, extract design DNA |
42
+ | **figma** | `mcp__figma__*` | Read Figma designs, generate code, get design tokens |
43
+ | **playwright** | `mcp__playwright__*` | Live preview, screenshots, UI testing, visual QA |
44
+ | **context7** | `mcp__context7__*` | Framework docs (React, Next.js, Tailwind, etc.) |
45
+
46
+ **IMPORTANT:** Before using any MCP tool, ALWAYS call `ToolSearch` first to load it!
47
+
48
+ ---
49
+
50
+ ## Design Workflow
51
+
52
+ ### Phase 1: Requirements & Design System (UX Pro)
53
+ 1. "What are we building? For whom? What vibe?"
54
+ 2. Use `ui-ux-pro` for styles, palettes, fonts
55
+ 3. Create a coherent design system matching the project type
56
+
57
+ ### Phase 2: Components (21st.dev Magic)
58
+ 1. Generate React/TSX components with `21st-dev-magic`
59
+ 2. TypeScript-safe and responsive
60
+ 3. Apply design system from Phase 1
61
+
62
+ ### Phase 3: Visual Assets (Nano Banana)
63
+ 1. Generate images, icons, illustrations
64
+ 2. Iterate with `continue_editing` for perfection
65
+ 3. Match assets to design system
66
+
67
+ ### Phase 4: Page Design (Stitch / Figma)
68
+ 1. `stitch` for complete page layouts
69
+ 2. Or import from `figma`
70
+ 3. Extract design DNA for consistent implementation
71
+
72
+ ### Phase 5: Implementation
73
+ 1. Framework docs via `context7` (Next.js, Tailwind, etc.)
74
+ 2. Implement based on generated designs
75
+ 3. Write code - don't just generate
76
+
77
+ ### Phase 6: Preview & QA (Playwright)
78
+ 1. Start app locally
79
+ 2. `playwright` for screenshots and visual testing
80
+ 3. Check responsive (Mobile, Tablet, Desktop)
81
+ 4. Iterate until perfect
82
+
83
+ ---
84
+
85
+ ## Design Principles
86
+
87
+ - **NEVER generic AI design** - No default Inter/Roboto, no purple gradients
88
+ - **Be BOLD** - Choose a clear aesthetic direction and follow through
89
+ - **Mobile-First** - Responsive from the start
90
+ - **Performance** - Lazy loading, optimized images, minimal JS
91
+ - **Accessibility** - WCAG 2.1 AA as minimum
92
+ - **Authenticity** - Real images > placeholders, real fonts > system fonts
93
+ - **Truth in form** - Design clarifies, it does not deceive
94
+
95
+ ## Saving Design Decisions
96
+
97
+ Store design decisions in memory:
98
+
99
+ ```
100
+ Use eon_create tool:
101
+ title: "Design: <PROJECT> - <DECISION>"
102
+ content: "<details about colors, fonts, layout choices, and reasoning>"
103
+ type: "semantic"
104
+ project_id: "<PROJECT_ID>"
105
+ category: "update"
106
+ ```
107
+
108
+ ---
109
+
110
+ *Form follows truth. Beauty serves the user.*
@@ -0,0 +1 @@
1
+ {"t":0,"agent":"a3e4290","agent_type":"general-purpose","event":"agent_stop","success":true}
@@ -0,0 +1,3 @@
1
+ {
2
+ "lastSentAt": "2026-04-11T08:15:41.610Z"
3
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "agents": [],
3
+ "total_spawned": 0,
4
+ "total_completed": 0,
5
+ "total_failed": 0,
6
+ "last_updated": "2026-04-11T08:12:26.411Z"
7
+ }
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ EON Agent Trigger Hook - Automatic Agent Recommendation
4
+ =========================================================
5
+ Analyzes user prompts and suggests the matching sub-agent.
6
+
7
+ Hook Type: UserPromptSubmit
8
+ Output: additionalContext with agent recommendation
9
+
10
+ Version: 1.0.0
11
+ """
12
+
13
+ import json
14
+ import re
15
+ import sys
16
+
17
+ # Agent-Trigger Mapping: agent_name -> {keywords, description}
18
+ AGENT_TRIGGERS = {
19
+ "alignment-validator": {
20
+ "keywords": [
21
+ "alignment check", "x-alignment", "coherence check",
22
+ "logic check", "consistency", "validate alignment",
23
+ "roadmap complete", "milestone reached", "phase complete",
24
+ ],
25
+ "description": "Logic and alignment validation after substantial work",
26
+ },
27
+ "incident-responder": {
28
+ "keywords": [
29
+ "error", "crash", "broken", "not working",
30
+ "bug", "exception", "traceback", "failed",
31
+ "service down", "unreachable", "timeout",
32
+ ],
33
+ "description": "Error analysis and automatic repair",
34
+ },
35
+ "deployment-manager": {
36
+ "keywords": [
37
+ "deploy", "git push", "docker", "release",
38
+ "go live", "upload", "rollout", "ci/cd", "pipeline",
39
+ ],
40
+ "description": "Git workflows, Docker, deployments",
41
+ },
42
+ "system-monitor": {
43
+ "keywords": [
44
+ "status", "health", "check server", "ports",
45
+ "resources", "cpu", "ram", "disk", "systemctl",
46
+ ],
47
+ "description": "Health checks, system diagnostics",
48
+ },
49
+ "market-analyst": {
50
+ "keywords": [
51
+ "trade", "market", "portfolio", "crypto", "price",
52
+ "buy", "sell", "btc", "eth", "sol", "chart",
53
+ "bitcoin", "ethereum",
54
+ ],
55
+ "description": "Market analysis, trading signals, portfolio",
56
+ },
57
+ "communication-agent": {
58
+ "keywords": [
59
+ "telegram", "email", "send message", "notification",
60
+ "send notification", "inbox",
61
+ ],
62
+ "description": "Telegram/email messaging",
63
+ },
64
+ "research-agent": {
65
+ "keywords": [
66
+ "research", "search the web", "find out",
67
+ "gather information", "what is", "latest", "current",
68
+ ],
69
+ "description": "Web research, data gathering",
70
+ },
71
+ "code-verifier": {
72
+ "keywords": [
73
+ "test", "verify", "check if it works",
74
+ "quality", "unit test", "integration test",
75
+ ],
76
+ "description": "Code verification and testing",
77
+ },
78
+ "security-scanner": {
79
+ "keywords": [
80
+ "security", "injection", "xss",
81
+ "vulnerability", "audit", "hacked", "insecure",
82
+ ],
83
+ "description": "Security analysis",
84
+ },
85
+ "code-simplifier": {
86
+ "keywords": [
87
+ "simplify", "clean up", "refactor",
88
+ "code quality", "readability", "maintainable",
89
+ "complicated", "spaghetti",
90
+ ],
91
+ "description": "Code simplification and cleanup",
92
+ },
93
+ "analytics-agent": {
94
+ "keywords": [
95
+ "report", "statistics", "analysis",
96
+ "metrics", "dashboard", "evaluation", "numbers",
97
+ "data analysis", "trend", "overview",
98
+ ],
99
+ "description": "Data analysis, reports, statistics",
100
+ },
101
+ "orchestrator": {
102
+ "keywords": [
103
+ "orchestrate", "coordinate", "multi-step",
104
+ "complex task", "goal management", "goal",
105
+ "plan and execute", "multiple steps",
106
+ ],
107
+ "description": "Complex multi-step tasks, goal management",
108
+ },
109
+ "opportunity-scout": {
110
+ "keywords": [
111
+ "earn money", "freelance", "job", "opportunity",
112
+ "revenue", "monetization", "upwork", "fiverr",
113
+ "find project", "find client",
114
+ ],
115
+ "description": "Freelance jobs, monetization, revenue",
116
+ },
117
+ "local-llm": {
118
+ "keywords": [
119
+ "local llm", "ollama", "local model",
120
+ "local ai", "offline model", "llama", "mistral local",
121
+ ],
122
+ "description": "Local LLM queries via Ollama",
123
+ },
124
+ "reflection-engine": {
125
+ "keywords": [
126
+ "reflect", "self-reflection", "what did i learn",
127
+ "pattern recognition", "error pattern",
128
+ "session analysis", "improvement", "learning",
129
+ ],
130
+ "description": "Reflection, pattern recognition, learnings",
131
+ },
132
+ "web-designer": {
133
+ "keywords": [
134
+ "design", "ui design", "ux design", "create layout",
135
+ "create component", "design system",
136
+ "landing page design", "mockup", "wireframe",
137
+ "web design", "app design", "responsive design",
138
+ ],
139
+ "description": "UI/UX design and web development",
140
+ },
141
+ }
142
+
143
+ # Exclude patterns: no agent suggestion for these
144
+ EXCLUDE_PATTERNS = [
145
+ r"^(hi|hello|hey|sup|yo)\s*[!?.]?$",
146
+ r"^(thanks|ok|okay|yes|no)\s*[!?.]?$",
147
+ r"^.{0,15}$",
148
+ ]
149
+
150
+
151
+ def find_matching_agent(prompt: str) -> tuple:
152
+ """Find the matching agent for the prompt.
153
+
154
+ Returns:
155
+ (agent_type, description, matched_keyword) or (None, None, None)
156
+ """
157
+ prompt_lower = prompt.lower()
158
+
159
+ best_match = None
160
+ best_keyword = None
161
+
162
+ for agent_type, config in AGENT_TRIGGERS.items():
163
+ for keyword in config["keywords"]:
164
+ if re.search(r'\b' + re.escape(keyword) + r'\b', prompt_lower):
165
+ if best_keyword is None or len(keyword) > len(best_keyword):
166
+ best_match = agent_type
167
+ best_keyword = keyword
168
+
169
+ if best_match:
170
+ return best_match, AGENT_TRIGGERS[best_match]["description"], best_keyword
171
+ return None, None, None
172
+
173
+
174
+ def main():
175
+ try:
176
+ input_data = json.load(sys.stdin)
177
+ except Exception:
178
+ sys.exit(0)
179
+
180
+ prompt = input_data.get("prompt", "")
181
+
182
+ if not prompt or len(prompt) < 10 or len(prompt) > 10000:
183
+ sys.exit(0)
184
+
185
+ for pattern in EXCLUDE_PATTERNS:
186
+ if re.match(pattern, prompt.lower().strip(), re.IGNORECASE):
187
+ sys.exit(0)
188
+
189
+ agent_type, description, keyword = find_matching_agent(prompt)
190
+
191
+ if not agent_type:
192
+ sys.exit(0)
193
+
194
+ context = f"""
195
+ ============================================================
196
+ AGENT SUGGESTION
197
+ ============================================================
198
+
199
+ Recommended Agent: {agent_type}
200
+ Reason: Keyword "{keyword}" detected
201
+ Description: {description}
202
+
203
+ To use: Task(subagent_type="{agent_type}", prompt="...")
204
+
205
+ ============================================================
206
+ """
207
+
208
+ output = {
209
+ "hookSpecificOutput": {
210
+ "hookEventName": "UserPromptSubmit",
211
+ "additionalContext": context,
212
+ }
213
+ }
214
+
215
+ print(json.dumps(output))
216
+ sys.exit(0)
217
+
218
+
219
+ if __name__ == "__main__":
220
+ main()
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ CWD Context Switch Hook
4
+ ==========================
5
+ Automatically loads project context when the working directory changes.
6
+ Helps maintain continuity when switching between projects.
7
+
8
+ Hook Type: CwdChanged
9
+ Version: 1.0.0
10
+ """
11
+
12
+ import json
13
+ import sys
14
+ from pathlib import Path
15
+
16
+ # Add hooks directory
17
+ HOOKS_DIR = str(Path(__file__).parent)
18
+ if HOOKS_DIR not in sys.path:
19
+ sys.path.insert(0, HOOKS_DIR)
20
+
21
+
22
+ def detect_project_from_path(cwd: str) -> str:
23
+ """Detect project name from working directory path."""
24
+ path = Path(cwd)
25
+
26
+ # Check for common project indicators
27
+ for part in reversed(path.parts):
28
+ part_lower = part.lower()
29
+ # Skip generic directory names
30
+ if part_lower in {"src", "lib", "dist", "build", "node_modules",
31
+ "home", "users", "var", "tmp", "mnt"}:
32
+ continue
33
+ # Use the most specific directory name
34
+ if len(part) > 2:
35
+ return part_lower
36
+
37
+ return "default"
38
+
39
+
40
+ def main():
41
+ try:
42
+ input_data = json.load(sys.stdin)
43
+ except Exception:
44
+ sys.exit(0)
45
+
46
+ cwd = input_data.get("cwd", "")
47
+ if not cwd:
48
+ sys.exit(0)
49
+
50
+ project = detect_project_from_path(cwd)
51
+
52
+ # Try to load context from EON
53
+ context_info = ""
54
+ try:
55
+ from eon_client import get_client
56
+
57
+ client = get_client()
58
+ if client:
59
+ ctx = client.get_context(project_id=project)
60
+ recent = ctx.recent_memories
61
+ projects = ctx.projects
62
+
63
+ if recent or projects:
64
+ lines = [
65
+ f"Switched to: {cwd}",
66
+ f"Detected project: {project}",
67
+ ]
68
+ if recent:
69
+ lines.append(f"Recent memories: {len(recent)}")
70
+ for m in recent[:3]:
71
+ lines.append(f" - {m.get('title', 'Untitled')}")
72
+ if projects:
73
+ lines.append(f"Known projects: {', '.join(projects[:5])}")
74
+
75
+ context_info = "\n".join(lines)
76
+ except Exception:
77
+ pass
78
+
79
+ if not context_info:
80
+ sys.exit(0)
81
+
82
+ output = {
83
+ "hookSpecificOutput": {
84
+ "hookEventName": "CwdChanged",
85
+ "additionalContext": f"\n[EON Context] {context_info}\n",
86
+ }
87
+ }
88
+
89
+ print(json.dumps(output))
90
+ sys.exit(0)
91
+
92
+
93
+ if __name__ == "__main__":
94
+ main()