@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.
- package/dist/cli.js +80 -23
- package/dist/index.js +80 -23
- package/dist/lib/active-learning.js +939 -787
- package/dist/lib/api-client.js +2527 -638
- package/dist/lib/auto-session.js +177 -196
- package/dist/lib/cli.js +34954 -128
- package/dist/lib/config.js +235 -201
- package/dist/lib/consolidation.js +374 -289
- package/dist/lib/context-assembly.js +1265 -838
- package/dist/lib/graph-expansion.js +139 -155
- package/dist/lib/http.js +1917 -130
- package/dist/lib/index.js +29525 -5
- package/dist/lib/lifecycle-maintenance.js +663 -79
- package/dist/lib/memory-cleanup.js +1316 -381
- package/dist/lib/onboard.js +2588 -32
- package/dist/lib/prompt-builder.js +438 -445
- package/dist/lib/remote.js +31733 -143
- package/dist/lib/server.js +29389 -3216
- package/dist/lib/skills.js +315 -132
- package/dist/lib/tui/agents.js +128 -107
- package/dist/lib/tui/docs.js +1590 -687
- package/dist/lib/tui/setup.js +5698 -804
- package/dist/lib/tui/theme.js +183 -86
- package/dist/lib/tui/writer.js +1149 -176
- package/package.json +2 -2
- package/src/api-client.ts +37 -1
- package/src/memory-cleanup.ts +92 -52
- package/src/server.ts +16 -1
- package/dist/lib/__tests__/active-learning.test.js +0 -386
- package/dist/lib/__tests__/agent-performance-profiles.test.js +0 -325
- package/dist/lib/__tests__/auto-session.test.js +0 -661
- package/dist/lib/__tests__/context-assembly.test.js +0 -362
- package/dist/lib/__tests__/graph-expansion.test.js +0 -150
- package/dist/lib/__tests__/integration-memory-crud.test.js +0 -797
- package/dist/lib/__tests__/integration-memory-system.test.js +0 -281
- package/dist/lib/__tests__/lifecycle-maintenance.test.js +0 -207
- package/dist/lib/__tests__/pattern-detection.test.js +0 -295
- package/dist/lib/__tests__/prompt-builder.test.js +0 -418
package/dist/lib/tui/agents.js
CHANGED
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
+
};
|