@xmemo/client 0.4.164 → 0.4.166
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/LICENSE +19 -5
- package/bin/mcp-stdio.js +30 -0
- package/package.json +2 -2
- package/src/config/paths.js +1 -0
- package/src/config/profile.js +16 -1
- package/src/mcp/clients.js +2 -0
- package/src/mcp/formats/json.js +15 -0
- package/src/mcp/identity/paths.js +5 -0
- package/src/ui/setup.js +3 -0
package/LICENSE
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2025-2026 Yonro
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/mcp-stdio.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* XMemo MCP stdio server — thin local proxy for Glama quality tests and
|
|
4
|
+
* clients that only support stdio transport.
|
|
5
|
+
*
|
|
6
|
+
* Reads XMEMO_KEY and XMEMO_URL from environment, forwards all MCP
|
|
7
|
+
* JSON-RPC messages to the hosted endpoint over Streamable HTTP.
|
|
8
|
+
*/
|
|
9
|
+
import { spawn } from 'node:child_process';
|
|
10
|
+
import { resolve, dirname } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const mcpRemoteBin = resolve(__dirname, '..', 'node_modules', '.bin', 'mcp-remote');
|
|
15
|
+
const url = process.env.XMEMO_URL
|
|
16
|
+
? `${process.env.XMEMO_URL.replace(/\/$/, '')}/mcp`
|
|
17
|
+
: 'https://xmemo.dev/mcp';
|
|
18
|
+
const token = process.env.XMEMO_KEY ?? '';
|
|
19
|
+
|
|
20
|
+
const args = [url];
|
|
21
|
+
if (token) {
|
|
22
|
+
args.push('--header', `Authorization:Bearer ${token}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const child = spawn(process.execPath, [mcpRemoteBin, ...args], {
|
|
26
|
+
stdio: ['inherit', 'inherit', 'inherit'],
|
|
27
|
+
env: { ...process.env }
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on('exit', (code) => process.exit(code ?? 1));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmemo/client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.166",
|
|
4
4
|
"description": "Privacy-first CLI and MCP setup helper for XMemo.",
|
|
5
5
|
"mcpName": "io.github.yonro/xmemo",
|
|
6
6
|
"type": "module",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"cli",
|
|
45
45
|
"privacy"
|
|
46
46
|
],
|
|
47
|
-
"license": "
|
|
47
|
+
"license": "MIT"
|
|
48
48
|
}
|
package/src/config/paths.js
CHANGED
package/src/config/profile.js
CHANGED
|
@@ -131,6 +131,21 @@ export function profileClientConfig(clientId) {
|
|
|
131
131
|
return path.join(userHome(env), '.kiro', 'steering', 'AGENTS.md');
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
'kimi-code': {
|
|
135
|
+
label: 'Kimi Code',
|
|
136
|
+
setupAlias: 'kimi',
|
|
137
|
+
profileVersion: 'kimi-code-mcp-depth-v1',
|
|
138
|
+
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
139
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
140
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
141
|
+
defaultTarget: (env) => {
|
|
142
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
143
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.kimi-code')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
144
|
+
return path.join(process.cwd(), '.kimi-code', 'AGENTS.md');
|
|
145
|
+
}
|
|
146
|
+
return path.join(userHome(env), '.kimi-code', 'AGENTS.md');
|
|
147
|
+
}
|
|
148
|
+
},
|
|
134
149
|
'gemini-cli': {
|
|
135
150
|
label: 'Gemini CLI',
|
|
136
151
|
setupAlias: 'gemini',
|
|
@@ -222,7 +237,7 @@ export function profileClientConfig(clientId) {
|
|
|
222
237
|
}
|
|
223
238
|
|
|
224
239
|
export function supportedProfileClientIds() {
|
|
225
|
-
return ['codex', 'cursor', 'kiro', 'gemini', 'antigravity', 'qwen', 'opencode', 'trae', 'trae-solo'];
|
|
240
|
+
return ['codex', 'cursor', 'kiro', 'kimi-code', 'gemini', 'antigravity', 'qwen', 'opencode', 'trae', 'trae-solo'];
|
|
226
241
|
}
|
|
227
242
|
|
|
228
243
|
export function defaultProfileTarget(clientId, env) {
|
package/src/mcp/clients.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
defaultGrokConfigPath,
|
|
29
29
|
defaultHermesConfigPath,
|
|
30
30
|
defaultJetbrainsConfigPath,
|
|
31
|
+
defaultKimiCodeConfigPath,
|
|
31
32
|
defaultKiroConfigPath,
|
|
32
33
|
defaultOpencodeConfigPath,
|
|
33
34
|
defaultOpenclawConfigPath,
|
|
@@ -70,6 +71,7 @@ export const MCP_CLIENTS = createMcpClients({
|
|
|
70
71
|
defaultKiroConfigPath,
|
|
71
72
|
defaultZedConfigPath,
|
|
72
73
|
defaultJetbrainsConfigPath,
|
|
74
|
+
defaultKimiCodeConfigPath,
|
|
73
75
|
defaultOpencodeConfigPath,
|
|
74
76
|
defaultQwenConfigPath,
|
|
75
77
|
defaultTraeConfigPath,
|
package/src/mcp/formats/json.js
CHANGED
|
@@ -31,6 +31,7 @@ export const JSON_MCP_CLIENT_DEFINITIONS = Object.freeze([
|
|
|
31
31
|
commandClientDefinition('claude-desktop', 'Claude Desktop', 'defaultClaudeConfigPath'),
|
|
32
32
|
httpClientDefinition('openclaw', 'OpenClaw', 'defaultOpenclawConfigPath', { urlKey: 'url', authentication: 'env-bearer' }),
|
|
33
33
|
commandClientDefinition('kiro', 'Kiro', 'defaultKiroConfigPath'),
|
|
34
|
+
httpClientDefinition('kimi-code', 'Kimi Code', 'defaultKimiCodeConfigPath', { urlKey: 'url', authentication: 'bearer-token-env-var', bearerTokenEnvVar: 'XMEMO_KEY' }),
|
|
34
35
|
commandClientDefinition('zed', 'Zed', 'defaultZedConfigPath', { section: 'context_servers' }),
|
|
35
36
|
nestedTransportClientDefinition('jetbrains', 'JetBrains', 'defaultJetbrainsConfigPath'),
|
|
36
37
|
remoteClientDefinition('opencode', 'OpenCode', 'defaultOpencodeConfigPath'),
|
|
@@ -167,6 +168,15 @@ function serverConfigFromDefinition(definition, mcpUrl, identity) {
|
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
if (definition.authentication === 'bearer-token-env-var') {
|
|
172
|
+
return {
|
|
173
|
+
...(definition.extra ?? {}),
|
|
174
|
+
[definition.urlKey]: mcpUrl,
|
|
175
|
+
bearerTokenEnvVar: definition.bearerTokenEnvVar,
|
|
176
|
+
headers: headersForDefinition(definition, identity)
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
170
180
|
return {
|
|
171
181
|
...(definition.extra ?? {}),
|
|
172
182
|
[definition.urlKey]: mcpUrl,
|
|
@@ -353,3 +363,8 @@ export const claudecodeJsonSnippet = (mcpUrl, identity = envReferenceIdentity('c
|
|
|
353
363
|
export const claudecodeJsonServerConfig = (mcpUrl, identity = envReferenceIdentity('claude-code')) => jsonClientServerConfig('claude-code', mcpUrl, identity);
|
|
354
364
|
export const mergeClaudecodeMcpConfig = (configPath, mcpUrl, identity) => mergeJsonClientMcpConfig('claude-code', configPath, mcpUrl, identity);
|
|
355
365
|
|
|
366
|
+
export const kimiCodeJsonConfig = (mcpUrl, identity = envReferenceIdentity('kimi-code')) => jsonClientConfig('kimi-code', mcpUrl, identity);
|
|
367
|
+
export const kimiCodeJsonSnippet = (mcpUrl, identity = envReferenceIdentity('kimi-code')) => jsonClientSnippet('kimi-code', mcpUrl, identity);
|
|
368
|
+
export const kimiCodeJsonServerConfig = (mcpUrl, identity = envReferenceIdentity('kimi-code')) => jsonClientServerConfig('kimi-code', mcpUrl, identity);
|
|
369
|
+
export const mergeKimiCodeMcpConfig = (configPath, mcpUrl, identity) => mergeJsonClientMcpConfig('kimi-code', configPath, mcpUrl, identity);
|
|
370
|
+
|
|
@@ -158,3 +158,8 @@ export function defaultGrokConfigPath(env) {
|
|
|
158
158
|
return path.join(home, '.grok', 'config.toml');
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
export function defaultKimiCodeConfigPath(env) {
|
|
162
|
+
const home = env.USERPROFILE || env.HOME || os.homedir();
|
|
163
|
+
return path.join(home, '.kimi-code', 'mcp.json');
|
|
164
|
+
}
|
|
165
|
+
|
package/src/ui/setup.js
CHANGED
|
@@ -34,6 +34,9 @@ const SETUP_CLIENT_ALIASES = new Map([
|
|
|
34
34
|
['claude-desktop', 'claude-desktop'],
|
|
35
35
|
['openclaw', 'openclaw'],
|
|
36
36
|
['kiro', 'kiro'],
|
|
37
|
+
['kimi', 'kimi-code'],
|
|
38
|
+
['kimi-code', 'kimi-code'],
|
|
39
|
+
['kimi-cli', 'kimi-code'],
|
|
37
40
|
['zed', 'zed'],
|
|
38
41
|
['jetbrains', 'jetbrains'],
|
|
39
42
|
['opencode', 'opencode'],
|