@gethmy/mcp 2.0.0 → 2.1.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 (62) hide show
  1. package/README.md +6 -1
  2. package/dist/cli.js +711 -59
  3. package/dist/index.js +5 -3
  4. package/dist/lib/__tests__/active-learning.test.js +386 -0
  5. package/dist/lib/__tests__/agent-performance-profiles.test.js +325 -0
  6. package/dist/lib/__tests__/auto-session.test.js +661 -0
  7. package/dist/lib/__tests__/context-assembly.test.js +362 -0
  8. package/dist/lib/__tests__/graph-expansion.test.js +150 -0
  9. package/dist/lib/__tests__/integration-memory-crud.test.js +797 -0
  10. package/dist/lib/__tests__/integration-memory-system.test.js +281 -0
  11. package/dist/lib/__tests__/lifecycle-maintenance.test.js +207 -0
  12. package/dist/lib/__tests__/pattern-detection.test.js +295 -0
  13. package/dist/lib/__tests__/prompt-builder.test.js +418 -0
  14. package/dist/lib/active-learning.js +878 -0
  15. package/dist/lib/api-client.js +550 -0
  16. package/dist/lib/auto-session.js +173 -0
  17. package/dist/lib/cli.js +127 -0
  18. package/dist/lib/config.js +205 -0
  19. package/dist/lib/consolidation.js +243 -0
  20. package/dist/lib/context-assembly.js +606 -0
  21. package/dist/lib/graph-expansion.js +163 -0
  22. package/dist/lib/http.js +174 -0
  23. package/dist/lib/index.js +7 -0
  24. package/dist/lib/lifecycle-maintenance.js +88 -0
  25. package/dist/lib/prompt-builder.js +483 -0
  26. package/dist/lib/remote.js +166 -0
  27. package/dist/lib/server.js +3132 -0
  28. package/dist/lib/tui/agents.js +116 -0
  29. package/dist/lib/tui/docs.js +744 -0
  30. package/dist/lib/tui/setup.js +1068 -0
  31. package/dist/lib/tui/theme.js +95 -0
  32. package/dist/lib/tui/writer.js +200 -0
  33. package/package.json +15 -6
  34. package/src/__tests__/active-learning.test.ts +483 -0
  35. package/src/__tests__/agent-performance-profiles.test.ts +468 -0
  36. package/src/__tests__/auto-session.test.ts +912 -0
  37. package/src/__tests__/context-assembly.test.ts +506 -0
  38. package/src/__tests__/graph-expansion.test.ts +285 -0
  39. package/src/__tests__/integration-memory-crud.test.ts +948 -0
  40. package/src/__tests__/integration-memory-system.test.ts +321 -0
  41. package/src/__tests__/lifecycle-maintenance.test.ts +238 -0
  42. package/src/__tests__/pattern-detection.test.ts +438 -0
  43. package/src/__tests__/prompt-builder.test.ts +505 -0
  44. package/src/active-learning.ts +1227 -0
  45. package/src/api-client.ts +969 -0
  46. package/src/auto-session.ts +218 -0
  47. package/src/cli.ts +166 -0
  48. package/src/config.ts +285 -0
  49. package/src/consolidation.ts +314 -0
  50. package/src/context-assembly.ts +842 -0
  51. package/src/graph-expansion.ts +234 -0
  52. package/src/http.ts +265 -0
  53. package/src/index.ts +8 -0
  54. package/src/lifecycle-maintenance.ts +120 -0
  55. package/src/prompt-builder.ts +681 -0
  56. package/src/remote.ts +227 -0
  57. package/src/server.ts +3858 -0
  58. package/src/tui/agents.ts +154 -0
  59. package/src/tui/docs.ts +863 -0
  60. package/src/tui/setup.ts +1281 -0
  61. package/src/tui/theme.ts +114 -0
  62. package/src/tui/writer.ts +260 -0
