@gethmy/mcp 2.3.0 → 2.3.2

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 (38) hide show
  1. package/dist/cli.js +80 -23
  2. package/dist/index.js +80 -23
  3. package/dist/lib/active-learning.js +939 -787
  4. package/dist/lib/api-client.js +2527 -638
  5. package/dist/lib/auto-session.js +177 -196
  6. package/dist/lib/cli.js +34954 -128
  7. package/dist/lib/config.js +235 -201
  8. package/dist/lib/consolidation.js +374 -289
  9. package/dist/lib/context-assembly.js +1265 -838
  10. package/dist/lib/graph-expansion.js +139 -155
  11. package/dist/lib/http.js +1917 -130
  12. package/dist/lib/index.js +29525 -5
  13. package/dist/lib/lifecycle-maintenance.js +663 -79
  14. package/dist/lib/memory-cleanup.js +1316 -381
  15. package/dist/lib/onboard.js +2588 -32
  16. package/dist/lib/prompt-builder.js +438 -445
  17. package/dist/lib/remote.js +31733 -143
  18. package/dist/lib/server.js +29389 -3216
  19. package/dist/lib/skills.js +315 -132
  20. package/dist/lib/tui/agents.js +128 -107
  21. package/dist/lib/tui/docs.js +1590 -687
  22. package/dist/lib/tui/setup.js +5698 -804
  23. package/dist/lib/tui/theme.js +183 -86
  24. package/dist/lib/tui/writer.js +1149 -176
  25. package/package.json +2 -2
  26. package/src/api-client.ts +37 -1
  27. package/src/memory-cleanup.ts +92 -52
  28. package/src/server.ts +16 -1
  29. package/dist/lib/__tests__/active-learning.test.js +0 -386
  30. package/dist/lib/__tests__/agent-performance-profiles.test.js +0 -325
  31. package/dist/lib/__tests__/auto-session.test.js +0 -661
  32. package/dist/lib/__tests__/context-assembly.test.js +0 -362
  33. package/dist/lib/__tests__/graph-expansion.test.js +0 -150
  34. package/dist/lib/__tests__/integration-memory-crud.test.js +0 -797
  35. package/dist/lib/__tests__/integration-memory-system.test.js +0 -281
  36. package/dist/lib/__tests__/lifecycle-maintenance.test.js +0 -207
  37. package/dist/lib/__tests__/pattern-detection.test.js +0 -295
  38. package/dist/lib/__tests__/prompt-builder.test.js +0 -418
@@ -1,116 +1,137 @@
1
+ import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
28
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
29
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
30
+
31
+ // src/tui/agents.ts
1
32
  import { existsSync } from "node:fs";
2
33
  import { homedir } from "node:os";
3
34
  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
- },
35
+ var AGENT_DEFINITIONS = [
36
+ {
37
+ id: "claude",
38
+ name: "Claude Code",
39
+ description: "Anthropic CLI agent",
40
+ hint: "/hmy <card>",
41
+ globalPaths: [join(homedir(), ".claude")],
42
+ localPaths: [".claude"]
43
+ },
44
+ {
45
+ id: "codex",
46
+ name: "Codex",
47
+ description: "OpenAI coding agent",
48
+ hint: "/prompts:hmy <card>",
49
+ globalPaths: [join(homedir(), ".codex")],
50
+ localPaths: ["AGENTS.md"]
51
+ },
52
+ {
53
+ id: "cursor",
54
+ name: "Cursor",
55
+ description: "AI-powered IDE",
56
+ hint: "MCP tools available automatically",
57
+ globalPaths: [],
58
+ localPaths: [".cursor", ".cursorrules"]
59
+ },
60
+ {
61
+ id: "windsurf",
62
+ name: "Windsurf",
63
+ description: "Codeium AI IDE",
64
+ hint: "MCP tools available automatically",
65
+ globalPaths: [join(homedir(), ".codeium", "windsurf")],
66
+ localPaths: [".windsurf", ".windsurfrules"]
67
+ }
37
68
  ];
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
- });
69
+ function detectAgents(cwd = process.cwd()) {
70
+ return AGENT_DEFINITIONS.map((def) => {
71
+ const globalPath = def.globalPaths.find((p) => existsSync(p)) || null;
72
+ const localPath = def.localPaths.find((p) => existsSync(join(cwd, p))) || null;
73
+ return {
74
+ id: def.id,
75
+ name: def.name,
76
+ detected: !!(globalPath || localPath),
77
+ globalPath,
78
+ localPath: localPath ? join(cwd, localPath) : null,
79
+ description: def.description,
80
+ hint: def.hint
81
+ };
82
+ });
57
83
  }
58
- /**
59
- * Get agent by ID
60
- */
61
- export function getAgentById(id) {
62
- return AGENT_DEFINITIONS.find((def) => def.id === id);
84
+ function getAgentById(id) {
85
+ return AGENT_DEFINITIONS.find((def) => def.id === id);
63
86
  }
64
- /**
65
- * Get all supported agent IDs
66
- */
67
- export function getSupportedAgentIds() {
68
- return AGENT_DEFINITIONS.map((def) => def.id);
87
+ function getSupportedAgentIds() {
88
+ return AGENT_DEFINITIONS.map((def) => def.id);
69
89
  }
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
- }
90
+ function getAgentConfigPaths(agentId, cwd = process.cwd()) {
91
+ const home = homedir();
92
+ switch (agentId) {
93
+ case "claude":
94
+ return {
95
+ global: [join(home, ".claude", "settings.json")],
96
+ local: [join(cwd, ".claude", "skills", "hmy", "SKILL.md")]
97
+ };
98
+ case "codex":
99
+ return {
100
+ global: [
101
+ join(home, ".codex", "config.toml"),
102
+ join(home, ".codex", "prompts", "hmy.md")
103
+ ],
104
+ local: [join(cwd, "AGENTS.md")]
105
+ };
106
+ case "cursor":
107
+ return {
108
+ global: [],
109
+ local: [
110
+ join(cwd, ".cursor", "mcp.json"),
111
+ join(cwd, ".cursor", "rules", "harmony.mdc")
112
+ ]
113
+ };
114
+ case "windsurf":
115
+ return {
116
+ global: [join(home, ".codeium", "windsurf", "mcp_config.json")],
117
+ local: [join(cwd, ".windsurf", "rules", "harmony.md")]
118
+ };
119
+ default:
120
+ return { global: [], local: [] };
121
+ }
105
122
  }
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
- };
123
+ function formatAgentOption(agent) {
124
+ const status = agent.detected ? "(detected)" : "(not detected)";
125
+ return {
126
+ value: agent.id,
127
+ label: `${agent.name}`,
128
+ hint: `${agent.description} ${status}`
129
+ };
116
130
  }
131
+ export {
132
+ getSupportedAgentIds,
133
+ getAgentConfigPaths,
134
+ getAgentById,
135
+ formatAgentOption,
136
+ detectAgents
137
+ };