replen 0.1.2 → 0.1.3
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/index.js +0 -1
- package/dist/init.js +11 -0
- package/dist/mcp-setup.js +10 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -34,7 +34,6 @@ async function main() {
|
|
|
34
34
|
}
|
|
35
35
|
console.log(`Signed in.`);
|
|
36
36
|
console.log(` Dashboard: ${cfg.base}`);
|
|
37
|
-
console.log(` Token: ${cfg.token.slice(0, 8)}…${cfg.token.slice(-4)}`);
|
|
38
37
|
console.log(` Saved: ${cfg.savedAt}`);
|
|
39
38
|
console.log(` Config: ${configPath()}`);
|
|
40
39
|
return;
|
package/dist/init.js
CHANGED
|
@@ -26,6 +26,17 @@ function openBrowser(url) {
|
|
|
26
26
|
function waitForCallback(port, expectedState) {
|
|
27
27
|
return new Promise((resolve, reject) => {
|
|
28
28
|
const server = createServer((req, res) => {
|
|
29
|
+
// Defence in depth against DNS rebinding: only accept requests whose
|
|
30
|
+
// Host header matches the loopback bind. Modern browsers (Chrome ≥ M94)
|
|
31
|
+
// already block public-DNS hostnames from rebinding to RFC1918, but an
|
|
32
|
+
// explicit check costs nothing.
|
|
33
|
+
const expectedHosts = new Set([`127.0.0.1:${port}`, `localhost:${port}`]);
|
|
34
|
+
const reqHost = (req.headers.host ?? "").toLowerCase();
|
|
35
|
+
if (!expectedHosts.has(reqHost)) {
|
|
36
|
+
res.writeHead(400, { "content-type": "text/plain" });
|
|
37
|
+
res.end("bad host");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
29
40
|
const url = new URL(req.url ?? "/", `http://127.0.0.1:${port}`);
|
|
30
41
|
if (url.pathname !== "/callback") {
|
|
31
42
|
res.writeHead(404, { "content-type": "text/plain" });
|
package/dist/mcp-setup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, renameSync } from "node:fs";
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, renameSync, chmodSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join, dirname } from "node:path";
|
|
4
4
|
// Write the @replen/mcp server entry into Claude Code's config. Uses npx so
|
|
@@ -17,8 +17,16 @@ function readJson(path) {
|
|
|
17
17
|
function writeJsonAtomic(path, data) {
|
|
18
18
|
mkdirSync(dirname(path), { recursive: true });
|
|
19
19
|
const tmp = `${path}.tmp.${Date.now()}`;
|
|
20
|
-
|
|
20
|
+
// The file contains the user's ingest token (DIGEST_TOKEN). On a
|
|
21
|
+
// multi-user box, the default 0644 leaks it to every local user, so
|
|
22
|
+
// create the tmp file 0600 and chmod the final path after rename in
|
|
23
|
+
// case the umask changed it on this platform.
|
|
24
|
+
writeFileSync(tmp, JSON.stringify(data, null, 2), { mode: 0o600 });
|
|
21
25
|
renameSync(tmp, path);
|
|
26
|
+
try {
|
|
27
|
+
chmodSync(path, 0o600);
|
|
28
|
+
}
|
|
29
|
+
catch { /* best-effort on platforms that don't support chmod */ }
|
|
22
30
|
}
|
|
23
31
|
export async function setupMcp(token, base) {
|
|
24
32
|
console.log(` Wiring replen MCP into Claude Code config…`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Smart AI Development workflows. The AI that asks 'can we do this better?' - replen reads your codebase against the live ecosystem every morning, surfaces drop-in libraries, ideas to port, and patterns to learn from. A proactive layer for your AI coding workflow. One-command setup: opens a browser to sign in, then wires the MCP server into Claude Code / Codex.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
],
|
|
19
19
|
"keywords": [
|
|
20
20
|
"replen",
|
|
21
|
-
"oss-discovery",
|
|
22
21
|
"claude-code",
|
|
23
22
|
"mcp",
|
|
24
23
|
"cli"
|
|
@@ -30,6 +29,7 @@
|
|
|
30
29
|
"directory": "cli"
|
|
31
30
|
},
|
|
32
31
|
"bugs": "https://github.com/replenhq/replen/issues",
|
|
32
|
+
"author": "replen.dev",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18"
|