@@ -0,0 +1,116 @@
1
+ import { existsSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ const AGENT_DEFINITIONS = [
5
+ {
6
+ id: "claude",
7
+ name: "Claude Code",
8
+ description: "Anthropic CLI agent",
9
+ hint: "/hmy <card>",
10
+ globalPaths: [join(homedir(), ".claude")],
11
+ localPaths: [".claude"],
12
+ },
13
+ {
14
+ id: "codex",
15
+ name: "Codex",
16
+ description: "OpenAI coding agent",
17
+ hint: "/prompts:hmy <card>",
18
+ globalPaths: [join(homedir(), ".codex")],
19
+ localPaths: ["AGENTS.md"],
20
+ },
21
+ {
22
+ id: "cursor",
23
+ name: "Cursor",
24
+ description: "AI-powered IDE",
25
+ hint: "MCP tools available automatically",
26
+ globalPaths: [],
27
+ localPaths: [".cursor", ".cursorrules"],
28
+ },
29
+ {
30
+ id: "windsurf",
31
+ name: "Windsurf",
32
+ description: "Codeium AI IDE",
33
+ hint: "MCP tools available automatically",
34
+ globalPaths: [join(homedir(), ".codeium", "windsurf")],
35
+ localPaths: [".windsurf", ".windsurfrules"],
36
+ },
37
+ ];
38
+ /**
39
+ * Detect installed agents by checking for config directories
40
+ */
41
+ export function detectAgents(cwd = process.cwd()) {
42
+ return AGENT_DEFINITIONS.map((def) => {
43
+ // Check global paths
44
+ const globalPath = def.globalPaths.find((p) => existsSync(p)) || null;
45
+ // Check local paths
46
+ const localPath = def.localPaths.find((p) => existsSync(join(cwd, p))) || null;
47
+ return {
48
+ id: def.id,
49
+ name: def.name,
50
+ detected: !!(globalPath || localPath),
51
+ globalPath,
52
+ localPath: localPath ? join(cwd, localPath) : null,
53
+ description: def.description,
54
+ hint: def.hint,
55
+ };
56
+ });
57
+ }
58
+ /**
59
+ * Get agent by ID
60
+ */
61
+ export function getAgentById(id) {
62
+ return AGENT_DEFINITIONS.find((def) => def.id === id);
63
+ }
64
+ /**
65
+ * Get all supported agent IDs
66
+ */
67
+ export function getSupportedAgentIds() {
68
+ return AGENT_DEFINITIONS.map((def) => def.id);
69
+ }
70
+ /**
71
+ * Get config paths that will be created for an agent
72
+ */
73
+ export function getAgentConfigPaths(agentId, cwd = process.cwd()) {
74
+ const home = homedir();
75
+ switch (agentId) {
76
+ case "claude":
77
+ return {
78
+ global: [join(home, ".claude", "settings.json")],
79
+ local: [join(cwd, ".claude", "skills", "hmy", "SKILL.md")],
80
+ };
81
+ case "codex":
82
+ return {
83
+ global: [
84
+ join(home, ".codex", "config.toml"),
85
+ join(home, ".codex", "prompts", "hmy.md"),
86
+ ],
87
+ local: [join(cwd, "AGENTS.md")],
88
+ };
89
+ case "cursor":
90
+ return {
91
+ global: [],
92
+ local: [
93
+ join(cwd, ".cursor", "mcp.json"),
94
+ join(cwd, ".cursor", "rules", "harmony.mdc"),
95
+ ],
96
+ };
97
+ case "windsurf":
98
+ return {
99
+ global: [join(home, ".codeium", "windsurf", "mcp_config.json")],
100
+ local: [join(cwd, ".windsurf", "rules", "harmony.md")],
101
+ };
102
+ default:
103
+ return { global: [], local: [] };
104
+ }
105
+ }
106
+ /**
107
+ * Format agent for display in selection
108
+ */
109
+ export function formatAgentOption(agent) {
110
+ const status = agent.detected ? "(detected)" : "(not detected)";
111
+ return {
112
+ value: agent.id,
113
+ label: `${agent.name}`,
114
+ hint: `${agent.description} ${status}`,
115
+ };
116
+ }