@xmemo/client 0.4.157 → 0.4.158
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/plugins/kiro/.kiro-plugin/power.json +1 -1
- package/plugins/kiro/README.md +1 -1
- package/src/config/profile.js +32 -38
- package/src/core/constants.js +5 -5
- package/src/core/version.js +9 -1
- package/src/mcp/formats/json.js +5 -1
- /package/plugins/kiro/steering/{xmemo-memory.md → AGENTS.md} +0 -0
package/package.json
CHANGED
package/plugins/kiro/README.md
CHANGED
|
@@ -6,7 +6,7 @@ XMemo gives Kiro a hosted, user-owned memory layer for durable project context,
|
|
|
6
6
|
|
|
7
7
|
- `mcp.json` adds the hosted XMemo MCP server at `https://xmemo.dev/mcp`.
|
|
8
8
|
- `assets/logo.svg` reuses the canonical XMemo marketplace icon source used by the existing ChatGPT/Claude listing assets.
|
|
9
|
-
- `steering/
|
|
9
|
+
- `steering/AGENTS.md` tells Kiro when to use XMemo memory.
|
|
10
10
|
|
|
11
11
|
## Authentication
|
|
12
12
|
|
package/src/config/profile.js
CHANGED
|
@@ -4,6 +4,8 @@ import os from 'node:os';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
CLIENT_PROFILE_MARKER_END,
|
|
8
|
+
CLIENT_PROFILE_MARKER_START,
|
|
7
9
|
CODEX_PROFILE_MARKER_END,
|
|
8
10
|
CODEX_PROFILE_MARKER_START,
|
|
9
11
|
CODEX_PROFILE_TARGET,
|
|
@@ -51,7 +53,7 @@ function memoryBehaviorProfile(clientId) {
|
|
|
51
53
|
'After meaningful decisions, bug fixes, release steps, or durable conventions, write a concise XMemo memory with scope, source, and no secret values.',
|
|
52
54
|
'Never store tokens, API keys, cookies, private keys, raw credentials, or sensitive customer data in XMemo.',
|
|
53
55
|
'For routine or low-signal output, skip durable writes. Prefer summarized procedural or semantic memories over verbose logs.',
|
|
54
|
-
config.
|
|
56
|
+
'Keep XMemo authentication secure (using the XMEMO_KEY environment variable or client-managed OAuth); do not paste token values into prompts, config files, or logs.'
|
|
55
57
|
];
|
|
56
58
|
return {
|
|
57
59
|
client: clientId,
|
|
@@ -69,7 +71,7 @@ function memoryBehaviorProfile(clientId) {
|
|
|
69
71
|
function profileInstructionText(clientId) {
|
|
70
72
|
const profile = memoryBehaviorProfile(clientId);
|
|
71
73
|
const lines = [
|
|
72
|
-
|
|
74
|
+
'## XMemo Agent profile',
|
|
73
75
|
'',
|
|
74
76
|
`MCP server: \`${profile.mcpServerName}\``,
|
|
75
77
|
];
|
|
@@ -80,7 +82,7 @@ function profileInstructionText(clientId) {
|
|
|
80
82
|
'',
|
|
81
83
|
profile.objective,
|
|
82
84
|
'',
|
|
83
|
-
|
|
85
|
+
'Recommended Agent behavior:'
|
|
84
86
|
);
|
|
85
87
|
for (const instruction of profile.instructions) {
|
|
86
88
|
lines.push(`- ${instruction}`);
|
|
@@ -96,118 +98,110 @@ export function profileClientConfig(clientId) {
|
|
|
96
98
|
setupAlias: 'codex',
|
|
97
99
|
profileVersion: 'codex-mcp-depth-v1',
|
|
98
100
|
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
99
|
-
markerStart:
|
|
100
|
-
markerEnd:
|
|
101
|
-
defaultTarget: () => defaultCodexProfileTarget()
|
|
102
|
-
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
101
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
102
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
103
|
+
defaultTarget: () => defaultCodexProfileTarget()
|
|
103
104
|
},
|
|
104
105
|
cursor: {
|
|
105
106
|
label: 'Cursor',
|
|
106
107
|
setupAlias: 'cursor',
|
|
107
108
|
profileVersion: 'cursor-mcp-depth-v1',
|
|
108
109
|
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
109
|
-
markerStart:
|
|
110
|
-
markerEnd:
|
|
110
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
111
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
111
112
|
defaultTarget: (env) => {
|
|
112
113
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
113
114
|
if (!isTest && (existsSync(path.join(process.cwd(), '.cursor')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
114
|
-
return path.join(process.cwd(), '.cursor', 'rules', '
|
|
115
|
+
return path.join(process.cwd(), '.cursor', 'rules', 'AGENTS.md');
|
|
115
116
|
}
|
|
116
117
|
return path.join(userHome(env), '.cursor', 'memory-profile.md');
|
|
117
|
-
}
|
|
118
|
-
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
118
|
+
}
|
|
119
119
|
},
|
|
120
120
|
'gemini-cli': {
|
|
121
121
|
label: 'Gemini CLI',
|
|
122
122
|
setupAlias: 'gemini',
|
|
123
123
|
profileVersion: 'gemini-cli-mcp-depth-v1',
|
|
124
|
-
markerStart:
|
|
125
|
-
markerEnd:
|
|
124
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
125
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
126
126
|
defaultTarget: (env) => {
|
|
127
127
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
128
128
|
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
129
129
|
return path.join(process.cwd(), 'GEMINI.md');
|
|
130
130
|
}
|
|
131
131
|
return path.join(userHome(env), '.gemini', 'GEMINI.md');
|
|
132
|
-
}
|
|
133
|
-
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
132
|
+
}
|
|
134
133
|
},
|
|
135
134
|
antigravity: {
|
|
136
135
|
label: 'Antigravity',
|
|
137
136
|
setupAlias: 'antigravity',
|
|
138
137
|
profileVersion: 'antigravity-mcp-depth-v1',
|
|
139
|
-
markerStart:
|
|
140
|
-
markerEnd:
|
|
138
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
139
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
141
140
|
defaultTarget: (env) => {
|
|
142
141
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
143
142
|
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
144
143
|
return path.join(process.cwd(), 'GEMINI.md');
|
|
145
144
|
}
|
|
146
145
|
return path.join(userHome(env), '.gemini', 'antigravity', 'MEMORY.md');
|
|
147
|
-
}
|
|
148
|
-
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
146
|
+
}
|
|
149
147
|
},
|
|
150
148
|
qwen: {
|
|
151
149
|
label: 'Qwen',
|
|
152
150
|
setupAlias: 'qwen',
|
|
153
151
|
profileVersion: 'qwen-mcp-depth-v1',
|
|
154
|
-
markerStart:
|
|
155
|
-
markerEnd:
|
|
152
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
153
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
156
154
|
defaultTarget: (env) => {
|
|
157
155
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
158
156
|
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
159
157
|
return path.join(process.cwd(), 'QWEN.md');
|
|
160
158
|
}
|
|
161
159
|
return path.join(userHome(env), '.qwen', 'QWEN.md');
|
|
162
|
-
}
|
|
163
|
-
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
160
|
+
}
|
|
164
161
|
},
|
|
165
162
|
opencode: {
|
|
166
163
|
label: 'OpenCode',
|
|
167
164
|
setupAlias: 'opencode',
|
|
168
165
|
profileVersion: 'opencode-mcp-depth-v1',
|
|
169
|
-
markerStart:
|
|
170
|
-
markerEnd:
|
|
166
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
167
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
171
168
|
defaultTarget: (env) => {
|
|
172
169
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
173
170
|
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
174
171
|
return path.join(process.cwd(), 'AGENTS.md');
|
|
175
172
|
}
|
|
176
173
|
return path.join(userHome(env), '.config', 'opencode', 'AGENTS.md');
|
|
177
|
-
}
|
|
178
|
-
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
174
|
+
}
|
|
179
175
|
},
|
|
180
176
|
trae: {
|
|
181
177
|
label: 'Trae',
|
|
182
178
|
setupAlias: 'trae',
|
|
183
179
|
profileVersion: 'trae-mcp-depth-v1',
|
|
184
180
|
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
185
|
-
markerStart:
|
|
186
|
-
markerEnd:
|
|
181
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
182
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
187
183
|
defaultTarget: (env) => {
|
|
188
184
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
189
185
|
if (!isTest && (existsSync(path.join(process.cwd(), '.trae')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
190
|
-
return path.join(process.cwd(), '.trae', 'rules', '
|
|
186
|
+
return path.join(process.cwd(), '.trae', 'rules', 'AGENTS.md');
|
|
191
187
|
}
|
|
192
188
|
return path.join(userHome(env), '.trae', 'memory-profile.md');
|
|
193
|
-
}
|
|
194
|
-
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
189
|
+
}
|
|
195
190
|
},
|
|
196
191
|
'trae-solo': {
|
|
197
192
|
label: 'Trae Solo',
|
|
198
193
|
setupAlias: 'trae-solo',
|
|
199
194
|
profileVersion: 'trae-solo-mcp-depth-v1',
|
|
200
195
|
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
201
|
-
markerStart:
|
|
202
|
-
markerEnd:
|
|
196
|
+
markerStart: CLIENT_PROFILE_MARKER_START,
|
|
197
|
+
markerEnd: CLIENT_PROFILE_MARKER_END,
|
|
203
198
|
defaultTarget: (env) => {
|
|
204
199
|
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
205
200
|
if (!isTest && (existsSync(path.join(process.cwd(), '.trae')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
206
|
-
return path.join(process.cwd(), '.trae', 'rules', '
|
|
201
|
+
return path.join(process.cwd(), '.trae', 'rules', 'AGENTS.md');
|
|
207
202
|
}
|
|
208
203
|
return path.join(userHome(env), '.trae', 'memory-profile.md');
|
|
209
|
-
}
|
|
210
|
-
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
204
|
+
}
|
|
211
205
|
}
|
|
212
206
|
};
|
|
213
207
|
return profileConfigs[clientId] ?? null;
|
package/src/core/constants.js
CHANGED
|
@@ -14,14 +14,14 @@ export const AGENT_INSTANCE_HEADER = 'X-Memory-OS-Agent-Instance-ID';
|
|
|
14
14
|
export const MCP_SERVER_NAME = 'XMemo';
|
|
15
15
|
export const LEGACY_MCP_SERVER_NAMES = ['memory_os', 'memory-os'];
|
|
16
16
|
export const CODEX_PROFILE_TARGET = 'AGENTS.md';
|
|
17
|
-
export const CODEX_PROFILE_MARKER_START = '<!--
|
|
18
|
-
export const CODEX_PROFILE_MARKER_END = '<!--
|
|
17
|
+
export const CODEX_PROFILE_MARKER_START = '<!-- xmemo:profile:start -->';
|
|
18
|
+
export const CODEX_PROFILE_MARKER_END = '<!-- xmemo:profile:end -->';
|
|
19
19
|
export const CLIENT_PROFILE_TARGETS = {
|
|
20
|
-
cursor: '.cursor/rules/
|
|
20
|
+
cursor: '.cursor/rules/AGENTS.md',
|
|
21
21
|
'gemini-cli': 'GEMINI.md',
|
|
22
22
|
antigravity: 'GEMINI.md',
|
|
23
|
-
trae: '.trae/rules/
|
|
24
|
-
'trae-solo': '.trae/rules/
|
|
23
|
+
trae: '.trae/rules/AGENTS.md',
|
|
24
|
+
'trae-solo': '.trae/rules/AGENTS.md'
|
|
25
25
|
};
|
|
26
26
|
export const CLIENT_PROFILE_MARKER_START = '<!-- xmemo:profile:start -->';
|
|
27
27
|
export const CLIENT_PROFILE_MARKER_END = '<!-- xmemo:profile:end -->';
|
package/src/core/version.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');
|
|
7
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
8
|
+
|
|
9
|
+
export const CLI_VERSION = packageJson.version;
|
package/src/mcp/formats/json.js
CHANGED
|
@@ -30,7 +30,7 @@ export const JSON_MCP_CLIENT_DEFINITIONS = Object.freeze([
|
|
|
30
30
|
nestedTransportClientDefinition('continue', 'Continue', 'defaultContinueConfigPath'),
|
|
31
31
|
commandClientDefinition('claude-desktop', 'Claude Desktop', 'defaultClaudeConfigPath'),
|
|
32
32
|
httpClientDefinition('openclaw', 'OpenClaw', 'defaultOpenclawConfigPath', { urlKey: 'url', authentication: 'env-bearer' }),
|
|
33
|
-
httpClientDefinition('kiro', 'Kiro', 'defaultKiroConfigPath', { urlKey: 'url', authentication: '
|
|
33
|
+
httpClientDefinition('kiro', 'Kiro', 'defaultKiroConfigPath', { urlKey: 'url', section: 'powers.mcpServers', authentication: 'oauth' }),
|
|
34
34
|
commandClientDefinition('zed', 'Zed', 'defaultZedConfigPath', { section: 'context_servers' }),
|
|
35
35
|
nestedTransportClientDefinition('jetbrains', 'JetBrains', 'defaultJetbrainsConfigPath'),
|
|
36
36
|
remoteClientDefinition('opencode', 'OpenCode', 'defaultOpencodeConfigPath'),
|
|
@@ -182,6 +182,10 @@ function headersForDefinition(definition, identity) {
|
|
|
182
182
|
|
|
183
183
|
if (definition.authentication === 'env-bearer') {
|
|
184
184
|
headers.Authorization = authorizationHeader(definition.bearerSyntax);
|
|
185
|
+
} else if (definition.id === 'kiro') {
|
|
186
|
+
if (process.env[TOKEN_ENV_VAR]) {
|
|
187
|
+
headers.Authorization = authorizationHeader(definition.bearerSyntax ?? 'env-colon');
|
|
188
|
+
}
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
return orderedHeaders(headers);
|
|
File without changes
|