@xmemo/client 0.4.153 → 0.4.155
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/package.json +1 -1
- package/src/cli.js +87 -15
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ const PACKAGE_NAME = '@xmemo/client';
|
|
|
11
11
|
const FALLBACK_PACKAGE_NAME = '@yonro/xmemo-client';
|
|
12
12
|
const COMMAND_NAME = 'xmemo';
|
|
13
13
|
const LEGACY_COMMAND_NAME = 'memory-os';
|
|
14
|
-
const CLI_VERSION = '0.4.
|
|
14
|
+
const CLI_VERSION = '0.4.155';
|
|
15
15
|
const DEFAULT_SERVICE_URL = 'https://xmemo.dev';
|
|
16
16
|
const TOKEN_ENV_VAR = 'XMEMO_KEY';
|
|
17
17
|
const LEGACY_TOKEN_ENV_VAR = 'MEMORY_OS_MCP_TOKEN';
|
|
@@ -27,7 +27,9 @@ const CODEX_PROFILE_MARKER_END = '<!-- memory-os:codex-profile:end -->';
|
|
|
27
27
|
const CLIENT_PROFILE_TARGETS = {
|
|
28
28
|
cursor: '.cursor/rules/xmemo-memory.md',
|
|
29
29
|
'gemini-cli': 'GEMINI.md',
|
|
30
|
-
antigravity: 'GEMINI.md'
|
|
30
|
+
antigravity: 'GEMINI.md',
|
|
31
|
+
trae: '.trae/rules/xmemo-memory.md',
|
|
32
|
+
'trae-solo': '.trae/rules/xmemo-memory.md'
|
|
31
33
|
};
|
|
32
34
|
const CLIENT_PROFILE_MARKER_START = '<!-- xmemo:profile:start -->';
|
|
33
35
|
const CLIENT_PROFILE_MARKER_END = '<!-- xmemo:profile:end -->';
|
|
@@ -2167,13 +2169,45 @@ function profileClientConfig(clientId) {
|
|
|
2167
2169
|
return path.join(userHome(env), '.config', 'opencode', 'AGENTS.md');
|
|
2168
2170
|
},
|
|
2169
2171
|
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
2172
|
+
},
|
|
2173
|
+
trae: {
|
|
2174
|
+
label: 'Trae',
|
|
2175
|
+
setupAlias: 'trae',
|
|
2176
|
+
profileVersion: 'trae-mcp-depth-v1',
|
|
2177
|
+
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
2178
|
+
markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:trae:start -->`,
|
|
2179
|
+
markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:trae:end -->`,
|
|
2180
|
+
defaultTarget: (env) => {
|
|
2181
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
2182
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.trae')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
2183
|
+
return path.join(process.cwd(), '.trae', 'rules', 'xmemo-memory.md');
|
|
2184
|
+
}
|
|
2185
|
+
return path.join(userHome(env), '.trae', 'memory-profile.md');
|
|
2186
|
+
},
|
|
2187
|
+
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
2188
|
+
},
|
|
2189
|
+
'trae-solo': {
|
|
2190
|
+
label: 'Trae Solo',
|
|
2191
|
+
setupAlias: 'trae-solo',
|
|
2192
|
+
profileVersion: 'trae-solo-mcp-depth-v1',
|
|
2193
|
+
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
2194
|
+
markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:trae-solo:start -->`,
|
|
2195
|
+
markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:trae-solo:end -->`,
|
|
2196
|
+
defaultTarget: (env) => {
|
|
2197
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
2198
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.trae')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
2199
|
+
return path.join(process.cwd(), '.trae', 'rules', 'xmemo-memory.md');
|
|
2200
|
+
}
|
|
2201
|
+
return path.join(userHome(env), '.trae', 'memory-profile.md');
|
|
2202
|
+
},
|
|
2203
|
+
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
2170
2204
|
}
|
|
2171
2205
|
};
|
|
2172
2206
|
return profileConfigs[clientId] ?? null;
|
|
2173
2207
|
}
|
|
2174
2208
|
|
|
2175
2209
|
function supportedProfileClientIds() {
|
|
2176
|
-
return ['codex', 'cursor', 'gemini', 'antigravity', 'qwen', 'opencode'];
|
|
2210
|
+
return ['codex', 'cursor', 'gemini', 'antigravity', 'qwen', 'opencode', 'trae', 'trae-solo'];
|
|
2177
2211
|
}
|
|
2178
2212
|
|
|
2179
2213
|
function defaultProfileTarget(clientId, env) {
|
|
@@ -3485,7 +3519,13 @@ function claudeJsonServerConfig(mcpUrl, identity = envReferenceIdentity('claude-
|
|
|
3485
3519
|
args: [
|
|
3486
3520
|
'-y',
|
|
3487
3521
|
'mcp-remote',
|
|
3488
|
-
mcpUrl
|
|
3522
|
+
mcpUrl,
|
|
3523
|
+
'--header',
|
|
3524
|
+
`Authorization:Bearer \${${TOKEN_ENV_VAR}}`,
|
|
3525
|
+
'--header',
|
|
3526
|
+
`X-Memory-OS-Agent-ID:${identity.agentId}`,
|
|
3527
|
+
'--header',
|
|
3528
|
+
`X-Memory-OS-Agent-Instance-ID:\${${AGENT_INSTANCE_ENV_VAR}}`
|
|
3489
3529
|
],
|
|
3490
3530
|
env: {
|
|
3491
3531
|
[TOKEN_ENV_VAR]: `\${env:${TOKEN_ENV_VAR}}`,
|
|
@@ -3633,7 +3673,13 @@ function zedJsonServerConfig(mcpUrl, identity = envReferenceIdentity('zed')) {
|
|
|
3633
3673
|
args: [
|
|
3634
3674
|
'-y',
|
|
3635
3675
|
'mcp-remote',
|
|
3636
|
-
mcpUrl
|
|
3676
|
+
mcpUrl,
|
|
3677
|
+
'--header',
|
|
3678
|
+
`Authorization:Bearer \${${TOKEN_ENV_VAR}}`,
|
|
3679
|
+
'--header',
|
|
3680
|
+
`X-Memory-OS-Agent-ID:${identity.agentId}`,
|
|
3681
|
+
'--header',
|
|
3682
|
+
`X-Memory-OS-Agent-Instance-ID:\${${AGENT_INSTANCE_ENV_VAR}}`
|
|
3637
3683
|
],
|
|
3638
3684
|
env: {
|
|
3639
3685
|
[TOKEN_ENV_VAR]: `\${env:${TOKEN_ENV_VAR}}`,
|
|
@@ -3755,6 +3801,12 @@ function hermesYamlSnippet(mcpUrl, identity = envReferenceIdentity('hermes')) {
|
|
|
3755
3801
|
- -y
|
|
3756
3802
|
- mcp-remote
|
|
3757
3803
|
- ${mcpUrl}
|
|
3804
|
+
- --header
|
|
3805
|
+
- "Authorization:Bearer \${${TOKEN_ENV_VAR}}"
|
|
3806
|
+
- --header
|
|
3807
|
+
- "X-Memory-OS-Agent-ID:${identity.agentId}"
|
|
3808
|
+
- --header
|
|
3809
|
+
- "X-Memory-OS-Agent-Instance-ID:\${${AGENT_INSTANCE_ENV_VAR}}"
|
|
3758
3810
|
env:
|
|
3759
3811
|
${TOKEN_ENV_VAR}: "\${env:${TOKEN_ENV_VAR}}"
|
|
3760
3812
|
${AGENT_INSTANCE_ENV_VAR}: "${identity.agentInstanceId}"
|
|
@@ -3852,11 +3904,21 @@ function defaultTraeConfigPath(env) {
|
|
|
3852
3904
|
|
|
3853
3905
|
function traeJsonServerConfig(mcpUrl, identity = envReferenceIdentity('trae')) {
|
|
3854
3906
|
return {
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3907
|
+
command: 'npx',
|
|
3908
|
+
args: [
|
|
3909
|
+
'-y',
|
|
3910
|
+
'mcp-remote',
|
|
3911
|
+
mcpUrl,
|
|
3912
|
+
'--header',
|
|
3913
|
+
`Authorization:Bearer \${${TOKEN_ENV_VAR}}`,
|
|
3914
|
+
'--header',
|
|
3915
|
+
`X-Memory-OS-Agent-ID:${identity.agentId}`,
|
|
3916
|
+
'--header',
|
|
3917
|
+
`X-Memory-OS-Agent-Instance-ID:\${${AGENT_INSTANCE_ENV_VAR}}`
|
|
3918
|
+
],
|
|
3919
|
+
env: {
|
|
3920
|
+
[TOKEN_ENV_VAR]: `\${env:${TOKEN_ENV_VAR}}`,
|
|
3921
|
+
[AGENT_INSTANCE_ENV_VAR]: identity.agentInstanceId
|
|
3860
3922
|
}
|
|
3861
3923
|
};
|
|
3862
3924
|
}
|
|
@@ -3906,11 +3968,21 @@ function defaultTraeSoloConfigPath(env) {
|
|
|
3906
3968
|
|
|
3907
3969
|
function traeSoloJsonServerConfig(mcpUrl, identity = envReferenceIdentity('trae-solo')) {
|
|
3908
3970
|
return {
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3971
|
+
command: 'npx',
|
|
3972
|
+
args: [
|
|
3973
|
+
'-y',
|
|
3974
|
+
'mcp-remote',
|
|
3975
|
+
mcpUrl,
|
|
3976
|
+
'--header',
|
|
3977
|
+
`Authorization:Bearer \${${TOKEN_ENV_VAR}}`,
|
|
3978
|
+
'--header',
|
|
3979
|
+
`X-Memory-OS-Agent-ID:${identity.agentId}`,
|
|
3980
|
+
'--header',
|
|
3981
|
+
`X-Memory-OS-Agent-Instance-ID:\${${AGENT_INSTANCE_ENV_VAR}}`
|
|
3982
|
+
],
|
|
3983
|
+
env: {
|
|
3984
|
+
[TOKEN_ENV_VAR]: `\${env:${TOKEN_ENV_VAR}}`,
|
|
3985
|
+
[AGENT_INSTANCE_ENV_VAR]: identity.agentInstanceId
|
|
3914
3986
|
}
|
|
3915
3987
|
};
|
|
3916
3988
|
}
|