eon-memory 1.2.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 (47) hide show
  1. package/package.json +3 -2
  2. package/templates/agents/alignment-validator.md +181 -0
  3. package/templates/agents/analytics-agent.md +93 -0
  4. package/templates/agents/code-simplifier.md +75 -0
  5. package/templates/agents/code-verifier.md +81 -0
  6. package/templates/agents/communication-agent.md +100 -0
  7. package/templates/agents/deployment-manager.md +103 -0
  8. package/templates/agents/incident-responder.md +116 -0
  9. package/templates/agents/local-llm.md +109 -0
  10. package/templates/agents/market-analyst.md +86 -0
  11. package/templates/agents/opportunity-scout.md +103 -0
  12. package/templates/agents/orchestrator.md +91 -0
  13. package/templates/agents/reflection-engine.md +157 -0
  14. package/templates/agents/research-agent.md +76 -0
  15. package/templates/agents/security-scanner.md +94 -0
  16. package/templates/agents/system-monitor.md +113 -0
  17. package/templates/agents/web-designer.md +110 -0
  18. package/templates/hooks/.omc/state/agent-replay-24ba3c54-a19a-4384-85b9-5c509ae41c2c.jsonl +1 -0
  19. package/templates/hooks/.omc/state/idle-notif-cooldown.json +3 -0
  20. package/templates/hooks/.omc/state/subagent-tracking.json +7 -0
  21. package/templates/hooks/__pycache__/agent_trigger.cpython-312.pyc +0 -0
  22. package/templates/hooks/__pycache__/cwd_context_switch.cpython-312.pyc +0 -0
  23. package/templates/hooks/__pycache__/eon_client.cpython-312.pyc +0 -0
  24. package/templates/hooks/__pycache__/eon_memory_search.cpython-312.pyc +0 -0
  25. package/templates/hooks/__pycache__/hook_utils.cpython-312.pyc +0 -0
  26. package/templates/hooks/__pycache__/memory_quality_gate.cpython-312.pyc +0 -0
  27. package/templates/hooks/__pycache__/post_code_check.cpython-312.pyc +0 -0
  28. package/templates/hooks/__pycache__/post_compact_reload.cpython-312.pyc +0 -0
  29. package/templates/hooks/__pycache__/session_end_save.cpython-312.pyc +0 -0
  30. package/templates/hooks/__pycache__/smart_permissions.cpython-312.pyc +0 -0
  31. package/templates/hooks/__pycache__/stop_failure_recovery.cpython-312.pyc +0 -0
  32. package/templates/hooks/agent_trigger.py +220 -0
  33. package/templates/hooks/cwd_context_switch.py +94 -0
  34. package/templates/hooks/eon_client.py +565 -0
  35. package/templates/hooks/eon_memory_search.py +147 -0
  36. package/templates/hooks/hook_utils.py +96 -0
  37. package/templates/hooks/memory_quality_gate.py +97 -0
  38. package/templates/hooks/post_code_check.py +179 -0
  39. package/templates/hooks/post_compact_reload.py +59 -0
  40. package/templates/hooks/session_end_save.py +91 -0
  41. package/templates/hooks/smart_permissions.py +85 -0
  42. package/templates/hooks/stop_failure_recovery.py +57 -0
  43. package/templates/skills/goal-tracker.md +42 -0
  44. package/templates/skills/health-check.md +50 -0
  45. package/templates/skills/memory-audit.md +54 -0
  46. package/templates/skills/self-improvement-loop.md +60 -0
  47. package/templates/skills/x-alignment-check.md +68 -0
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Smart Permissions Hook
4
+ ========================
5
+ Dynamic permission management for Claude Code tools.
6
+ Read operations are always allowed; write/destructive operations
7
+ require explicit context-aware approval.
8
+
9
+ Hook Type: PreToolUse
10
+ Version: 1.0.0
11
+ """
12
+
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ # Tools that are always allowed (read-only)
18
+ ALWAYS_ALLOW = {
19
+ "Read", "Glob", "Grep", "WebFetch", "WebSearch",
20
+ "Agent", "Skill", "ToolSearch",
21
+ "TaskCreate", "TaskUpdate", "TaskGet", "TaskList",
22
+ "SendMessage", "EnterPlanMode", "ExitPlanMode",
23
+ }
24
+
25
+ # MCP tools that are always allowed
26
+ ALWAYS_ALLOW_MCP_PATTERNS = [
27
+ "eon_search", "eon_list", "eon_get", "eon_health",
28
+ "eon_stats", "eon_similar", "eon_projects",
29
+ "eon_goals_list", "eon_session_start",
30
+ ]
31
+
32
+ # Bash commands that are always allowed (read-only)
33
+ SAFE_BASH_PATTERNS = [
34
+ "ls ", "pwd", "echo ", "cat ", "head ", "tail ",
35
+ "git status", "git log", "git diff", "git branch",
36
+ "python -m py_compile", "python3 -m py_compile",
37
+ "pytest", "npm test", "tsc --noEmit",
38
+ "docker ps", "docker logs",
39
+ "curl ", "wget ",
40
+ ]
41
+
42
+
43
+ def main():
44
+ try:
45
+ input_data = json.load(sys.stdin)
46
+ except Exception:
47
+ sys.exit(0)
48
+
49
+ tool_name = input_data.get("tool_name", "")
50
+ tool_input = input_data.get("tool_input", {})
51
+
52
+ # Always-allow tools
53
+ if tool_name in ALWAYS_ALLOW:
54
+ sys.exit(0)
55
+
56
+ # MCP tools - check patterns
57
+ if tool_name.startswith("mcp__"):
58
+ for pattern in ALWAYS_ALLOW_MCP_PATTERNS:
59
+ if pattern in tool_name:
60
+ sys.exit(0)
61
+
62
+ # Bash - check for safe commands
63
+ if tool_name == "Bash":
64
+ command = tool_input.get("command", "")
65
+ for pattern in SAFE_BASH_PATTERNS:
66
+ if command.strip().startswith(pattern) or pattern in command:
67
+ sys.exit(0)
68
+
69
+ # Everything else: provide context but don't block
70
+ # (Claude Code's built-in permission system handles blocking)
71
+ context = f"Permission check: {tool_name} requires approval"
72
+
73
+ output = {
74
+ "hookSpecificOutput": {
75
+ "hookEventName": "PreToolUse",
76
+ "additionalContext": context,
77
+ }
78
+ }
79
+
80
+ print(json.dumps(output))
81
+ sys.exit(0)
82
+
83
+
84
+ if __name__ == "__main__":
85
+ main()
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Stop Failure Recovery Hook
4
+ ============================
5
+ Recovery when a Claude Code session fails to stop cleanly.
6
+ Attempts to save session state before exiting.
7
+
8
+ Hook Type: StopFailure
9
+ Version: 1.0.0
10
+ """
11
+
12
+ import json
13
+ import sys
14
+ from pathlib import Path
15
+ from datetime import datetime
16
+
17
+ # Add hooks directory
18
+ HOOKS_DIR = str(Path(__file__).parent)
19
+ if HOOKS_DIR not in sys.path:
20
+ sys.path.insert(0, HOOKS_DIR)
21
+
22
+ STATE_FILE = Path("/tmp/eon_stop_failure.json")
23
+
24
+
25
+ def main():
26
+ # Record the failure
27
+ try:
28
+ STATE_FILE.write_text(json.dumps({
29
+ "failure_at": datetime.now().isoformat(),
30
+ "recovered": False,
31
+ }))
32
+ except Exception:
33
+ pass
34
+
35
+ # Try to save session via API
36
+ try:
37
+ from eon_client import get_client
38
+
39
+ client = get_client()
40
+ if client:
41
+ client.save_session(
42
+ summary="Session ended with StopFailure - auto-recovery attempted"
43
+ )
44
+
45
+ # Mark as recovered
46
+ STATE_FILE.write_text(json.dumps({
47
+ "failure_at": datetime.now().isoformat(),
48
+ "recovered": True,
49
+ }))
50
+ except Exception:
51
+ pass # Best effort
52
+
53
+ sys.exit(0)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ main()
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: goal-tracker
3
+ description: Review progress on all active goals, provide status and recommendations
4
+ triggers:
5
+ - /goal-tracker
6
+ - check goals
7
+ - goal progress
8
+ ---
9
+
10
+ # Goal Tracker Skill
11
+
12
+ Review and track progress on all active goals.
13
+
14
+ ## Steps
15
+
16
+ 1. **Load Goals**: Use `eon_goals_list` MCP tool to get all active goals
17
+ 2. **Analyze Progress**: For each goal, assess completion percentage
18
+ 3. **Check Blockers**: Identify any blockers or dependencies
19
+ 4. **Recommendations**: Suggest next actions for each goal
20
+
21
+ ## Report Format
22
+
23
+ For each goal:
24
+ ```
25
+ ## [Goal Title]
26
+ - Status: In Progress / Completed / Blocked
27
+ - Progress: X% (based on milestones completed)
28
+ - Last Update: [date]
29
+ - Next Step: [specific action]
30
+ - Blockers: [if any]
31
+ ```
32
+
33
+ ## Summary Table
34
+
35
+ | Goal | Progress | Status | Next Step |
36
+ |------|----------|--------|-----------|
37
+ | ... | ...% | ... | ... |
38
+
39
+ ## Tips
40
+ - Update goals regularly with `eon_goals_update`
41
+ - Break large goals into milestones
42
+ - Mark completed goals to keep the list clean
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: health-check
3
+ description: System health check - Docker, databases, disk, services, ports
4
+ triggers:
5
+ - /health-check
6
+ - system status
7
+ - check services
8
+ ---
9
+
10
+ # Health Check Skill
11
+
12
+ Run a comprehensive system health check covering:
13
+
14
+ ## Steps
15
+
16
+ 1. **Services**: Check running processes and systemd services
17
+ 2. **Docker**: List container status (`docker ps`)
18
+ 3. **Disk**: Check disk usage (`df -h`)
19
+ 4. **Memory**: Check RAM usage (`free -h`)
20
+ 5. **Ports**: Check critical ports are listening (`ss -tlnp`)
21
+ 6. **Database**: Test EON Memory connection via `eon_health` MCP tool
22
+ 7. **Network**: Quick connectivity check
23
+
24
+ ## Commands
25
+
26
+ ```bash
27
+ # Service status
28
+ systemctl list-units --type=service --state=running | head -20
29
+
30
+ # Docker containers
31
+ docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
32
+
33
+ # Disk usage
34
+ df -h / /mnt 2>/dev/null
35
+
36
+ # Memory
37
+ free -h
38
+
39
+ # Listening ports
40
+ ss -tlnp | grep -E ':(80|443|3000|3003|5000|5678|8000|8080|9090)\s'
41
+ ```
42
+
43
+ ## EON Memory Check
44
+ Use the `eon_health` MCP tool to verify the memory system is responsive.
45
+
46
+ ## Report Format
47
+ Present results as a table with status indicators:
48
+ - OK: Service/resource is healthy
49
+ - WARNING: Approaching limits (>80% usage)
50
+ - CRITICAL: Service down or resource exhausted (>95%)
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: memory-audit
3
+ description: Audit memory system health - quality distribution, duplicates, stale entries
4
+ triggers:
5
+ - /memory-audit
6
+ - memory health
7
+ - audit memories
8
+ ---
9
+
10
+ # Memory Audit Skill
11
+
12
+ Audit the EON Memory system for quality, duplicates, and stale entries.
13
+
14
+ ## Steps
15
+
16
+ 1. **Stats**: Use `eon_stats` MCP tool for overall statistics
17
+ 2. **Quality Distribution**: Analyze memory quality scores
18
+ - Gold (>= 0.9): Complete with WHY + HOW + context
19
+ - Silver (>= 0.7): Good but missing some detail
20
+ - Bronze (>= 0.5): Basic, needs improvement
21
+ - Review (< 0.5): Should be updated or archived
22
+ 3. **Duplicate Detection**: Use `eon_similar` to find near-duplicates
23
+ 4. **Stale Detection**: Find memories not accessed in 30+ days
24
+ 5. **Project Coverage**: Check which projects have few/no memories
25
+
26
+ ## Report Format
27
+
28
+ ```
29
+ ## Memory System Health
30
+
31
+ ### Overview
32
+ - Total Memories: X
33
+ - Active Projects: Y
34
+ - Average Quality: Z
35
+
36
+ ### Quality Distribution
37
+ - Gold: X (Y%)
38
+ - Silver: X (Y%)
39
+ - Bronze: X (Y%)
40
+ - Review: X (Y%)
41
+
42
+ ### Issues Found
43
+ - Duplicates: X pairs
44
+ - Stale (30+ days): X entries
45
+ - Missing project_id: X entries
46
+
47
+ ### Recommendations
48
+ 1. [specific actions]
49
+ ```
50
+
51
+ ## Actions
52
+ - Suggest consolidating duplicates
53
+ - Recommend archiving stale memories
54
+ - Identify high-value memories that should be updated
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: self-improvement-loop
3
+ description: Daily improvement analysis - review recent work, find patterns, plan improvements
4
+ triggers:
5
+ - /self-improvement
6
+ - daily review
7
+ - improvement plan
8
+ ---
9
+
10
+ # Self-Improvement Loop Skill
11
+
12
+ Analyze recent work and create an improvement plan.
13
+
14
+ ## Steps
15
+
16
+ 1. **Work Analysis**: Search recent memories for completed work
17
+ - Use `eon_search` with query "completed" or "implemented" or "fixed"
18
+ - Review last 10-20 memories
19
+
20
+ 2. **Pattern Detection**: Identify recurring patterns
21
+ - Common error types
22
+ - Repeated manual tasks (automation candidates)
23
+ - Frequently accessed files/modules
24
+
25
+ 3. **Quality Review**: Check if recent memories meet quality standards
26
+ - Do they have PROBLEM + FIX sections?
27
+ - Are they actionable for future reference?
28
+
29
+ 4. **Improvement Plan**: Create categorized plan
30
+
31
+ ## Report Format
32
+
33
+ ```
34
+ ## Daily Improvement Report
35
+
36
+ ### What Was Done
37
+ - [summary of recent work from memories]
38
+
39
+ ### Patterns Found
40
+ - [recurring themes, repeated tasks]
41
+
42
+ ### Improvement Opportunities
43
+
44
+ #### REPAIR (fix what's broken)
45
+ - [ ] [specific fix needed]
46
+
47
+ #### IMPROVE (make existing things better)
48
+ - [ ] [specific improvement]
49
+
50
+ #### NEW (add missing capabilities)
51
+ - [ ] [specific new feature/tool]
52
+
53
+ #### LEARN (knowledge to acquire)
54
+ - [ ] [specific topic to research]
55
+ ```
56
+
57
+ ## Tips
58
+ - Run this daily or weekly for best results
59
+ - Save the plan as a memory for tracking
60
+ - Review previous plans to check progress
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: x-alignment-check
3
+ description: Alignment and coherence check - validate logical consistency of recent work
4
+ triggers:
5
+ - /alignment-check
6
+ - check alignment
7
+ - coherence check
8
+ ---
9
+
10
+ # Alignment Check Skill
11
+
12
+ Validate logical consistency and quality alignment of recent work.
13
+
14
+ ## Steps
15
+
16
+ 1. **Load Recent Work**: Search memories for recent changes and decisions
17
+ - Use `eon_search` for last session's work
18
+ - Identify key files modified and decisions made
19
+
20
+ 2. **Consistency Check**: Validate logical coherence
21
+ - Do recent changes align with project goals?
22
+ - Are there contradictions between memories?
23
+ - Did documented decisions get implemented correctly?
24
+
25
+ 3. **Quality Gradient**: Assess improvement direction
26
+ - Is code quality improving or degrading?
27
+ - Are more problems being solved than created?
28
+ - Is documentation keeping up with code changes?
29
+
30
+ 4. **Verification (A10)**: Check that claims of "done" are verified
31
+ - Were tests run after code changes?
32
+ - Were compile checks performed?
33
+ - Are there unverified "completed" items?
34
+
35
+ ## Checks
36
+
37
+ ### Logical Consistency
38
+ - [ ] No contradictory statements in recent memories
39
+ - [ ] Decisions are coherent with project goals
40
+ - [ ] Implementation matches documented plans
41
+
42
+ ### Quality Direction
43
+ - [ ] More issues resolved than introduced
44
+ - [ ] Code follows established patterns
45
+ - [ ] Error handling is appropriate
46
+
47
+ ### Verification Status
48
+ - [ ] All code changes have been compiled/tested
49
+ - [ ] No "done" claims without verification evidence
50
+ - [ ] Test coverage maintained or improved
51
+
52
+ ## Report Format
53
+
54
+ ```
55
+ ## Alignment Report
56
+
57
+ Score: X/10
58
+ Direction: Improving / Stable / Declining
59
+
60
+ ### Findings
61
+ - [specific observations]
62
+
63
+ ### Issues
64
+ - [contradictions or unverified claims]
65
+
66
+ ### Recommendations
67
+ - [specific actions to improve alignment]
68
+ ```