eon-memory 1.0.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 +9 -2
- package/src/init.js +492 -2
- package/src/tier_map.json +97 -0
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eon-memory",
|
|
3
|
-
"version": "1.
|
|
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": [
|
|
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
|
@@ -199,12 +199,502 @@ async function main() {
|
|
|
199
199
|
console.log(" Warning: Could not fetch CLAUDE.md template (non-critical).");
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
// Step 5: X-Ethics Hooks Installation (optional)
|
|
203
|
+
console.log("");
|
|
204
|
+
const xEthicsAnswer = await ask(" Install X-Ethics enforcement hooks? (recommended) [Y/n]: ");
|
|
205
|
+
const installXEthics = xEthicsAnswer === "" || xEthicsAnswer.toLowerCase() === "y";
|
|
206
|
+
|
|
207
|
+
if (installXEthics) {
|
|
208
|
+
const hooksDir = path.join(os.homedir(), ".claude", "hooks");
|
|
209
|
+
const settingsPath = path.join(os.homedir(), ".claude", "settings.json");
|
|
210
|
+
|
|
211
|
+
// Create hooks directory
|
|
212
|
+
if (!fs.existsSync(hooksDir)) {
|
|
213
|
+
fs.mkdirSync(hooksDir, { recursive: true });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Hook 1: x_ethics_prompt_check.py
|
|
217
|
+
const promptCheckScript = `#!/usr/bin/env python3
|
|
218
|
+
"""UserPromptSubmit hook - X-Ethics enforcement (prompt check)."""
|
|
219
|
+
import json, re, sys, os
|
|
220
|
+
|
|
221
|
+
data = json.load(sys.stdin)
|
|
222
|
+
msg = data.get("user_message", "")
|
|
223
|
+
|
|
224
|
+
TECH_BYPASS = {"kill", "destroy", "attack", "eliminate", "exploit", "trick"}
|
|
225
|
+
EDU_CONTEXT = {"history", "prevent", "defense", "research", "study", "test",
|
|
226
|
+
"debug", "process", "container", "docker", "security", "audit",
|
|
227
|
+
"pentest"}
|
|
228
|
+
|
|
229
|
+
words = set(re.findall(r"\\b\\w+\\b", msg.lower()))
|
|
230
|
+
has_edu = bool(words & EDU_CONTEXT)
|
|
231
|
+
|
|
232
|
+
HARMFUL = r"\\b(kill|murder|bomb|attack|destroy|nuke|assassinate|genocide|massacre|worthless|subhuman|inferior|eliminate|hate)\\b"
|
|
233
|
+
COERCIVE = r"\\b(must obey|no choice|forced to|comply or else)\\b"
|
|
234
|
+
DECEPTIVE = r"\\b(trick|deceive|manipulate|exploit|mislead|hide the truth|cover up)\\b"
|
|
235
|
+
|
|
236
|
+
def check(pattern, text):
|
|
237
|
+
matches = re.findall(pattern, text.lower())
|
|
238
|
+
if not matches:
|
|
239
|
+
return None
|
|
240
|
+
filtered = [m for m in matches if m not in TECH_BYPASS]
|
|
241
|
+
if filtered and not has_edu:
|
|
242
|
+
return filtered[0]
|
|
243
|
+
return None
|
|
244
|
+
|
|
245
|
+
violation = check(HARMFUL, msg) or check(COERCIVE, msg) or check(DECEPTIVE, msg)
|
|
246
|
+
|
|
247
|
+
if violation:
|
|
248
|
+
with open("/tmp/eon_xethics_violation.json", "w") as f:
|
|
249
|
+
json.dump({"violation": violation, "ts": __import__("time").time()}, f)
|
|
250
|
+
print(json.dumps({
|
|
251
|
+
"additionalContext": f"X-Ethics violation detected ('{violation}'). "
|
|
252
|
+
"This request was flagged as potentially harmful. "
|
|
253
|
+
"Please rephrase your request in a constructive way."
|
|
254
|
+
}))
|
|
255
|
+
sys.exit(0)
|
|
256
|
+
|
|
257
|
+
sys.exit(0)
|
|
258
|
+
`;
|
|
259
|
+
|
|
260
|
+
// Hook 2: x_ethics_tool_block.py
|
|
261
|
+
const toolBlockScript = `#!/usr/bin/env python3
|
|
262
|
+
"""PreToolUse hook - X-Ethics enforcement (tool block)."""
|
|
263
|
+
import json, sys, os, time
|
|
264
|
+
|
|
265
|
+
data = json.load(sys.stdin)
|
|
266
|
+
tool = data.get("tool_name", "")
|
|
267
|
+
|
|
268
|
+
READONLY = {"Read", "Glob", "Grep", "ToolSearch", "TaskCreate", "TaskUpdate",
|
|
269
|
+
"TaskGet", "TaskList"}
|
|
270
|
+
|
|
271
|
+
if tool in READONLY:
|
|
272
|
+
sys.exit(0)
|
|
273
|
+
|
|
274
|
+
vfile = "/tmp/eon_xethics_violation.json"
|
|
275
|
+
if os.path.exists(vfile):
|
|
276
|
+
try:
|
|
277
|
+
with open(vfile) as f:
|
|
278
|
+
v = json.load(f)
|
|
279
|
+
if time.time() - v.get("ts", 0) < 60:
|
|
280
|
+
print(json.dumps({
|
|
281
|
+
"decision": "block",
|
|
282
|
+
"reason": f"X-Ethics violation active ('{v.get('violation', '?')}'). "
|
|
283
|
+
"Tool use blocked until violation is resolved."
|
|
284
|
+
}))
|
|
285
|
+
sys.exit(0)
|
|
286
|
+
except Exception:
|
|
287
|
+
pass
|
|
288
|
+
|
|
289
|
+
sys.exit(0)
|
|
290
|
+
`;
|
|
291
|
+
|
|
292
|
+
const promptCheckPath = path.join(hooksDir, "x_ethics_prompt_check.py");
|
|
293
|
+
const toolBlockPath = path.join(hooksDir, "x_ethics_tool_block.py");
|
|
294
|
+
|
|
295
|
+
fs.writeFileSync(promptCheckPath, promptCheckScript);
|
|
296
|
+
fs.chmodSync(promptCheckPath, 0o755);
|
|
297
|
+
|
|
298
|
+
fs.writeFileSync(toolBlockPath, toolBlockScript);
|
|
299
|
+
fs.chmodSync(toolBlockPath, 0o755);
|
|
300
|
+
|
|
301
|
+
// Update settings.json - merge hooks
|
|
302
|
+
let settings = {};
|
|
303
|
+
if (fs.existsSync(settingsPath)) {
|
|
304
|
+
try {
|
|
305
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, "utf-8"));
|
|
306
|
+
} catch {
|
|
307
|
+
settings = {};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (!settings.hooks) settings.hooks = {};
|
|
311
|
+
|
|
312
|
+
const promptHookEntry = {
|
|
313
|
+
matcher: "",
|
|
314
|
+
hooks: [{ type: "command", command: `python3 ${promptCheckPath}` }],
|
|
315
|
+
};
|
|
316
|
+
const toolHookEntry = {
|
|
317
|
+
matcher: "",
|
|
318
|
+
hooks: [{ type: "command", command: `python3 ${toolBlockPath}` }],
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
if (!settings.hooks.UserPromptSubmit) settings.hooks.UserPromptSubmit = [];
|
|
322
|
+
settings.hooks.UserPromptSubmit.unshift(promptHookEntry);
|
|
323
|
+
|
|
324
|
+
if (!settings.hooks.PreToolUse) settings.hooks.PreToolUse = [];
|
|
325
|
+
settings.hooks.PreToolUse.unshift(toolHookEntry);
|
|
326
|
+
|
|
327
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
328
|
+
|
|
329
|
+
console.log(" Installed: ~/.claude/hooks/x_ethics_prompt_check.py");
|
|
330
|
+
console.log(" Installed: ~/.claude/hooks/x_ethics_tool_block.py");
|
|
331
|
+
console.log(" Updated: ~/.claude/settings.json");
|
|
332
|
+
console.log(" X-Ethics enforcement is now active!\n");
|
|
333
|
+
} else {
|
|
334
|
+
console.log(" Skipped. You can install X-Ethics hooks later.\n");
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Step 6: Install full agent/hook/skill ecosystem
|
|
338
|
+
console.log("");
|
|
339
|
+
const fullSystemAnswer = await ask(" Install full EON agent ecosystem (agents, hooks, skills)? (recommended) [Y/n]: ");
|
|
340
|
+
const installFullSystem = fullSystemAnswer === "" || fullSystemAnswer.toLowerCase() === "y";
|
|
341
|
+
|
|
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) {
|
|
514
|
+
const agentsDir = path.join(os.homedir(), ".claude", "agents");
|
|
515
|
+
if (!fs.existsSync(agentsDir)) {
|
|
516
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Jarvis Agent
|
|
520
|
+
const jarvisContent = `---
|
|
521
|
+
name: jarvis
|
|
522
|
+
description: Your AI project orchestrator. Use for complex multi-step tasks, project planning, and coordinating work across files. Jarvis checks your memories first, delegates to specialists, and ensures quality.
|
|
523
|
+
tools: Read, Write, Edit, Bash, Grep, Glob, Agent
|
|
524
|
+
model: opus
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
# Jarvis — Your Project Orchestrator
|
|
528
|
+
|
|
529
|
+
You are Jarvis, an intelligent project orchestrator. You coordinate complex tasks by breaking them down, checking existing knowledge, and ensuring quality at every step.
|
|
530
|
+
|
|
531
|
+
## How You Work
|
|
532
|
+
|
|
533
|
+
### Before EVERY task:
|
|
534
|
+
1. **Check memories first**: Call \`eon_search\` with relevant keywords to find existing knowledge
|
|
535
|
+
2. **Check goals**: Call \`eon_goals_list\` to understand current objectives
|
|
536
|
+
3. **Plan before executing**: For anything touching >2 files, create a plan first
|
|
537
|
+
|
|
538
|
+
### During work:
|
|
539
|
+
4. **Delegate when appropriate**: Use sub-agents for specialized tasks
|
|
540
|
+
5. **Save decisions**: Every significant decision gets saved with \`eon_create\` (category: "decision")
|
|
541
|
+
6. **Track progress**: Update goals with \`eon_goals_update\` as work progresses
|
|
542
|
+
|
|
543
|
+
### After EVERY task:
|
|
544
|
+
7. **Save what was done**: Create a memory summarizing the work (category: "update")
|
|
545
|
+
8. **Verify**: Run the code, check for errors, confirm it works
|
|
546
|
+
9. **Report**: Tell the user what was done, what was decided, and what's next
|
|
547
|
+
|
|
548
|
+
## Memory Quality Rules
|
|
549
|
+
|
|
550
|
+
When creating memories, include ACTIONABLE details:
|
|
551
|
+
- For API work: method, path, parameters, response format, status codes
|
|
552
|
+
- For database work: full schema with types and constraints
|
|
553
|
+
- For components: props, state, dependencies
|
|
554
|
+
- For decisions: WHAT was decided, WHY, and WHAT alternatives were rejected
|
|
555
|
+
|
|
556
|
+
## Available MCP Tools
|
|
557
|
+
|
|
558
|
+
- \`eon_create\` — Save knowledge (validated with 15 truth tests)
|
|
559
|
+
- \`eon_search\` — Find memories by meaning
|
|
560
|
+
- \`eon_list\` — Browse all memories
|
|
561
|
+
- \`eon_get\` — Get specific memory
|
|
562
|
+
- \`eon_update\` — Update existing memory
|
|
563
|
+
- \`eon_goals_create\` — Create project goals
|
|
564
|
+
- \`eon_goals_list\` — Check goal progress
|
|
565
|
+
- \`eon_goals_update\` — Update goal status
|
|
566
|
+
- \`eon_health\` — System health check
|
|
567
|
+
- \`eon_stats\` — Usage statistics
|
|
568
|
+
`;
|
|
569
|
+
|
|
570
|
+
// Memory Manager Agent
|
|
571
|
+
const memoryManagerContent = `---
|
|
572
|
+
name: memory-manager
|
|
573
|
+
description: Manages EON memories - create, search, update, organize knowledge. Use when you need to save context, find past decisions, or organize project knowledge.
|
|
574
|
+
tools: Read, Grep, Glob
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
# EON Memory Manager
|
|
578
|
+
|
|
579
|
+
You help manage persistent, validated memories through the EON MCP tools.
|
|
580
|
+
|
|
581
|
+
## Available MCP Tools
|
|
582
|
+
|
|
583
|
+
### Save Knowledge
|
|
584
|
+
- \`eon_create\`: Create a new validated memory (title, content, project_id, category)
|
|
585
|
+
- Every create runs 15 truth tests and returns a quality score + X-Ethics alignment score.
|
|
586
|
+
|
|
587
|
+
### Find Knowledge
|
|
588
|
+
- \`eon_search\`: Semantic search (finds by meaning, not keywords)
|
|
589
|
+
- \`eon_similar\`: Find memories similar to a given one
|
|
590
|
+
|
|
591
|
+
### Organize
|
|
592
|
+
- \`eon_projects\`: List all projects with memory counts
|
|
593
|
+
- \`eon_list\`: Browse memories with pagination
|
|
594
|
+
- \`eon_get\`: Get a specific memory by ID
|
|
595
|
+
- \`eon_update\`: Update a memory (re-validates after)
|
|
596
|
+
- \`eon_delete\`: Soft delete (recoverable)
|
|
597
|
+
|
|
598
|
+
### Track Goals
|
|
599
|
+
- \`eon_goals_create\`: Create goals with priority/deadline
|
|
600
|
+
- \`eon_goals_list\`: List goals by status/priority
|
|
601
|
+
- \`eon_goals_update\`: Update progress (0-100%)
|
|
602
|
+
|
|
603
|
+
## Best Practices
|
|
604
|
+
|
|
605
|
+
1. **Save decisions**: When the user makes an important decision, save it as category "decision"
|
|
606
|
+
2. **Save context**: At the start of a project, save the context so future sessions have it
|
|
607
|
+
3. **Search before creating**: Check if similar knowledge already exists
|
|
608
|
+
4. **Use projects**: Organize memories by project for cleaner search results
|
|
609
|
+
5. **Quality matters**: If a memory gets a low quality score, consider improving the content
|
|
610
|
+
`;
|
|
611
|
+
|
|
612
|
+
// X-Ethics Reviewer Agent
|
|
613
|
+
const xEthicsReviewerContent = `---
|
|
614
|
+
name: x-ethics-reviewer
|
|
615
|
+
description: Reviews code and outputs for X-Ethics alignment - checks truth, freedom, grace, and gratitude. Use after code changes or before commits.
|
|
616
|
+
tools: Read, Grep, Glob
|
|
617
|
+
model: sonnet
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
# X-Ethics Reviewer
|
|
621
|
+
|
|
622
|
+
You review code and text for alignment with the X-Ethics framework.
|
|
623
|
+
|
|
624
|
+
## What You Check
|
|
625
|
+
|
|
626
|
+
### 1. Truth (W)
|
|
627
|
+
- Are there hardcoded lies, misleading comments, or false claims?
|
|
628
|
+
- Do error messages accurately describe what happened?
|
|
629
|
+
- Are variable/function names honest about what they do?
|
|
630
|
+
|
|
631
|
+
### 2. Freedom (F)
|
|
632
|
+
- Does the code respect user autonomy? (no dark patterns, no forced flows)
|
|
633
|
+
- Are users informed about what happens with their data?
|
|
634
|
+
- No coercive UX patterns (guilt-tripping, fake urgency, hidden costs)
|
|
635
|
+
|
|
636
|
+
### 3. Grace (G)
|
|
637
|
+
- Does the code treat all users with dignity?
|
|
638
|
+
- Error messages are helpful, not blaming
|
|
639
|
+
- Accessible design considerations
|
|
640
|
+
|
|
641
|
+
### 4. Gratitude (D)
|
|
642
|
+
- Are open-source licenses respected?
|
|
643
|
+
- Are third-party contributions credited?
|
|
644
|
+
|
|
645
|
+
## Output Format
|
|
646
|
+
|
|
647
|
+
X-Ethics Review
|
|
648
|
+
Score: XX%
|
|
649
|
+
|
|
650
|
+
Truth (W): [PASS/WARN/FAIL] - reason
|
|
651
|
+
Freedom (F): [PASS/WARN/FAIL] - reason
|
|
652
|
+
Grace (G): [PASS/WARN/FAIL] - reason
|
|
653
|
+
Gratitude (D):[PASS/WARN/FAIL] - reason
|
|
654
|
+
|
|
655
|
+
Issues found: N
|
|
656
|
+
Recommendations: [Actionable suggestions]
|
|
657
|
+
`;
|
|
658
|
+
|
|
659
|
+
fs.writeFileSync(path.join(agentsDir, "jarvis.md"), jarvisContent);
|
|
660
|
+
fs.writeFileSync(path.join(agentsDir, "memory-manager.md"), memoryManagerContent);
|
|
661
|
+
fs.writeFileSync(path.join(agentsDir, "x-ethics-reviewer.md"), xEthicsReviewerContent);
|
|
662
|
+
|
|
663
|
+
console.log(" Installed: ~/.claude/agents/jarvis.md");
|
|
664
|
+
console.log(" Installed: ~/.claude/agents/memory-manager.md");
|
|
665
|
+
console.log(" Installed: ~/.claude/agents/x-ethics-reviewer.md");
|
|
666
|
+
console.log(" 3 AI agents are now available!\n");
|
|
667
|
+
} else {
|
|
668
|
+
console.log(" Skipped. You can install agents manually later.\n");
|
|
669
|
+
}
|
|
670
|
+
|
|
202
671
|
// Done
|
|
203
|
-
console.log("\n
|
|
672
|
+
console.log("\n ====================================================");
|
|
673
|
+
console.log(" Setup complete!");
|
|
674
|
+
console.log(" ====================================================\n");
|
|
675
|
+
console.log(" Installed components:");
|
|
676
|
+
console.log(" - MCP Server connection (.mcp.json)");
|
|
677
|
+
console.log(" - CLAUDE.md instructions");
|
|
678
|
+
if (installXEthics) console.log(" - X-Ethics enforcement hooks");
|
|
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("");
|
|
204
689
|
console.log(" Next steps:");
|
|
205
690
|
console.log(" 1. Open this project in Claude Code or Cursor");
|
|
206
691
|
console.log(" 2. The EON Memory tools will be available automatically");
|
|
207
|
-
console.log(" 3. Try: \"Search my memories for...\" or \"Create a memory about...\"
|
|
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
|
+
}
|
|
697
|
+
console.log("");
|
|
208
698
|
console.log(` Dashboard: ${API_BASE}`);
|
|
209
699
|
console.log(` Run 'npx eon-memory status' to check connection.\n`);
|
|
210
700
|
}
|
|
@@ -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
|
+
}
|