replen 1.0.1 → 1.0.2
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 +43 -0
- package/package.json +1 -1
package/dist/mcp-setup.js
CHANGED
|
@@ -26,8 +26,26 @@ import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
|
26
26
|
import { installSkills } from "./skill-install.js";
|
|
27
27
|
const SERVER_NAME = "replen";
|
|
28
28
|
const CLAUDE_CONFIG = join(homedir(), ".claude.json");
|
|
29
|
+
const CLAUDE_SETTINGS = join(homedir(), ".claude", "settings.json");
|
|
29
30
|
const CODEX_CONFIG = join(homedir(), ".codex", "config.toml");
|
|
30
31
|
const GEMINI_CONFIG = join(homedir(), ".gemini", "settings.json");
|
|
32
|
+
// Read/triage replen MCP tools that are safe to auto-allow so the proactive
|
|
33
|
+
// footnote (replen_match) and in-session triage don't trigger a permission
|
|
34
|
+
// prompt every session. Deliberately EXCLUDES replen_run / replen_handoff /
|
|
35
|
+
// replen_feedback — those trigger pipeline runs / open PRs and should keep
|
|
36
|
+
// prompting for explicit consent.
|
|
37
|
+
const REPLEN_AUTO_ALLOW = [
|
|
38
|
+
"mcp__replen__replen_match",
|
|
39
|
+
"mcp__replen__replen_check_new",
|
|
40
|
+
"mcp__replen__replen_analyze",
|
|
41
|
+
"mcp__replen__replen_state",
|
|
42
|
+
"mcp__replen__replen_record_triage",
|
|
43
|
+
"mcp__replen__replen_today",
|
|
44
|
+
"mcp__replen__replen_search",
|
|
45
|
+
"mcp__replen__replen_starred",
|
|
46
|
+
"mcp__replen__replen_status",
|
|
47
|
+
"mcp__replen__replen_help",
|
|
48
|
+
];
|
|
31
49
|
// ============================================================================
|
|
32
50
|
// Public entry point
|
|
33
51
|
// ============================================================================
|
|
@@ -76,12 +94,37 @@ function setupClaude(token, base) {
|
|
|
76
94
|
};
|
|
77
95
|
const hooks = installSessionStartHook(config.hooks ?? {});
|
|
78
96
|
writeJsonAtomic(path, { ...config, mcpServers, hooks });
|
|
97
|
+
// Auto-allow the read/triage tools so the proactive footnote doesn't
|
|
98
|
+
// prompt every session. Best-effort: a failure here mustn't fail MCP setup.
|
|
99
|
+
try {
|
|
100
|
+
allowlistClaudeTools();
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
console.warn(` ⚠ Claude Code allowlist skipped — ${e.message}`);
|
|
104
|
+
}
|
|
79
105
|
return { ok: true, label: "Claude Code", path, action: existed ? "updated" : "added" };
|
|
80
106
|
}
|
|
81
107
|
catch (e) {
|
|
82
108
|
return { ok: false, label: "Claude Code", path, error: e.message };
|
|
83
109
|
}
|
|
84
110
|
}
|
|
111
|
+
// Merge the replen read/triage tools into Claude Code's permission allowlist
|
|
112
|
+
// (~/.claude/settings.json → permissions.allow) so the proactive footnote +
|
|
113
|
+
// in-session triage run without a per-session permission prompt. Non-
|
|
114
|
+
// destructive: preserves existing allow entries and every other setting.
|
|
115
|
+
function allowlistClaudeTools() {
|
|
116
|
+
const path = CLAUDE_SETTINGS;
|
|
117
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
118
|
+
const config = existsSync(path) ? readJson(path) : {};
|
|
119
|
+
const permissions = config.permissions ?? {};
|
|
120
|
+
const existingAllow = Array.isArray(permissions.allow) ? permissions.allow : [];
|
|
121
|
+
const allow = Array.from(new Set([...existingAllow, ...REPLEN_AUTO_ALLOW]));
|
|
122
|
+
if (allow.length === existingAllow.length)
|
|
123
|
+
return; // already fully allowlisted
|
|
124
|
+
backupIfExists(path);
|
|
125
|
+
writeJsonAtomic(path, { ...config, permissions: { ...permissions, allow } });
|
|
126
|
+
console.log(` ✓ Claude Code: allowlisted replen read tools (no more per-session prompts)`);
|
|
127
|
+
}
|
|
85
128
|
function setupGemini(token, base) {
|
|
86
129
|
const path = GEMINI_CONFIG;
|
|
87
130
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Make your AI coding tools smarter. One command, no API keys. Replen scouts the OSS firehose against your projects and surfaces drop-in libraries, ideas to port, and dead deps to swap — the match decision happens inside your AI tool's session on your subscription tokens. 1-3 actionable matches a month, by design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|