termify-agent 1.0.38 → 1.0.40
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/binaries/wireguard-go-darwin-arm64 +0 -0
- package/binaries/wireguard-go-darwin-x64 +0 -0
- package/binaries/wireguard-go-linux-arm64 +0 -0
- package/binaries/wireguard-go-linux-x64 +0 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +2 -0
- package/dist/agent.js.map +1 -1
- package/dist/dashboard.d.ts +2 -0
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/dashboard.js +33 -2
- package/dist/dashboard.js.map +1 -1
- package/dist/index.js +73 -1
- package/dist/index.js.map +1 -1
- package/dist/pty-manager.d.ts +19 -0
- package/dist/pty-manager.d.ts.map +1 -1
- package/dist/pty-manager.js +111 -0
- package/dist/pty-manager.js.map +1 -1
- package/dist/setup.d.ts +15 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +603 -0
- package/dist/setup.js.map +1 -0
- package/mcp/memsearch-mcp-server.mjs +149 -0
- package/package.json +3 -2
- package/plugins/context7/.claude-plugin/plugin.json +7 -0
- package/plugins/context7/.mcp.json +6 -0
- package/plugins/memsearch/.claude-plugin/plugin.json +5 -0
- package/plugins/memsearch/README.md +762 -0
- package/plugins/memsearch/hooks/common.sh +151 -0
- package/plugins/memsearch/hooks/hooks.json +50 -0
- package/plugins/memsearch/hooks/parse-transcript.sh +117 -0
- package/plugins/memsearch/hooks/session-end.sh +9 -0
- package/plugins/memsearch/hooks/session-start.sh +119 -0
- package/plugins/memsearch/hooks/stop.sh +117 -0
- package/plugins/memsearch/hooks/user-prompt-submit.sh +21 -0
- package/plugins/memsearch/scripts/derive-collection.sh +50 -0
- package/plugins/memsearch/skills/memory-recall/SKILL.md +42 -0
- package/scripts/postinstall.js +48 -447
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* memsearch MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Wraps the memsearch CLI as an MCP server (stdio transport).
|
|
6
|
+
* Provides search, index, and stats tools for any MCP-compatible client.
|
|
7
|
+
*
|
|
8
|
+
* Usage: node server.mjs
|
|
9
|
+
* Requires: memsearch installed and in PATH
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { createInterface } from 'readline';
|
|
13
|
+
import { execSync } from 'child_process';
|
|
14
|
+
|
|
15
|
+
const rl = createInterface({ input: process.stdin, terminal: false });
|
|
16
|
+
|
|
17
|
+
function findMemsearch() {
|
|
18
|
+
const paths = [
|
|
19
|
+
'memsearch',
|
|
20
|
+
`${process.env.HOME}/.local/bin/memsearch`,
|
|
21
|
+
'/usr/local/bin/memsearch',
|
|
22
|
+
];
|
|
23
|
+
for (const p of paths) {
|
|
24
|
+
try {
|
|
25
|
+
execSync(`${p} --version`, { stdio: 'pipe' });
|
|
26
|
+
return p;
|
|
27
|
+
} catch {}
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const MEMSEARCH = findMemsearch();
|
|
33
|
+
|
|
34
|
+
function respond(id, result) {
|
|
35
|
+
const msg = JSON.stringify({ jsonrpc: '2.0', id, result });
|
|
36
|
+
process.stdout.write(msg + '\n');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function respondError(id, code, message) {
|
|
40
|
+
const msg = JSON.stringify({ jsonrpc: '2.0', id, error: { code, message } });
|
|
41
|
+
process.stdout.write(msg + '\n');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function handleRequest(req) {
|
|
45
|
+
const { id, method, params } = req;
|
|
46
|
+
|
|
47
|
+
if (method === 'initialize') {
|
|
48
|
+
return respond(id, {
|
|
49
|
+
protocolVersion: '2024-11-05',
|
|
50
|
+
capabilities: { tools: { listChanged: false } },
|
|
51
|
+
serverInfo: { name: 'memsearch-mcp', version: '1.0.0' },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (method === 'notifications/initialized') return;
|
|
56
|
+
|
|
57
|
+
if (method === 'tools/list') {
|
|
58
|
+
return respond(id, {
|
|
59
|
+
tools: [
|
|
60
|
+
{
|
|
61
|
+
name: 'memsearch_search',
|
|
62
|
+
description: 'Search indexed memory/knowledge base for relevant information. Returns semantically similar chunks.',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
query: { type: 'string', description: 'Search query' },
|
|
67
|
+
limit: { type: 'number', description: 'Max results (default: 5)', default: 5 },
|
|
68
|
+
},
|
|
69
|
+
required: ['query'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'memsearch_index',
|
|
74
|
+
description: 'Index a markdown file into the memory/knowledge base for future search.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
path: { type: 'string', description: 'Path to markdown file to index' },
|
|
79
|
+
},
|
|
80
|
+
required: ['path'],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'memsearch_stats',
|
|
85
|
+
description: 'Show statistics about the indexed memory (number of chunks, collections, etc.)',
|
|
86
|
+
inputSchema: { type: 'object', properties: {} },
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (method === 'tools/call') {
|
|
93
|
+
if (!MEMSEARCH) {
|
|
94
|
+
return respond(id, {
|
|
95
|
+
content: [{ type: 'text', text: 'Error: memsearch not found in PATH. Install with: uv tool install "memsearch[local]"' }],
|
|
96
|
+
isError: true,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const { name, arguments: args } = params;
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
let output;
|
|
104
|
+
if (name === 'memsearch_search') {
|
|
105
|
+
const limit = args.limit || 5;
|
|
106
|
+
output = execSync(`${MEMSEARCH} search "${args.query.replace(/"/g, '\\"')}" --top-k ${limit}`, {
|
|
107
|
+
encoding: 'utf-8',
|
|
108
|
+
timeout: 30000,
|
|
109
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
110
|
+
});
|
|
111
|
+
} else if (name === 'memsearch_index') {
|
|
112
|
+
output = execSync(`${MEMSEARCH} index "${args.path.replace(/"/g, '\\"')}"`, {
|
|
113
|
+
encoding: 'utf-8',
|
|
114
|
+
timeout: 60000,
|
|
115
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
116
|
+
});
|
|
117
|
+
} else if (name === 'memsearch_stats') {
|
|
118
|
+
output = execSync(`${MEMSEARCH} stats`, {
|
|
119
|
+
encoding: 'utf-8',
|
|
120
|
+
timeout: 10000,
|
|
121
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
return respondError(id, -32601, `Unknown tool: ${name}`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return respond(id, {
|
|
128
|
+
content: [{ type: 'text', text: output || '(no output)' }],
|
|
129
|
+
});
|
|
130
|
+
} catch (e) {
|
|
131
|
+
return respond(id, {
|
|
132
|
+
content: [{ type: 'text', text: `Error: ${e.stderr || e.message}` }],
|
|
133
|
+
isError: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (id) respondError(id, -32601, `Method not found: ${method}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
rl.on('line', (line) => {
|
|
142
|
+
try {
|
|
143
|
+
handleRequest(JSON.parse(line));
|
|
144
|
+
} catch (e) {
|
|
145
|
+
process.stderr.write(`Parse error: ${e.message}\n`);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
process.stderr.write('[memsearch-mcp] Running on stdio\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "termify-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"description": "Termify Agent CLI - Connect your local terminal to Termify",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"scripts",
|
|
58
58
|
"binaries",
|
|
59
59
|
"mcp",
|
|
60
|
-
"hooks"
|
|
60
|
+
"hooks",
|
|
61
|
+
"plugins"
|
|
61
62
|
]
|
|
62
63
|
}
|