@xmemo/client 0.4.160 → 0.4.162

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.160",
3
+ "version": "0.4.162",
4
4
  "description": "Privacy-first CLI and MCP setup helper for XMemo.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,34 +27,36 @@ This command:
27
27
 
28
28
  ## Authentication
29
29
 
30
- ### OAuth (Recommended)
30
+ ### Environment Variable (Required)
31
31
 
32
- The power uses OAuth by default. On first use, Kiro will open a browser window for you to authorize XMemo access.
32
+ Kiro requires the `XMEMO_KEY` environment variable to be set for authentication.
33
33
 
34
- ### Environment Variable (Alternative)
35
-
36
- If OAuth is unavailable, you can use an environment variable:
34
+ First, authenticate with XMemo:
37
35
 
38
36
  ```bash
39
37
  xmemo login
40
38
  ```
41
39
 
42
- Or manually set your token:
43
-
44
- ```bash
45
- printf '%s\n' 'your-token' | xmemo token add --from-stdin
46
- ```
47
-
48
40
  Then set the environment variable:
49
41
 
50
42
  ```bash
51
- # PowerShell
52
- [Environment]::SetEnvironmentVariable("XMEMO_KEY", "your-token", "User")
43
+ # PowerShell (User-level, persistent)
44
+ $token = xmemo token show --format raw
45
+ [Environment]::SetEnvironmentVariable("XMEMO_KEY", $token, "User")
46
+
47
+ # PowerShell (Session-only)
48
+ $env:XMEMO_KEY = xmemo token show --format raw
53
49
 
54
50
  # Bash/Zsh
55
- export XMEMO_KEY="your-token"
51
+ export XMEMO_KEY=$(xmemo token show --format raw)
56
52
  ```
57
53
 
54
+ **Important**: Restart Kiro after setting the environment variable for the first time.
55
+
56
+ ### Why Environment Variable?
57
+
58
+ Kiro currently has a known issue with OAuth token persistence. Using an environment variable ensures reliable authentication across all sessions.
59
+
58
60
  ## Usage
59
61
 
60
62
  Once installed, Kiro will automatically use XMemo when appropriate. The steering file instructs Kiro to:
@@ -134,7 +136,7 @@ To remove XMemo from Kiro, manually edit `~/.kiro/settings/mcp.json` and remove
134
136
  ## Privacy & Security
135
137
 
136
138
  - No telemetry or analytics
137
- - OAuth tokens are stored securely by Kiro
139
+ - Tokens are managed by XMemo CLI and referenced via environment variable
138
140
  - Agent identity headers are non-secret attribution IDs
139
141
  - Environment variable approach keeps tokens out of config files
140
142
  - All memory content is user-owned and controlled through your XMemo account
@@ -10,15 +10,29 @@ XMemo gives Kiro a hosted, user-owned memory layer for durable project context,
10
10
 
11
11
  ## Authentication
12
12
 
13
- The Kiro Power is OAuth-first. The power metadata stores only the hosted MCP URL; the first XMemo tool use should open the browser-based OAuth flow. Do not add `Authorization`, `Bearer`, or `XMEMO_KEY` to the power's `mcp.json`.
13
+ The Kiro Power uses environment variable authentication due to a known Kiro IDE OAuth token persistence issue. The power metadata stores only the hosted MCP URL plus the `XMEMO_KEY` environment variable reference.
14
14
 
15
- Manual direct-key fallback remains available through:
15
+ Users should authenticate with:
16
16
 
17
17
  ```bash
18
- xmemo mcp config --client kiro --json
18
+ xmemo login
19
+ ```
20
+
21
+ Then set the environment variable:
22
+
23
+ ```bash
24
+ # PowerShell (persistent)
25
+ $token = xmemo token show --format raw
26
+ [Environment]::SetEnvironmentVariable("XMEMO_KEY", $token, "User")
19
27
  ```
20
28
 
21
- Use that fallback only for local/manual installs where Kiro OAuth is unavailable.
29
+ Then restart Kiro for the environment variable to take effect.
30
+
31
+ Manual configuration is available through:
32
+
33
+ ```bash
34
+ xmemo mcp config --client kiro --json
35
+ ```
22
36
 
23
37
  ## Reviewer smoke prompts
24
38
 
@@ -15,6 +15,8 @@ This will:
15
15
  2. Configure authentication via `XMEMO_KEY` environment variable
16
16
  3. Set up agent identity headers for attribution
17
17
 
18
+ **Note**: Kiro uses environment variable authentication (`XMEMO_KEY`) as the recommended method. Make sure to set the environment variable before using XMemo.
19
+
18
20
  ## Step-by-Step Setup
