eon-memory 1.1.0 → 1.2.0

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,11 +1,18 @@
1
1
  {
2
2
  "name": "eon-memory",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "EON Memory - Persistent AI memory system. Connect Claude Code, Cursor, or VS Code to your memory.",
5
5
  "bin": {
6
6
  "eon-memory": "./bin/eon.js"
7
7
  },
8
- "keywords": ["mcp", "memory", "ai", "claude", "cursor", "context"],
8
+ "keywords": [
9
+ "mcp",
10
+ "memory",
11
+ "ai",
12
+ "claude",
13
+ "cursor",
14
+ "context"
15
+ ],
9
16
  "license": "MIT",
10
17
  "repository": {
11
18
  "type": "git",
package/src/init.js CHANGED
@@ -334,12 +334,183 @@ sys.exit(0)
334
334
  console.log(" Skipped. You can install X-Ethics hooks later.\n");
335
335
  }
336
336
 
337
- // Step 6: Install AI Agents
337
+ // Step 6: Install full agent/hook/skill ecosystem
338
338
  console.log("");
339
- const agentsAnswer = await ask(" Install AI agents (Jarvis, Memory Manager, X-Ethics Reviewer)? (recommended) [Y/n]: ");
340
- const installAgents = agentsAnswer === "" || agentsAnswer.toLowerCase() === "y";
339
+ const fullSystemAnswer = await ask(" Install full EON agent ecosystem (agents, hooks, skills)? (recommended) [Y/n]: ");
340
+ const installFullSystem = fullSystemAnswer === "" || fullSystemAnswer.toLowerCase() === "y";
341
341
 
342
- if (installAgents) {
342
+ let installedAgentCount = 0;
343
+ let installedHookCount = 0;
344
+ let installedSkillCount = 0;
345
+ let detectedTier = "starter";
346
+
347
+ if (installFullSystem) {
348
+ // 6a: Detect tier from server
349
+ try {
350
+ const configRes = await httpGet(
351
+ `${API_BASE}/api/hooks/config`,
352
+ { Authorization: `Bearer ${apiKey}` }
353
+ );
354
+ if (configRes.status === 200 && configRes.data.tier) {
355
+ detectedTier = configRes.data.tier;
356
+ }
357
+ } catch {
358
+ // Fall back to tier_map.json
359
+ }
360
+
361
+ // Load tier map
362
+ let tierMap;
363
+ try {
364
+ tierMap = JSON.parse(fs.readFileSync(path.join(__dirname, "tier_map.json"), "utf-8"));
365
+ } catch {
366
+ tierMap = {
367
+ starter: {
368
+ agents: ["alignment-validator", "code-verifier", "security-scanner", "system-monitor"],
369
+ hooks: ["post_code_check", "memory_quality_gate", "smart_permissions", "agent_trigger"],
370
+ skills: ["health-check"],
371
+ },
372
+ business: {
373
+ agents: ["alignment-validator", "code-verifier", "security-scanner", "system-monitor",
374
+ "reflection-engine", "orchestrator", "incident-responder", "deployment-manager",
375
+ "code-simplifier", "research-agent", "analytics-agent", "communication-agent", "web-designer"],
376
+ hooks: ["post_code_check", "memory_quality_gate", "smart_permissions", "agent_trigger",
377
+ "eon_memory_search", "session_end_save", "stop_failure_recovery", "cwd_context_switch", "post_compact_reload"],
378
+ skills: ["health-check", "goal-tracker", "memory-audit", "self-improvement-loop", "x-alignment-check"],
379
+ },
380
+ enterprise: {
381
+ agents: ["alignment-validator", "code-verifier", "security-scanner", "system-monitor",
382
+ "reflection-engine", "orchestrator", "incident-responder", "deployment-manager",
383
+ "code-simplifier", "research-agent", "analytics-agent", "communication-agent", "web-designer",
384
+ "market-analyst", "opportunity-scout", "local-llm"],
385
+ hooks: ["post_code_check", "memory_quality_gate", "smart_permissions", "agent_trigger",
386
+ "eon_memory_search", "session_end_save", "stop_failure_recovery", "cwd_context_switch", "post_compact_reload"],
387
+ skills: ["health-check", "goal-tracker", "memory-audit", "self-improvement-loop", "x-alignment-check"],
388
+ },
389
+ };
390
+ }
391
+
392
+ const tierConfig = tierMap[detectedTier] || tierMap.starter;
393
+ console.log(`\n Detected tier: ${detectedTier}`);
394
+ console.log(` Components: ${tierConfig.agents.length} agents, ${tierConfig.hooks.length} hooks, ${tierConfig.skills.length} skills\n`);
395
+
396
+ // 6b: Create directories
397
+ const hooksDir = path.join(os.homedir(), ".claude", "hooks");
398
+ const agentsDir = path.join(os.homedir(), ".claude", "agents");
399
+ const skillsDir = path.join(os.homedir(), ".claude", "skills");
400
+ const logsDir = path.join(os.homedir(), ".claude", "logs");
401
+
402
+ [hooksDir, agentsDir, skillsDir, logsDir].forEach((dir) => {
403
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
404
+ });
405
+
406
+ // 6c: Write eon_config.json
407
+ const eonConfigPath = path.join(os.homedir(), ".claude", "eon_config.json");
408
+ fs.writeFileSync(eonConfigPath, JSON.stringify({
409
+ api_key: apiKey,
410
+ endpoint: API_BASE,
411
+ tier: detectedTier,
412
+ log_file: path.join(logsDir, "eon_client.log"),
413
+ }, null, 2) + "\n");
414
+ console.log(" Created: ~/.claude/eon_config.json");
415
+
416
+ // 6d: Install eon_client.py (production-grade API client)
417
+ const templatesHooksDir = path.join(__dirname, "..", "templates", "hooks");
418
+ const clientSrc = path.join(templatesHooksDir, "eon_client.py");
419
+ if (fs.existsSync(clientSrc)) {
420
+ fs.copyFileSync(clientSrc, path.join(hooksDir, "eon_client.py"));
421
+ console.log(" Installed: ~/.claude/hooks/eon_client.py (API client)");
422
+ }
423
+
424
+ // 6e: Install hook_utils.py
425
+ const utilsSrc = path.join(templatesHooksDir, "hook_utils.py");
426
+ if (fs.existsSync(utilsSrc)) {
427
+ fs.copyFileSync(utilsSrc, path.join(hooksDir, "hook_utils.py"));
428
+ console.log(" Installed: ~/.claude/hooks/hook_utils.py");
429
+ }
430
+
431
+ // 6f: Install tier-appropriate agents
432
+ const templatesAgentsDir = path.join(__dirname, "..", "templates", "agents");
433
+ console.log("\n Installing agents...");
434
+ for (const agentName of tierConfig.agents) {
435
+ const src = path.join(templatesAgentsDir, `${agentName}.md`);
436
+ if (fs.existsSync(src)) {
437
+ fs.copyFileSync(src, path.join(agentsDir, `${agentName}.md`));
438
+ installedAgentCount++;
439
+ }
440
+ }
441
+ console.log(` Installed ${installedAgentCount} agents to ~/.claude/agents/`);
442
+
443
+ // 6g: Install tier-appropriate hooks
444
+ console.log("\n Installing hooks...");
445
+ for (const hookName of tierConfig.hooks) {
446
+ const src = path.join(templatesHooksDir, `${hookName}.py`);
447
+ if (fs.existsSync(src)) {
448
+ fs.copyFileSync(src, path.join(hooksDir, `${hookName}.py`));
449
+ fs.chmodSync(path.join(hooksDir, `${hookName}.py`), 0o755);
450
+ installedHookCount++;
451
+ }
452
+ }
453
+ console.log(` Installed ${installedHookCount} hooks to ~/.claude/hooks/`);
454
+
455
+ // 6h: Install tier-appropriate skills
456
+ const templatesSkillsDir = path.join(__dirname, "..", "templates", "skills");
457
+ console.log("\n Installing skills...");
458
+ for (const skillName of tierConfig.skills) {
459
+ const src = path.join(templatesSkillsDir, `${skillName}.md`);
460
+ if (fs.existsSync(src)) {
461
+ fs.copyFileSync(src, path.join(skillsDir, `${skillName}.md`));
462
+ installedSkillCount++;
463
+ }
464
+ }
465
+ console.log(` Installed ${installedSkillCount} skills to ~/.claude/skills/`);
466
+
467
+ // 6i: Patch settings.json with hook registrations
468
+ console.log("\n Configuring hooks in settings.json...");
469
+ const settingsPath = path.join(os.homedir(), ".claude", "settings.json");
470
+ let settings = {};
471
+ if (fs.existsSync(settingsPath)) {
472
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, "utf-8")); } catch { settings = {}; }
473
+ }
474
+ if (!settings.hooks) settings.hooks = {};
475
+
476
+ const hookRegistrations = {
477
+ UserPromptSubmit: ["eon_memory_search", "agent_trigger"],
478
+ PreToolUse: ["smart_permissions"],
479
+ PostToolUse: ["post_code_check", "memory_quality_gate"],
480
+ Stop: ["session_end_save"],
481
+ StopFailure: ["stop_failure_recovery"],
482
+ CwdChanged: ["cwd_context_switch"],
483
+ PostCompact: ["post_compact_reload"],
484
+ };
485
+
486
+ for (const [eventType, hookNames] of Object.entries(hookRegistrations)) {
487
+ for (const hookName of hookNames) {
488
+ if (!tierConfig.hooks.includes(hookName)) continue;
489
+
490
+ const hookPath = path.join(hooksDir, `${hookName}.py`);
491
+ if (!fs.existsSync(hookPath)) continue;
492
+
493
+ if (!settings.hooks[eventType]) settings.hooks[eventType] = [];
494
+
495
+ // Don't add duplicate entries
496
+ const existing = settings.hooks[eventType].find(
497
+ (h) => h.hooks && h.hooks.some((hh) => hh.command && hh.command.includes(hookName))
498
+ );
499
+ if (!existing) {
500
+ settings.hooks[eventType].push({
501
+ matcher: "",
502
+ hooks: [{ type: "command", command: `python3 ${hookPath}` }],
503
+ });
504
+ }
505
+ }
506
+ }
507
+
508
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
509
+ console.log(" Updated: ~/.claude/settings.json\n");
510
+ }
511
+
512
+ // Legacy: Install basic agents if full system was skipped
513
+ if (!installFullSystem) {
343
514
  const agentsDir = path.join(os.homedir(), ".claude", "agents");
344
515
  if (!fs.existsSync(agentsDir)) {
345
516
  fs.mkdirSync(agentsDir, { recursive: true });
@@ -498,19 +669,33 @@ Recommendations: [Actionable suggestions]
498
669
  }
499
670
 
500
671
  // Done
501
- console.log("\n Setup complete!\n");
502
- console.log(" Next steps:");
503
- console.log(" 1. Open this project in Claude Code or Cursor");
504
- console.log(" 2. The EON Memory tools will be available automatically");
505
- console.log(" 3. Try: \"Search my memories for...\" or \"Create a memory about...\"\n");
672
+ console.log("\n ====================================================");
673
+ console.log(" Setup complete!");
674
+ console.log(" ====================================================\n");
506
675
  console.log(" Installed components:");
507
676
  console.log(" - MCP Server connection (.mcp.json)");
508
- console.log(" - Main Prompt (CLAUDE.md)");
677
+ console.log(" - CLAUDE.md instructions");
509
678
  if (installXEthics) console.log(" - X-Ethics enforcement hooks");
510
- if (installAgents) console.log(" - AI agents (Jarvis, Memory Manager, X-Ethics Reviewer)");
679
+ if (installFullSystem) {
680
+ console.log(` - ${installedAgentCount} AI agents (${detectedTier} tier)`);
681
+ console.log(` - ${installedHookCount} automation hooks`);
682
+ console.log(` - ${installedSkillCount} skills`);
683
+ console.log(" - EON API client (eon_client.py)");
684
+ console.log(" - eon_config.json");
685
+ } else if (installAgents) {
686
+ console.log(" - 3 basic AI agents");
687
+ }
688
+ console.log("");
689
+ console.log(" Next steps:");
690
+ console.log(" 1. Open this project in Claude Code or Cursor");
691
+ console.log(" 2. The EON Memory tools will be available automatically");
692
+ console.log(" 3. Try: \"Search my memories for...\" or \"Create a memory about...\"");
693
+ if (installFullSystem && installedAgentCount > 3) {
694
+ console.log(` 4. Your agents are ready: alignment-validator, orchestrator, and ${installedAgentCount - 2} more`);
695
+ console.log(" 5. Hooks run automatically (semantic search, code verification, session tracking)");
696
+ }
511
697
  console.log("");
512
698
  console.log(` Dashboard: ${API_BASE}`);
513
- console.log(` Best Practices: ${API_BASE}/best-practices`);
514
699
  console.log(` Run 'npx eon-memory status' to check connection.\n`);
515
700
  }
