rentline-sandbox 0.1.3 → 0.1.4
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
CHANGED
|
@@ -9,7 +9,7 @@ var _require = createRequire(import.meta.url);
|
|
|
9
9
|
var { version } = _require("../package.json");
|
|
10
10
|
var args = process.argv.slice(2);
|
|
11
11
|
if (args[0] === "setup" || args[0] === "--setup") {
|
|
12
|
-
const { runSetup, parseSetupArgs } = await import("./setup-
|
|
12
|
+
const { runSetup, parseSetupArgs } = await import("./setup-MMARJIKJ.js");
|
|
13
13
|
const opts = parseSetupArgs(args.filter((a) => a !== "setup" && a !== "--setup"));
|
|
14
14
|
await runSetup(opts);
|
|
15
15
|
process.exit(0);
|
|
@@ -31,7 +31,7 @@ if (args.length === 0 || args[0] === "server" || args[0] === "--server") {
|
|
|
31
31
|
registerMortgage(program);
|
|
32
32
|
registerAdmin(program);
|
|
33
33
|
program.command("mcp-setup", { hidden: true }).allowUnknownOption().action(async () => {
|
|
34
|
-
const { runSetup, parseSetupArgs } = await import("./setup-
|
|
34
|
+
const { runSetup, parseSetupArgs } = await import("./setup-MMARJIKJ.js");
|
|
35
35
|
const opts = parseSetupArgs(process.argv.slice(3));
|
|
36
36
|
await runSetup(opts);
|
|
37
37
|
});
|
|
@@ -13,6 +13,7 @@ import { createInterface } from "readline";
|
|
|
13
13
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, copyFileSync } from "fs";
|
|
14
14
|
import { homedir, platform } from "os";
|
|
15
15
|
import { join, dirname } from "path";
|
|
16
|
+
import { execSync } from "child_process";
|
|
16
17
|
import { fileURLToPath } from "url";
|
|
17
18
|
var __filename = fileURLToPath(import.meta.url);
|
|
18
19
|
var __dirname = dirname(__filename);
|
|
@@ -90,7 +91,7 @@ async function runSetup(opts) {
|
|
|
90
91
|
const idx = parseInt(choice);
|
|
91
92
|
clientName = isNaN(idx) ? choice : clients[idx - 1] ?? "other";
|
|
92
93
|
}
|
|
93
|
-
await installForClient(clientName, opts.scope ?? "user", apiKey, apiUrl
|
|
94
|
+
await installForClient(clientName, opts.scope ?? "user", apiKey, apiUrl);
|
|
94
95
|
rl?.close();
|
|
95
96
|
console.log("\nSetup complete. Restart your AI client to load the Rentline Sandbox MCP server.\n");
|
|
96
97
|
}
|
|
@@ -102,47 +103,25 @@ function detectClient() {
|
|
|
102
103
|
if (env.OPENCODE_PROJECT || env.OPENCODE_SESSION) return "opencode";
|
|
103
104
|
return void 0;
|
|
104
105
|
}
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
env: {}
|
|
109
|
-
};
|
|
110
|
-
function mcpEntry(apiKey, apiUrl) {
|
|
111
|
-
return {
|
|
112
|
-
...MCP_SERVER_ENTRY,
|
|
113
|
-
env: {
|
|
114
|
-
SANDBOX_API_KEY: apiKey,
|
|
115
|
-
SANDBOX_API_URL: apiUrl
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
async function installForClient(clientName, scope, apiKey, apiUrl, displayName) {
|
|
120
|
-
const entry = mcpEntry(apiKey, apiUrl);
|
|
106
|
+
var NPX_CMD = ["npx", "-y", "rentline-sandbox"];
|
|
107
|
+
async function installForClient(clientName, scope, apiKey, apiUrl) {
|
|
108
|
+
const env = { SANDBOX_API_KEY: apiKey, SANDBOX_API_URL: apiUrl };
|
|
121
109
|
switch (clientName) {
|
|
122
110
|
case "claude-code": {
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
const cmd = `claude mcp add rentline-sandbox --scope ${scope} ${envFlags} -- npx -y rentline-sandbox`;
|
|
111
|
+
const envFlags = Object.entries(env).map(([k, v]) => `-e ${k}="${v}"`).join(" ");
|
|
112
|
+
const cmd = `claude mcp add rentline-sandbox --scope ${scope} ${envFlags} -- ${NPX_CMD.join(" ")}`;
|
|
126
113
|
try {
|
|
127
114
|
execSync(cmd, { stdio: "pipe" });
|
|
128
115
|
console.log(`Installed via claude CLI (scope=${scope})`);
|
|
129
116
|
} catch {
|
|
130
117
|
const file = join(homedir(), ".claude.json");
|
|
131
|
-
patchMcpJson(file, "rentline-sandbox",
|
|
118
|
+
patchMcpJson(file, "rentline-sandbox", { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }, "mcpServers");
|
|
132
119
|
console.log(`Patched ${file}`);
|
|
133
120
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
join(homedir(), ".agents", "skills", "rentline-sandbox")
|
|
139
|
-
];
|
|
140
|
-
for (const dir of targets) {
|
|
141
|
-
mkdirSync(dir, { recursive: true });
|
|
142
|
-
copyFileSync(skillSrc, join(dir, "SKILL.md"));
|
|
143
|
-
console.log(`SKILL.md \u2192 ${dir}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
121
|
+
installSkill([
|
|
122
|
+
join(homedir(), ".claude", "skills", "rentline-sandbox"),
|
|
123
|
+
join(homedir(), ".agents", "skills", "rentline-sandbox")
|
|
124
|
+
]);
|
|
146
125
|
break;
|
|
147
126
|
}
|
|
148
127
|
case "claude-desktop": {
|
|
@@ -154,48 +133,36 @@ async function installForClient(clientName, scope, apiKey, apiUrl, displayName)
|
|
|
154
133
|
} else {
|
|
155
134
|
file = join(homedir(), ".config", "Claude", "claude_desktop_config.json");
|
|
156
135
|
}
|
|
157
|
-
patchMcpJson(file, "rentline-sandbox",
|
|
136
|
+
patchMcpJson(file, "rentline-sandbox", { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }, "mcpServers");
|
|
158
137
|
console.log(`Patched ${file}`);
|
|
159
138
|
break;
|
|
160
139
|
}
|
|
161
140
|
case "cursor": {
|
|
162
141
|
const file = scope === "project" ? join(process.cwd(), ".cursor", "mcp.json") : join(homedir(), ".cursor", "mcp.json");
|
|
163
|
-
patchMcpJson(file, "rentline-sandbox",
|
|
142
|
+
patchMcpJson(file, "rentline-sandbox", { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }, "mcpServers");
|
|
164
143
|
console.log(`Patched ${file}`);
|
|
165
144
|
break;
|
|
166
145
|
}
|
|
167
146
|
case "windsurf": {
|
|
168
147
|
const file = platform() === "win32" ? join(process.env.APPDATA ?? homedir(), ".codeium", "windsurf", "mcp_config.json") : join(homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
169
|
-
patchMcpJson(file, "rentline-sandbox",
|
|
148
|
+
patchMcpJson(file, "rentline-sandbox", { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }, "mcpServers");
|
|
170
149
|
console.log(`Patched ${file}`);
|
|
171
150
|
break;
|
|
172
151
|
}
|
|
173
152
|
case "opencode": {
|
|
174
|
-
const file = scope === "project" ? join(process.cwd(), "opencode.json") : join(homedir(), ".config", "opencode", "
|
|
175
|
-
|
|
153
|
+
const file = scope === "project" ? join(process.cwd(), "opencode.json") : join(homedir(), ".config", "opencode", "opencode.json");
|
|
154
|
+
patchMcpJson(file, "rentline-sandbox", {
|
|
176
155
|
type: "local",
|
|
177
|
-
command:
|
|
156
|
+
command: NPX_CMD,
|
|
178
157
|
enabled: true,
|
|
179
|
-
environment:
|
|
180
|
-
|
|
181
|
-
SANDBOX_API_URL: apiUrl
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
patchMcpJson(file, "rentline-sandbox", opencodeEntry, "mcp");
|
|
158
|
+
environment: env
|
|
159
|
+
}, "mcp");
|
|
185
160
|
console.log(`Patched ${file}`);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
join(homedir(), ".agents", "skills", "rentline-sandbox")
|
|
192
|
-
];
|
|
193
|
-
for (const dir of targets) {
|
|
194
|
-
mkdirSync(dir, { recursive: true });
|
|
195
|
-
copyFileSync(skillSrc, join(dir, "SKILL.md"));
|
|
196
|
-
console.log(`SKILL.md \u2192 ${dir}`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
161
|
+
installSkill([
|
|
162
|
+
join(homedir(), ".config", "opencode", "skills", "rentline-sandbox"),
|
|
163
|
+
join(homedir(), ".claude", "skills", "rentline-sandbox"),
|
|
164
|
+
join(homedir(), ".agents", "skills", "rentline-sandbox")
|
|
165
|
+
]);
|
|
199
166
|
break;
|
|
200
167
|
}
|
|
201
168
|
case "zed":
|
|
@@ -204,14 +171,24 @@ async function installForClient(clientName, scope, apiKey, apiUrl, displayName)
|
|
|
204
171
|
case "other":
|
|
205
172
|
default: {
|
|
206
173
|
console.log(`
|
|
207
|
-
Add the following to your MCP client config
|
|
174
|
+
Add the following to your MCP client config:
|
|
208
175
|
`);
|
|
209
|
-
console.log(JSON.stringify({
|
|
210
|
-
|
|
176
|
+
console.log(JSON.stringify({
|
|
177
|
+
"rentline-sandbox": { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }
|
|
178
|
+
}, null, 2));
|
|
211
179
|
break;
|
|
212
180
|
}
|
|
213
181
|
}
|
|
214
182
|
}
|
|
183
|
+
function installSkill(dirs) {
|
|
184
|
+
const skillSrc = join(__dirname, "../SKILL.md");
|
|
185
|
+
if (!existsSync(skillSrc)) return;
|
|
186
|
+
for (const dir of dirs) {
|
|
187
|
+
mkdirSync(dir, { recursive: true });
|
|
188
|
+
copyFileSync(skillSrc, join(dir, "SKILL.md"));
|
|
189
|
+
console.log(`SKILL.md \u2192 ${dir}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
215
192
|
function patchMcpJson(filePath, serverName, entry, key) {
|
|
216
193
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
217
194
|
let config = {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rentline-sandbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "CLI and MCP server for the Rentline Sandbox real estate investment simulation game",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"sandbox": "dist/index.js",
|
|
8
|
-
"sandbox-mcp": "dist/server.js"
|
|
8
|
+
"sandbox-mcp": "dist/server.js",
|
|
9
|
+
"rentline-sandbox": "dist/server.js"
|
|
9
10
|
},
|
|
10
11
|
"main": "./dist/index.js",
|
|
11
12
|
"exports": {
|