@lightupai/polaris 0.0.20 → 0.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/cli.ts +13 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightupai/polaris",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "polaris": "bin/polaris",
package/src/cli/cli.ts CHANGED
@@ -109,20 +109,22 @@ function appToApi(appUrl: string): string {
109
109
  async function install(participantId?: string) {
110
110
  await mkdir(CLAUDE_DIR, { recursive: true });
111
111
 
112
- // Ensure the package is globally installed so polaris-mcp binary persists
113
- console.log(" Installing @lightupai/polaris globally...");
114
- const npmInstall = Bun.spawnSync(["npm", "install", "-g", "@lightupai/polaris@latest"], {
115
- stdout: "ignore",
116
- stderr: "pipe",
117
- });
112
+ // Install package to ~/.polaris/mcp/ (user-local, no sudo needed, persistent)
113
+ const mcpDir = join(POLARIS_DIR, "mcp");
114
+ await mkdir(mcpDir, { recursive: true });
115
+
116
+ console.log(" Installing MCP server to ~/.polaris/mcp/...");
117
+ const npmInstall = Bun.spawnSync(
118
+ ["npm", "install", "--prefix", mcpDir, "@lightupai/polaris@latest"],
119
+ { stdout: "ignore", stderr: "pipe" }
120
+ );
118
121
  if (npmInstall.exitCode !== 0) {
119
- console.error(" Warning: global install failed. MCP server may not work.");
120
- console.error(" Run manually: npm install -g @lightupai/polaris");
122
+ console.error(" Warning: MCP server install failed.");
123
+ console.error(" " + npmInstall.stderr.toString().trim());
121
124
  }
122
125
 
123
- // Find the globally installed polaris-mcp binary
124
- const whichResult = Bun.spawnSync(["which", "polaris-mcp"], { stdout: "pipe" });
125
- const mcpBin = whichResult.stdout.toString().trim() || "polaris-mcp";
126
+ // The binary is at ~/.polaris/mcp/node_modules/.bin/polaris-mcp
127
+ const mcpBin = join(mcpDir, "node_modules", ".bin", "polaris-mcp");
126
128
 
127
129
  const mcpConfig = {
128
130
  mcpServers: {