516
701
 
@@ -0,0 +1,97 @@
1
+ {
2
+ "starter": {
3
+ "agents": [
4
+ "alignment-validator",
5
+ "code-verifier",
6
+ "security-scanner",
7
+ "system-monitor"
8
+ ],
9
+ "hooks": [
10
+ "post_code_check",
11
+ "memory_quality_gate",
12
+ "smart_permissions",
13
+ "agent_trigger"
14
+ ],
15
+ "skills": [
16
+ "health-check"
17
+ ]
18
+ },
19
+ "business": {
20
+ "agents": [
21
+ "alignment-validator",
22
+ "code-verifier",
23
+ "security-scanner",
24
+ "system-monitor",
25
+ "reflection-engine",
26
+ "orchestrator",
27
+ "incident-responder",
28
+ "deployment-manager",
29
+ "code-simplifier",
30
+ "research-agent",
31
+ "analytics-agent",
32
+ "communication-agent",
33
+ "web-designer"
34
+ ],
35
+ "hooks": [
36
+ "post_code_check",
37
+ "memory_quality_gate",
38
+ "smart_permissions",
39
+ "agent_trigger",
40
+ "eon_memory_search",
41
+ "session_end_save",
42
+ "stop_failure_recovery",
43
+ "cwd_context_switch",
44
+ "post_compact_reload"
45
+ ],
46
+ "skills": [
47
+ "health-check",
48
+ "goal-tracker",
49
+ "memory-audit",
50
+ "self-improvement-loop",
51
+ "x-alignment-check"
52
+ ]
53
+ },
54
+ "enterprise": {
55
+ "agents": [
56
+ "alignment-validator",
57
+ "code-verifier",
58
+ "security-scanner",
59
+ "system-monitor",
60
+ "reflection-engine",
61
+ "orchestrator",
62
+ "incident-responder",
63
+ "deployment-manager",
64
+ "code-simplifier",
65
+ "research-agent",
66
+ "analytics-agent",
67
+ "communication-agent",
68
+ "web-designer",
69
+ "market-analyst",
70
+ "opportunity-scout",
71
+ "local-llm"
72
+ ],
73
+ "hooks": [
74
+ "post_code_check",
75
+ "memory_quality_gate",
76
+ "smart_permissions",
77
+ "agent_trigger",
78
+ "eon_memory_search",
79
+ "session_end_save",
80
+ "stop_failure_recovery",
81
+ "cwd_context_switch",
82
+ "post_compact_reload"
83
+ ],
84
+ "skills": [
85
+ "health-check",
86
+ "goal-tracker",
87
+ "memory-audit",
88
+ "self-improvement-loop",
89
+ "x-alignment-check"
90
+ ],
91
+ "features": [
92
+ "custom_agents",
93
+ "custom_hooks",
94
+ "custom_skills"
95
+ ]
96
+ }
97
+ }