19
21
 
20
22
  ### 1. Install XMemo CLI
@@ -25,7 +27,7 @@ npm install -g @xmemo/client
25
27
 
26
28
  ### 2. Authenticate with XMemo
27
29
 
28
- Choose one of these methods:
30
+ Kiro requires the `XMEMO_KEY` environment variable to be set. Choose one of these methods:
29
31
 
30
32
  #### Option A: OAuth Login (Recommended)
31
33
 
@@ -33,28 +35,36 @@ Choose one of these methods:
33
35
  xmemo login
34
36
  ```
35
37
 
36
- This opens your browser for secure OAuth authentication.
38
+ This opens your browser for secure OAuth authentication and automatically stores your token.
37
39
 
38
40
  #### Option B: Direct Token
39
41
 
40
- If you already have a token:
42
+ If you already have a token, add it to the token store:
41
43
 
42
44
  ```bash
43
45
  printf '%s\n' 'your-token' | xmemo token add --from-stdin
44
46
  ```
45
47
 
46
- Set the environment variable:
48
+ After authentication, export your token to the environment variable:
47
49
 
48
- **PowerShell:**
50
+ **PowerShell (User-level, persistent):**
49
51
  ```powershell
50
- [Environment]::SetEnvironmentVariable("XMEMO_KEY", "your-token", "User")
52
+ $token = xmemo token show --format raw
53
+ [Environment]::SetEnvironmentVariable("XMEMO_KEY", $token, "User")
54
+ ```
55
+
56
+ **PowerShell (Session-only):**
57
+ ```powershell
58
+ $env:XMEMO_KEY = xmemo token show --format raw
51
59
  ```
52
60
 
53
61
  **Bash/Zsh:**
54
62
  ```bash
55
- export XMEMO_KEY="your-token"
63
+ export XMEMO_KEY=$(xmemo token show --format raw)
56
64
  ```
57
65
 
66
+ **Note**: The environment variable must be set before starting Kiro for the MCP server to authenticate successfully.
67
+
58
68
  ### 3. Configure Kiro
59
69
 
60
70
  Preview the configuration first:
@@ -162,7 +172,7 @@ xmemo auth status
162
172
  xmemo token status --verify
163
173
  ```
164
174
 
165
- **Verify environment variable:**
175
+ **Verify environment variable is set:**
166
176
 
167
177
  PowerShell:
168
178
  ```powershell
@@ -174,6 +184,16 @@ Bash/Zsh:
174
184
  echo $XMEMO_KEY
175
185
  ```
176
186
 
187
+ **If the environment variable is not set, set it:**
188
+
189
+ PowerShell (User-level, persistent):
190
+ ```powershell
191
+ $token = xmemo token show --format raw
192
+ [Environment]::SetEnvironmentVariable("XMEMO_KEY", $token, "User")
193
+ ```
194
+
195
+ **Then restart Kiro** for the environment variable to be loaded.
196
+
177
197
  **Re-authenticate if needed:**
178
198
  ```bash
179
199
  xmemo login
@@ -16,7 +16,7 @@ Use XMemo when the task may depend on prior memory, durable project context, cod
16
16
  2. **Save only durable information** that the user asks to remember or that is clearly useful across future Kiro sessions.
17
17
  3. **Keep memory content concise, scoped, and useful**. Prefer concrete facts, decisions, links to public docs, and action items over chat transcripts.
18
18
  4. **For destructive memory actions**, confirm the exact target before deleting, forgetting, or overwriting.
19
- 5. **If authorization is missing or expired**, ask the user to reconnect XMemo through Kiro's OAuth flow. Do not request raw bearer tokens in chat.
19
+ 5. **If authorization errors occur**, ask the user to verify the `XMEMO_KEY` environment variable is set and to restart Kiro.
20
20
 
21
21
  ## Good Memory Candidates
22
22
 
@@ -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: 'env-bearer' }),
33
+ commandClientDefinition('kiro', 'Kiro', 'defaultKiroConfigPath'),
34
34
  commandClientDefinition('zed', 'Zed', 'defaultZedConfigPath', { section: 'context_servers' }),
35
35
  nestedTransportClientDefinition('jetbrains', 'JetBrains', 'defaultJetbrainsConfigPath'),
36
36
  remoteClientDefinition('opencode', 'OpenCode', 'defaultOpencodeConfigPath'),
@@ -182,10 +182,6 @@ 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
- }
189
185
  }
190
186
 
191
187
  return orderedHeaders(headers);