mnemos-capture 1.5.0 → 1.6.1
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/README.md +27 -19
- package/dist/cli/hooks.js +24 -11
- package/dist/cli/index.js +7 -7
- package/dist/cli/mcp-server.js +2 -2
- package/dist/cli/version-check.js +26 -13
- package/package.json +15 -12
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<br>
|
|
10
10
|
<br>
|
|
11
11
|
<p>
|
|
12
|
-
<a href="https://www.npmjs.com/package/
|
|
12
|
+
<a href="https://www.npmjs.com/package/@xmu-labs/xkg"><img src="https://img.shields.io/npm/v/@xmu-labs/xkg?color=1c74d8&labelColor=000820&style=flat" alt="npm" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/MCP-compatible-9dd8f5?labelColor=000820&style=flat" alt="MCP" />
|
|
14
14
|
<img src="https://img.shields.io/badge/license-MIT-f0f4f8?labelColor=000820&style=flat" alt="MIT" />
|
|
15
15
|
</p>
|
|
@@ -53,7 +53,7 @@ You find useful stuff, you capture through the web app, then xkg connects it int
|
|
|
53
53
|
xkg will continuously compound that knowledge over time — keeping AI workers' context up to date as human knowledge evolves.
|
|
54
54
|
|
|
55
55
|
> [!IMPORTANT]
|
|
56
|
-
> We are migrating from **mnemos** / **Xmu** to **xkg**. The app now lives at [xkg.xmu.sh](https://xkg.xmu.sh) and the code at [xmu-labs/xkg](https://github.com/xmu-labs/xkg). Connectors set up with `mnemos-capture.vercel.app` keep working
|
|
56
|
+
> We are migrating from **mnemos** / **Xmu** to **xkg**. The app now lives at [xkg.xmu.sh](https://xkg.xmu.sh) and the code at [xmu-labs/xkg](https://github.com/xmu-labs/xkg). The npm package is now `@xmu-labs/xkg`. Connectors set up with `mnemos-capture.vercel.app` and commands that run `npx mnemos-capture@latest` keep working: every release is published under both names. Sorry for the inconvenience.
|
|
57
57
|
|
|
58
58
|
## Start here
|
|
59
59
|
|
|
@@ -95,10 +95,10 @@ https://xkg.xmu.sh/api/mcp
|
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
npx -y
|
|
98
|
+
npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
The CLI binary is **`xkg`** (also `xmu` and `mnemos-capture`).
|
|
101
|
+
The CLI binary is **`xkg`** (also `xmu` and `mnemos-capture`). An MCP server already registered as `xmu` or `mnemos`, or set up with `mnemos-capture@latest`, keeps working.
|
|
102
102
|
|
|
103
103
|
**On the web** — paste the URL (no terminal). **In the terminal** — run the command. Finish xkg onboarding first, then ask: *list my inbox* or *brief me*.
|
|
104
104
|
|
|
@@ -126,7 +126,7 @@ Name the connector `xkg`, paste `https://xkg.xmu.sh/api/mcp`, sign in with GitHu
|
|
|
126
126
|
The same command works in every CLI — Cursor, Codex, Gemini CLI, VS Code, Claude Code, or anything that can launch a local MCP server:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
npx -y
|
|
129
|
+
npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
Register that command in the tool you use.
|
|
@@ -140,7 +140,7 @@ Add this to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (all projects):
|
|
|
140
140
|
"mcpServers": {
|
|
141
141
|
"xkg": {
|
|
142
142
|
"command": "npx",
|
|
143
|
-
"args": ["-y", "
|
|
143
|
+
"args": ["-y", "@xmu-labs/xkg@latest", "serve-mcp", "--key", "YOUR_API_KEY"]
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -157,7 +157,7 @@ Add this to `.vscode/mcp.json`:
|
|
|
157
157
|
"servers": {
|
|
158
158
|
"xkg": {
|
|
159
159
|
"command": "npx",
|
|
160
|
-
"args": ["-y", "
|
|
160
|
+
"args": ["-y", "@xmu-labs/xkg@latest", "serve-mcp", "--key", "YOUR_API_KEY"]
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -172,7 +172,7 @@ Codex CLI — add this to `~/.codex/config.toml`:
|
|
|
172
172
|
```toml
|
|
173
173
|
[mcp_servers.xkg]
|
|
174
174
|
command = "npx"
|
|
175
|
-
args = ["-y", "
|
|
175
|
+
args = ["-y", "@xmu-labs/xkg@latest", "serve-mcp", "--key", "YOUR_API_KEY"]
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
Codex App: Settings → MCP → add the same `npx` command.
|
|
@@ -180,13 +180,13 @@ Codex App: Settings → MCP → add the same `npx` command.
|
|
|
180
180
|
#### Gemini CLI
|
|
181
181
|
|
|
182
182
|
```bash
|
|
183
|
-
gemini mcp add xkg npx -y
|
|
183
|
+
gemini mcp add xkg npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
#### Claude Code
|
|
187
187
|
|
|
188
188
|
```bash
|
|
189
|
-
claude mcp add xkg -- npx -y
|
|
189
|
+
claude mcp add xkg -- npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY
|
|
190
190
|
```
|
|
191
191
|
|
|
192
192
|
Or the URL, no API key:
|
|
@@ -198,7 +198,7 @@ claude mcp add --transport http xkg https://xkg.xmu.sh/api/mcp
|
|
|
198
198
|
Optional session hooks (MCP works without them):
|
|
199
199
|
|
|
200
200
|
```bash
|
|
201
|
-
npx -y
|
|
201
|
+
npx -y @xmu-labs/xkg@latest setup-hooks --key YOUR_API_KEY --briefing --vault
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
Hooks are local files — they run in the CLI and editor extensions, not in the browser.
|
|
@@ -212,7 +212,7 @@ Settings → Developer → Edit Config. Add the same `npx` block to `claude_desk
|
|
|
212
212
|
"mcpServers": {
|
|
213
213
|
"xkg": {
|
|
214
214
|
"command": "npx",
|
|
215
|
-
"args": ["-y", "
|
|
215
|
+
"args": ["-y", "@xmu-labs/xkg@latest", "serve-mcp", "--key", "YOUR_API_KEY"]
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
}
|
|
@@ -227,7 +227,7 @@ If the tool can launch a local process, register the same `npx` command. If it h
|
|
|
227
227
|
"mcpServers": {
|
|
228
228
|
"xkg": {
|
|
229
229
|
"command": "npx",
|
|
230
|
-
"args": ["-y", "
|
|
230
|
+
"args": ["-y", "@xmu-labs/xkg@latest", "serve-mcp", "--key", "YOUR_API_KEY"]
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -256,14 +256,14 @@ No MCP support yet? Capture in the [xkg app](https://xkg.xmu.sh) and connect lat
|
|
|
256
256
|
4. **Execute** — Hand the plan to your worker in the current session, or run it in an isolated git worktree:
|
|
257
257
|
|
|
258
258
|
```bash
|
|
259
|
-
npx -y
|
|
260
|
-
npx -y
|
|
259
|
+
npx -y @xmu-labs/xkg@latest config set agent "claude -p"
|
|
260
|
+
npx -y @xmu-labs/xkg@latest kos --key YOUR_API_KEY
|
|
261
261
|
```
|
|
262
262
|
|
|
263
263
|
`kos` creates a worktree, loads the plan as the contract, launches the assistant you configured, and prints the verification checklist when it finishes.
|
|
264
264
|
|
|
265
265
|
```bash
|
|
266
|
-
npx -y
|
|
266
|
+
npx -y @xmu-labs/xkg@latest config set agent "codex exec"
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
### Example capture
|
|
@@ -331,12 +331,12 @@ You don't have to memorize these. Ask in plain language: "save this", "what do I
|
|
|
331
331
|
No global install required. The binary is **`xkg`** (also `xmu` and `mnemos-capture`). Via npx:
|
|
332
332
|
|
|
333
333
|
```bash
|
|
334
|
-
npx -y
|
|
334
|
+
npx -y @xmu-labs/xkg@latest <command>
|
|
335
335
|
```
|
|
336
336
|
|
|
337
337
|
| Command | What it does |
|
|
338
338
|
| --- | --- |
|
|
339
|
-
| `npx -y
|
|
339
|
+
| `npx -y @xmu-labs/xkg@latest` | Open the hosted app |
|
|
340
340
|
| `serve-mcp --key YOUR_API_KEY` | Run the local MCP proxy |
|
|
341
341
|
| `setup-hooks --key YOUR_API_KEY [--briefing] [--vault]` | Install Claude Code hooks |
|
|
342
342
|
| `config set agent "claude -p"` | Set which assistant `kos` should drive |
|
|
@@ -345,6 +345,8 @@ npx -y mnemos-capture@latest <command>
|
|
|
345
345
|
| `vault-check --key YOUR_API_KEY` | Debug the vault hook |
|
|
346
346
|
| `help` | Show help |
|
|
347
347
|
|
|
348
|
+
What changed in each version: [GitHub Releases](https://github.com/xmu-labs/xkg/releases).
|
|
349
|
+
|
|
348
350
|
## Your context stays in GitHub
|
|
349
351
|
|
|
350
352
|
Captures live as structured Markdown in **your** GitHub repository. Private by default.
|
|
@@ -423,7 +425,13 @@ Working on the code? See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
|
423
425
|
|
|
424
426
|
## License
|
|
425
427
|
|
|
426
|
-
[MIT License](./LICENSE)
|
|
428
|
+
[MIT License](./LICENSE). Contributions are welcome under the same licence; see
|
|
429
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
430
|
+
|
|
431
|
+
**Trademarks.** The MIT licence covers the code, not names or logos: the xkg name and logo are not
|
|
432
|
+
licensed for use as your own brand. Claude, ChatGPT, Codex, Gemini, Grok, Cursor and VS Code are
|
|
433
|
+
trademarks of their respective owners, named here only to say which tools xkg works with; no
|
|
434
|
+
endorsement is implied.
|
|
427
435
|
|
|
428
436
|
If you use xkg in published work:
|
|
429
437
|
|
package/dist/cli/hooks.js
CHANGED
|
@@ -4,13 +4,27 @@ import { join } from "path";
|
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
5
|
const HOSTED_URL = "https://xkg.xmu.sh/api/mcp";
|
|
6
6
|
const CLAUDE_SETTINGS_PATH = join(homedir(), ".claude", "settings.json");
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/** The npm package new hooks run. Releases also publish it as `mnemos-capture`. */
|
|
8
|
+
const PACKAGE = "@xmu-labs/xkg";
|
|
9
|
+
/**
|
|
10
|
+
* Matches hooks this CLI installed under either package name, with or without
|
|
11
|
+
* a version: `npx -y @xmu-labs/xkg@latest inbox-check`,
|
|
12
|
+
* `npx -y mnemos-capture@latest inbox-check`, and the legacy
|
|
13
|
+
* `npx mnemos-capture inbox-check`.
|
|
14
|
+
*/
|
|
15
|
+
function isOurHook(cmd, subcommand) {
|
|
16
|
+
// The package must be a whole shell word: `my-xkg` or `@acme/xkg` is someone else's.
|
|
17
|
+
return new RegExp(`(?:^|\\s)(?:${PACKAGE}|mnemos-capture)(?:@[\\w.-]+)?\\s+${subcommand}\\b`).test(cmd);
|
|
18
|
+
}
|
|
9
19
|
function isXkgHook(cmd) {
|
|
10
|
-
return cmd
|
|
20
|
+
return isOurHook(cmd, "inbox-check");
|
|
11
21
|
}
|
|
12
22
|
function isXkgPreToolHook(cmd) {
|
|
13
|
-
return cmd
|
|
23
|
+
return isOurHook(cmd, "vault-check");
|
|
24
|
+
}
|
|
25
|
+
/** True when a hook already runs the current package at @latest — nothing to migrate. */
|
|
26
|
+
function isCurrentHook(cmd) {
|
|
27
|
+
return cmd.includes(`npx -y ${PACKAGE}@latest `);
|
|
14
28
|
}
|
|
15
29
|
function readSettings() {
|
|
16
30
|
if (!existsSync(CLAUDE_SETTINGS_PATH))
|
|
@@ -86,17 +100,16 @@ export function setupHooks(apiKey, opts = {}) {
|
|
|
86
100
|
break;
|
|
87
101
|
}
|
|
88
102
|
// skipIfExists (serve-mcp auto-install): preserve user-configured hooks but
|
|
89
|
-
// silently migrate
|
|
103
|
+
// silently migrate hooks that pin a version or use the old package name.
|
|
90
104
|
if (existingCmd && opts.skipIfExists) {
|
|
91
|
-
|
|
92
|
-
if (alreadyLatest)
|
|
105
|
+
if (isCurrentHook(existingCmd))
|
|
93
106
|
return;
|
|
94
107
|
// Migration: preserve the existing --briefing flag when upgrading to @latest
|
|
95
108
|
opts = { ...opts, briefing: existingCmd.includes("--briefing") };
|
|
96
109
|
}
|
|
97
110
|
const command = opts.briefing
|
|
98
|
-
? `npx -y
|
|
99
|
-
: `npx -y
|
|
111
|
+
? `npx -y ${PACKAGE}@latest inbox-check --key ${apiKey} --briefing`
|
|
112
|
+
: `npx -y ${PACKAGE}@latest inbox-check --key ${apiKey}`;
|
|
100
113
|
// Remove any existing xkg inbox-check hook (handles key rotation too)
|
|
101
114
|
const filtered = sessionStart
|
|
102
115
|
.map((group) => ({
|
|
@@ -137,10 +150,10 @@ export function setupPreToolHook(apiKey, opts = {}) {
|
|
|
137
150
|
break;
|
|
138
151
|
}
|
|
139
152
|
if (existingCmd && opts.skipIfExists) {
|
|
140
|
-
if (existingCmd
|
|
153
|
+
if (isCurrentHook(existingCmd))
|
|
141
154
|
return;
|
|
142
155
|
}
|
|
143
|
-
const command = `npx -y
|
|
156
|
+
const command = `npx -y ${PACKAGE}@latest vault-check --key ${apiKey}`;
|
|
144
157
|
const filtered = preToolCall
|
|
145
158
|
.map((group) => ({
|
|
146
159
|
...group,
|
package/dist/cli/index.js
CHANGED
|
@@ -17,7 +17,7 @@ async function main() {
|
|
|
17
17
|
const keyIdx = args.indexOf("--key");
|
|
18
18
|
const apiKey = keyIdx !== -1 ? args[keyIdx + 1] : undefined;
|
|
19
19
|
if (!apiKey) {
|
|
20
|
-
console.error("Usage: npx
|
|
20
|
+
console.error("Usage: npx @xmu-labs/xkg setup-hooks --key YOUR_API_KEY [--briefing] [--vault]");
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
setupHooks(apiKey, { briefing: args.includes("--briefing"), vault: args.includes("--vault") });
|
|
@@ -68,7 +68,7 @@ async function main() {
|
|
|
68
68
|
console.log(" First time? Sign in with GitHub — setup takes 30 seconds.");
|
|
69
69
|
console.log("");
|
|
70
70
|
console.log(" Connect an AI worker:");
|
|
71
|
-
console.log(" claude mcp add xkg -- npx -y
|
|
71
|
+
console.log(" claude mcp add xkg -- npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY");
|
|
72
72
|
console.log("");
|
|
73
73
|
// Try to open the URL in the default browser
|
|
74
74
|
const { exec } = await import("child_process");
|
|
@@ -90,7 +90,7 @@ function printHelp() {
|
|
|
90
90
|
xkg kos --key KEY [--plan FILE] Implement a plan in an isolated worktree
|
|
91
91
|
xkg help Show this help
|
|
92
92
|
|
|
93
|
-
npx -y
|
|
93
|
+
npx -y @xmu-labs/xkg@latest … Same CLI, via the published package
|
|
94
94
|
|
|
95
95
|
MCP tools (via your AI worker):
|
|
96
96
|
briefing — Session-start briefing with ranked insights to apply
|
|
@@ -108,13 +108,13 @@ function printHelp() {
|
|
|
108
108
|
and reports the branch + the plan's Verification Checklist when done.
|
|
109
109
|
|
|
110
110
|
Get started:
|
|
111
|
-
1. Run: npx
|
|
111
|
+
1. Run: npx @xmu-labs/xkg
|
|
112
112
|
2. Sign in with GitHub (creates your knowledge repo automatically)
|
|
113
113
|
3. Set a PIN for quick mobile access
|
|
114
114
|
4. Start capturing!
|
|
115
115
|
|
|
116
116
|
Connect to Claude Code:
|
|
117
|
-
claude mcp add xkg -- npx -y
|
|
117
|
+
claude mcp add xkg -- npx -y @xmu-labs/xkg@latest serve-mcp --key YOUR_API_KEY
|
|
118
118
|
|
|
119
119
|
The @latest tag ensures every Claude Code session uses the most recent
|
|
120
120
|
published version. serve-mcp also self-upgrades on startup as a safety net
|
|
@@ -122,10 +122,10 @@ function printHelp() {
|
|
|
122
122
|
|
|
123
123
|
The hook is installed automatically when you start the MCP server.
|
|
124
124
|
To upgrade to a full project briefing at session start:
|
|
125
|
-
npx
|
|
125
|
+
npx @xmu-labs/xkg setup-hooks --key YOUR_API_KEY --briefing
|
|
126
126
|
|
|
127
127
|
To enable the vault (surfaces captures as you edit files — opt-in):
|
|
128
|
-
npx
|
|
128
|
+
npx @xmu-labs/xkg setup-hooks --key YOUR_API_KEY --vault
|
|
129
129
|
`);
|
|
130
130
|
}
|
|
131
131
|
main().catch((err) => {
|
package/dist/cli/mcp-server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// MCP server that runs locally via stdio and proxies to the hosted API.
|
|
2
|
-
// Used by Claude Code: claude mcp add xkg -- npx
|
|
2
|
+
// Used by Claude Code: claude mcp add xkg -- npx @xmu-labs/xkg serve-mcp --key <api-key>
|
|
3
3
|
const DEFAULT_HOSTED_URL = "https://xkg.xmu.sh/api/mcp";
|
|
4
4
|
/** Override for pointing the proxy at a local instance during development. */
|
|
5
5
|
const HOSTED_URL = process.env.XKG_API_URL ?? process.env.XMU_API_URL ?? process.env.MNEMOS_API_URL ?? DEFAULT_HOSTED_URL;
|
|
@@ -73,7 +73,7 @@ export async function serveMcp() {
|
|
|
73
73
|
const apiKey = keyIdx !== -1 ? args[keyIdx + 1] : undefined;
|
|
74
74
|
if (!apiKey) {
|
|
75
75
|
process.stderr.write("\nxkg MCP server requires an API key.\n");
|
|
76
|
-
process.stderr.write("Usage: npx -y
|
|
76
|
+
process.stderr.write("Usage: npx -y @xmu-labs/xkg@latest serve-mcp --key <your-api-key>\n\n");
|
|
77
77
|
process.stderr.write("Get your API key at: https://xkg.xmu.sh/onboard\n\n");
|
|
78
78
|
process.exit(1);
|
|
79
79
|
}
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
// Self-update enforcement: ensures users always run the latest xkg CLI.
|
|
2
2
|
//
|
|
3
3
|
// Strategy: on serve-mcp startup, query npm for the latest published version.
|
|
4
|
-
// If behind, respawn the process via `npx -y
|
|
5
|
-
//
|
|
4
|
+
// If behind, respawn the process via `npx -y <name>@<latest>` and proxy stdio.
|
|
5
|
+
// <name> is the package this copy was installed as: every release is published
|
|
6
|
+
// as both `@xmu-labs/xkg` and `mnemos-capture`, so each install updates under its own
|
|
7
|
+
// name. An XKG_UPGRADED=1 env var (MNEMOS_UPGRADED=1 from releases before
|
|
6
8
|
// 1.4.1) prevents infinite recursion.
|
|
7
9
|
import { readFileSync } from "fs";
|
|
8
10
|
import { fileURLToPath } from "url";
|
|
9
11
|
import { dirname, join } from "path";
|
|
10
12
|
import { spawn } from "child_process";
|
|
11
|
-
const NPM_REGISTRY = "https://registry.npmjs.org/mnemos-capture/latest";
|
|
12
13
|
const CHECK_TIMEOUT_MS = 2000;
|
|
13
|
-
|
|
14
|
+
/** The names releases are published under; anything else falls back to the first. */
|
|
15
|
+
export const PACKAGE_NAMES = ["@xmu-labs/xkg", "mnemos-capture"];
|
|
16
|
+
function readOwnPackage() {
|
|
14
17
|
try {
|
|
15
18
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
16
19
|
// dist/cli/version-check.js → ../../package.json
|
|
17
|
-
|
|
18
|
-
return pkg.version ?? "0.0.0";
|
|
20
|
+
return JSON.parse(readFileSync(join(here, "../../package.json"), "utf-8"));
|
|
19
21
|
}
|
|
20
22
|
catch {
|
|
21
|
-
return
|
|
23
|
+
return {};
|
|
22
24
|
}
|
|
23
25
|
}
|
|
26
|
+
export function getCurrentVersion() {
|
|
27
|
+
return readOwnPackage().version ?? "0.0.0";
|
|
28
|
+
}
|
|
29
|
+
/** The npm name this copy was installed as, so updates come from the same name. */
|
|
30
|
+
export function getPackageName() {
|
|
31
|
+
const name = readOwnPackage().name;
|
|
32
|
+
return PACKAGE_NAMES.includes(name ?? "") ? name : PACKAGE_NAMES[0];
|
|
33
|
+
}
|
|
24
34
|
export function isNewer(latest, current) {
|
|
25
35
|
const l = latest.split(".").map((n) => parseInt(n, 10) || 0);
|
|
26
36
|
const c = current.split(".").map((n) => parseInt(n, 10) || 0);
|
|
@@ -34,9 +44,11 @@ export function isNewer(latest, current) {
|
|
|
34
44
|
}
|
|
35
45
|
return false;
|
|
36
46
|
}
|
|
37
|
-
async function getLatestVersion() {
|
|
47
|
+
async function getLatestVersion(name) {
|
|
38
48
|
try {
|
|
39
|
-
const res = await fetch(
|
|
49
|
+
const res = await fetch(`https://registry.npmjs.org/${name}/latest`, {
|
|
50
|
+
signal: AbortSignal.timeout(CHECK_TIMEOUT_MS),
|
|
51
|
+
});
|
|
40
52
|
if (!res.ok)
|
|
41
53
|
return null;
|
|
42
54
|
const data = (await res.json());
|
|
@@ -47,8 +59,8 @@ async function getLatestVersion() {
|
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
/**
|
|
50
|
-
* If a newer version exists on npm, respawn via `npx -y
|
|
51
|
-
* with the original argv, piping stdio. Returns true if the caller should stop
|
|
62
|
+
* If a newer version exists on npm, respawn via `npx -y <name>@<latest>` under
|
|
63
|
+
* the name this copy was installed as, with the original argv, piping stdio. Returns true if the caller should stop
|
|
52
64
|
* (because the child is taking over). Returns false otherwise — caller should
|
|
53
65
|
* continue with normal startup.
|
|
54
66
|
*/
|
|
@@ -57,12 +69,13 @@ export async function maybeSelfUpgrade() {
|
|
|
57
69
|
// releases set MNEMOS_UPGRADED, and may be the parent that spawned this one.
|
|
58
70
|
if (process.env.XKG_UPGRADED === "1" || process.env.MNEMOS_UPGRADED === "1")
|
|
59
71
|
return false;
|
|
72
|
+
const name = getPackageName();
|
|
60
73
|
const current = getCurrentVersion();
|
|
61
|
-
const latest = await getLatestVersion();
|
|
74
|
+
const latest = await getLatestVersion(name);
|
|
62
75
|
if (!latest || !isNewer(latest, current))
|
|
63
76
|
return false;
|
|
64
77
|
process.stderr.write(`xkg: upgrading to v${latest} (was v${current})...\n`);
|
|
65
|
-
const child = spawn("npx", ["-y",
|
|
78
|
+
const child = spawn("npx", ["-y", `${name}@${latest}`, ...process.argv.slice(2)], {
|
|
66
79
|
stdio: "inherit",
|
|
67
80
|
env: { ...process.env, XKG_UPGRADED: "1" },
|
|
68
81
|
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mnemos-capture",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "xkg — Turn what you discover into context your AI workers can use. Capture once, then brief, plan, and execute with any MCP-compatible tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"mnemos-capture": "
|
|
8
|
-
"xkg": "
|
|
9
|
-
"xmu": "
|
|
7
|
+
"mnemos-capture": "dist/cli/index.js",
|
|
8
|
+
"xkg": "dist/cli/index.js",
|
|
9
|
+
"xmu": "dist/cli/index.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "next dev",
|
|
@@ -38,31 +38,34 @@
|
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "https://github.com/xmu-labs/xkg.git"
|
|
41
|
+
"url": "git+https://github.com/xmu-labs/xkg.git"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://xkg.xmu.sh",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/xmu-labs/xkg/issues"
|
|
42
46
|
},
|
|
43
|
-
"homepage": "https://github.com/xmu-labs/xkg",
|
|
44
47
|
"files": [
|
|
45
48
|
"dist/cli/",
|
|
46
49
|
"LICENSE",
|
|
47
50
|
"README.md"
|
|
48
51
|
],
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@anthropic-ai/sdk": "^0.
|
|
51
|
-
"@
|
|
52
|
-
"next": "^16.
|
|
53
|
+
"@anthropic-ai/sdk": "^0.135.0",
|
|
54
|
+
"@neondatabase/serverless": "^1.2.0",
|
|
55
|
+
"next": "^16.4.2",
|
|
53
56
|
"react": "^19.3.0",
|
|
54
57
|
"react-dom": "^19.3.0"
|
|
55
58
|
},
|
|
56
59
|
"devDependencies": {
|
|
57
60
|
"@playwright/test": "^1.62.1",
|
|
61
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
58
62
|
"@types/node": "^26",
|
|
59
63
|
"@types/react": "^19.3.0",
|
|
60
64
|
"@types/react-dom": "^19.3.0",
|
|
61
|
-
"autoprefixer": "^10.6.1",
|
|
62
65
|
"eslint": "^9.39.5",
|
|
63
|
-
"eslint-config-next": "^16.
|
|
66
|
+
"eslint-config-next": "^16.4.2",
|
|
64
67
|
"postcss": "^8.5.3",
|
|
65
|
-
"tailwindcss": "^3.
|
|
68
|
+
"tailwindcss": "^4.3.3",
|
|
66
69
|
"typescript": "^6.0.3",
|
|
67
70
|
"vitest": "^5.0.1"
|
|
68
71
|
},
|