replen 1.0.36 → 1.0.37
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/dist/mcp-setup.js +27 -8
- package/package.json +1 -1
package/dist/mcp-setup.js
CHANGED
|
@@ -26,14 +26,29 @@ import { fileURLToPath } from "node:url";
|
|
|
26
26
|
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
27
27
|
import { installSkills } from "./skill-install.js";
|
|
28
28
|
const SERVER_NAME = "replen";
|
|
29
|
-
// Launch the MCP via
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// `@^1`
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
29
|
+
// Launch the MCP via an EXACT pinned version, resolved from the npm registry at
|
|
30
|
+
// setup time — mirrors how the SessionStart hook pins replen@<version>. We used
|
|
31
|
+
// `@^1` for "auto-update each session", but npx caches per-spec and happily
|
|
32
|
+
// reuses a stale `@^1` resolution even after `npx @latest` — so the auto-update
|
|
33
|
+
// was illusory AND users got spurious "newer Replen available" nudges right after
|
|
34
|
+
// updating (the server sees the still-stale client version). Pinning the exact
|
|
35
|
+
// version makes each release a distinct, correctly-cached npx entry; re-running
|
|
36
|
+
// `npx replen mcp setup` re-resolves + re-pins to ship an update. Falls back to
|
|
37
|
+
// the `@^1` range only if the registry is unreachable at setup time.
|
|
38
|
+
let MCP_PKG = "@replen/mcp@^1";
|
|
39
|
+
// Resolve the exact latest @replen/mcp version to pin (fail-open to the range).
|
|
40
|
+
async function resolveMcpPkg() {
|
|
41
|
+
try {
|
|
42
|
+
const res = await fetch("https://registry.npmjs.org/@replen/mcp/latest", { signal: AbortSignal.timeout(3000) });
|
|
43
|
+
if (res.ok) {
|
|
44
|
+
const j = (await res.json());
|
|
45
|
+
if (typeof j.version === "string" && j.version)
|
|
46
|
+
return `@replen/mcp@${j.version}`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch { /* registry unreachable — keep the range fallback */ }
|
|
50
|
+
return "@replen/mcp@^1";
|
|
51
|
+
}
|
|
37
52
|
const CLAUDE_CONFIG = join(homedir(), ".claude.json");
|
|
38
53
|
const CLAUDE_SETTINGS = join(homedir(), ".claude", "settings.json");
|
|
39
54
|
const CODEX_CONFIG = join(homedir(), ".codex", "config.toml");
|
|
@@ -60,6 +75,10 @@ const REPLEN_AUTO_ALLOW = [
|
|
|
60
75
|
// ============================================================================
|
|
61
76
|
export async function setupMcp(token, base) {
|
|
62
77
|
console.log(` Wiring replen MCP into agent configs…`);
|
|
78
|
+
// Pin the exact latest MCP version (deterministic; avoids npx serving a stale
|
|
79
|
+
// `@^1` build and the spurious upgrade nudge that follows).
|
|
80
|
+
MCP_PKG = await resolveMcpPkg();
|
|
81
|
+
console.log(` MCP version pinned to ${MCP_PKG}`);
|
|
63
82
|
const results = [];
|
|
64
83
|
results.push(setupClaude(token, base));
|
|
65
84
|
results.push(setupCodex(token, base));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "Make your AI coding tools smarter. One command, no API keys, free. Replen watches what your projects actually do and surfaces a few things worth bringing in each month. Use one as is, port a piece of another, cherry pick an idea, or build it clean room. The match happens inside your AI tool's session. A few actionable matches a month, by design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|