rentline-sandbox 0.1.3 → 0.1.5

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-IQQBGGOI.js");
12
+ const { runSetup, parseSetupArgs } = await import("./setup-BFMWFMC2.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-IQQBGGOI.js");
34
+ const { runSetup, parseSetupArgs } = await import("./setup-BFMWFMC2.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, displayName);
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 MCP_SERVER_ENTRY = {
106
- command: "npx",
107
- args: ["-y", "rentline-sandbox"],
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 { execSync } = await import("child_process");
124
- const envFlags = Object.entries(entry.env ?? {}).map(([k, v]) => `-e ${k}="${v}"`).join(" ");
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", entry, "mcpServers");
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
- const skillSrc = join(__dirname, "../SKILL.md");
135
- if (existsSync(skillSrc)) {
136
- const targets = [
137
- join(homedir(), ".claude", "skills", "rentline-sandbox"),
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,37 @@ 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", entry, "mcpServers");
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", entry, "mcpServers");
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", entry, "mcpServers");
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", "config.json");
175
- const opencodeEntry = {
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: ["npx", "-y", "rentline-sandbox"],
156
+ command: NPX_CMD,
178
157
  enabled: true,
179
- environment: {
180
- SANDBOX_API_KEY: apiKey,
181
- SANDBOX_API_URL: apiUrl
182
- }
183
- };
184
- patchMcpJson(file, "rentline-sandbox", opencodeEntry, "mcp");
158
+ timeout: 3e4,
159
+ environment: env
160
+ }, "mcp");
185
161
  console.log(`Patched ${file}`);
186
- const skillSrc = join(__dirname, "../SKILL.md");
187
- if (existsSync(skillSrc)) {
188
- const targets = [
189
- join(homedir(), ".config", "opencode", "skills", "rentline-sandbox"),
190
- join(homedir(), ".claude", "skills", "rentline-sandbox"),
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
- }
162
+ installSkill([
163
+ join(homedir(), ".config", "opencode", "skills", "rentline-sandbox"),
164
+ join(homedir(), ".claude", "skills", "rentline-sandbox"),
165
+ join(homedir(), ".agents", "skills", "rentline-sandbox")
166
+ ]);
199
167
  break;
200
168
  }
201
169
  case "zed":
@@ -204,14 +172,24 @@ async function installForClient(clientName, scope, apiKey, apiUrl, displayName)
204
172
  case "other":
205
173
  default: {
206
174
  console.log(`
207
- Add the following to your MCP client config (exact key name may vary by client):
175
+ Add the following to your MCP client config:
208
176
  `);
209
- console.log(JSON.stringify({ "rentline-sandbox": entry }, null, 2));
210
- console.log("\nFor OpenCode specifically, use: sandbox setup --client opencode");
177
+ console.log(JSON.stringify({
178
+ "rentline-sandbox": { command: NPX_CMD[0], args: NPX_CMD.slice(1), env }
179
+ }, null, 2));
211
180
  break;
212
181
  }
213
182
  }
214
183
  }
184
+ function installSkill(dirs) {
185
+ const skillSrc = join(__dirname, "../SKILL.md");
186
+ if (!existsSync(skillSrc)) return;
187
+ for (const dir of dirs) {
188
+ mkdirSync(dir, { recursive: true });
189
+ copyFileSync(skillSrc, join(dir, "SKILL.md"));
190
+ console.log(`SKILL.md \u2192 ${dir}`);
191
+ }
192
+ }
215
193
  function patchMcpJson(filePath, serverName, entry, key) {
216
194
  mkdirSync(dirname(filePath), { recursive: true });
217
195
  let config = {};
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "rentline-sandbox",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
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": {