@xmemo/client 0.4.157 → 0.4.160

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmemo/client",
3
- "version": "0.4.157",
3
+ "version": "0.4.160",
4
4
  "description": "Privacy-first CLI and MCP setup helper for XMemo.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,7 +29,7 @@
29
29
  "developer-tools"
30
30
  ],
31
31
  "steering": [
32
- "steering/xmemo-memory.md"
32
+ "steering/AGENTS.md"
33
33
  ],
34
34
  "mcpServers": "mcp.json"
35
35
  }
@@ -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/xmemo-memory.md` tells Kiro when to use XMemo memory.
9
+ - `steering/AGENTS.md` tells Kiro when to use XMemo memory.
10
10
 
11
11
  ## Authentication
12
12
 
@@ -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.authInstruction
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
- `## XMemo ${profile.label} profile`,
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
- `Recommended ${profile.label} behavior:`
85
+ 'Recommended Agent behavior:'
84
86
  );
85
87
  for (const instruction of profile.instructions) {
86
88
  lines.push(`- ${instruction}`);
@@ -96,125 +98,131 @@ export function profileClientConfig(clientId) {
96
98
  setupAlias: 'codex',
97
99
  profileVersion: 'codex-mcp-depth-v1',
98
100
  requiredTokenEnv: TOKEN_ENV_VAR,
99
- markerStart: CODEX_PROFILE_MARKER_START,
100
- markerEnd: CODEX_PROFILE_MARKER_END,
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: `<!-- ${PROFILE_MARKER_PREFIX}:cursor:start -->`,
110
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:cursor:end -->`,
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', 'xmemo-memory.md');
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
+ },
120
+ kiro: {
121
+ label: 'Kiro',
122
+ setupAlias: 'kiro',
123
+ profileVersion: 'kiro-mcp-depth-v1',
124
+ markerStart: CLIENT_PROFILE_MARKER_START,
125
+ markerEnd: CLIENT_PROFILE_MARKER_END,
126
+ defaultTarget: (env) => {
127
+ const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
128
+ if (!isTest && (existsSync(path.join(process.cwd(), '.kiro')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
129
+ return path.join(process.cwd(), '.kiro', 'steering', 'AGENTS.md');
130
+ }
131
+ return path.join(userHome(env), '.kiro', 'steering', 'AGENTS.md');
132
+ }
119
133
  },
120
134
  'gemini-cli': {
121
135
  label: 'Gemini CLI',
122
136
  setupAlias: 'gemini',
123
137
  profileVersion: 'gemini-cli-mcp-depth-v1',
124
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:gemini-cli:start -->`,
125
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:gemini-cli:end -->`,
138
+ markerStart: CLIENT_PROFILE_MARKER_START,
139
+ markerEnd: CLIENT_PROFILE_MARKER_END,
126
140
  defaultTarget: (env) => {
127
141
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
128
142
  if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
129
143
  return path.join(process.cwd(), 'GEMINI.md');
130
144
  }
131
145
  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.'
146
+ }
134
147
  },
135
148
  antigravity: {
136
149
  label: 'Antigravity',
137
150
  setupAlias: 'antigravity',
138
151
  profileVersion: 'antigravity-mcp-depth-v1',
139
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:antigravity:start -->`,
140
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:antigravity:end -->`,
152
+ markerStart: CLIENT_PROFILE_MARKER_START,
153
+ markerEnd: CLIENT_PROFILE_MARKER_END,
141
154
  defaultTarget: (env) => {
142
155
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
143
156
  if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
144
157
  return path.join(process.cwd(), 'GEMINI.md');
145
158
  }
146
159
  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.'
160
+ }
149
161
  },
150
162
  qwen: {
151
163
  label: 'Qwen',
152
164
  setupAlias: 'qwen',
153
165
  profileVersion: 'qwen-mcp-depth-v1',
154
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:qwen:start -->`,
155
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:qwen:end -->`,
166
+ markerStart: CLIENT_PROFILE_MARKER_START,
167
+ markerEnd: CLIENT_PROFILE_MARKER_END,
156
168
  defaultTarget: (env) => {
157
169
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
158
170
  if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
159
171
  return path.join(process.cwd(), 'QWEN.md');
160
172
  }
161
173
  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.`
174
+ }
164
175
  },
165
176
  opencode: {
166
177
  label: 'OpenCode',
167
178
  setupAlias: 'opencode',
168
179
  profileVersion: 'opencode-mcp-depth-v1',
169
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:opencode:start -->`,
170
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:opencode:end -->`,
180
+ markerStart: CLIENT_PROFILE_MARKER_START,
181
+ markerEnd: CLIENT_PROFILE_MARKER_END,
171
182
  defaultTarget: (env) => {
172
183
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
173
184
  if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
174
185
  return path.join(process.cwd(), 'AGENTS.md');
175
186
  }
176
187
  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.'
188
+ }
179
189
  },
180
190
  trae: {
181
191
  label: 'Trae',
182
192
  setupAlias: 'trae',
183
193
  profileVersion: 'trae-mcp-depth-v1',
184
194
  requiredTokenEnv: TOKEN_ENV_VAR,
185
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:trae:start -->`,
186
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:trae:end -->`,
195
+ markerStart: CLIENT_PROFILE_MARKER_START,
196
+ markerEnd: CLIENT_PROFILE_MARKER_END,
187
197
  defaultTarget: (env) => {
188
198
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
189
199
  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', 'xmemo-memory.md');
200
+ return path.join(process.cwd(), '.trae', 'rules', 'AGENTS.md');
191
201
  }
192
202
  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.`
203
+ }
195
204
  },
196
205
  'trae-solo': {
197
206
  label: 'Trae Solo',
198
207
  setupAlias: 'trae-solo',
199
208
  profileVersion: 'trae-solo-mcp-depth-v1',
200
209
  requiredTokenEnv: TOKEN_ENV_VAR,
201
- markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:trae-solo:start -->`,
202
- markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:trae-solo:end -->`,
210
+ markerStart: CLIENT_PROFILE_MARKER_START,
211
+ markerEnd: CLIENT_PROFILE_MARKER_END,
203
212
  defaultTarget: (env) => {
204
213
  const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
205
214
  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', 'xmemo-memory.md');
215
+ return path.join(process.cwd(), '.trae', 'rules', 'AGENTS.md');
207
216
  }
208
217
  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.`
218
+ }
211
219
  }
212
220
  };
213
221
  return profileConfigs[clientId] ?? null;
214
222
  }
215
223
 
216
224
  export function supportedProfileClientIds() {
217
- return ['codex', 'cursor', 'gemini', 'antigravity', 'qwen', 'opencode', 'trae', 'trae-solo'];
225
+ return ['codex', 'cursor', 'kiro', 'gemini', 'antigravity', 'qwen', 'opencode', 'trae', 'trae-solo'];
218
226
  }
219
227
 
220
228
  export function defaultProfileTarget(clientId, env) {
@@ -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 = '<!-- memory-os:codex-profile:start -->';
18
- export const CODEX_PROFILE_MARKER_END = '<!-- memory-os:codex-profile: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/xmemo-memory.md',
20
+ cursor: '.cursor/rules/AGENTS.md',
21
21
  'gemini-cli': 'GEMINI.md',
22
22
  antigravity: 'GEMINI.md',
23
- trae: '.trae/rules/xmemo-memory.md',
24
- 'trae-solo': '.trae/rules/xmemo-memory.md'
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 -->';
@@ -1 +1,9 @@
1
- export const CLI_VERSION = '0.4.156';
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;
@@ -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);