@lightupai/polaris 0.0.19 → 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 +19 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightupai/polaris",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "polaris": "bin/polaris",
package/src/cli/cli.ts CHANGED
@@ -109,15 +109,28 @@ function appToApi(appUrl: string): string {
109
109
  async function install(participantId?: string) {
110
110
  await mkdir(CLAUDE_DIR, { recursive: true });
111
111
 
112
- // MCP server config
113
- // Use npx to run polaris-mcp from the published package. This avoids
114
- // dangling file paths when installed via npx (temp directory gets cleaned up).
115
- // The polaris-mcp bin entry resolves to src/client/client.ts within the package.
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
+ );
121
+ if (npmInstall.exitCode !== 0) {
122
+ console.error(" Warning: MCP server install failed.");
123
+ console.error(" " + npmInstall.stderr.toString().trim());
124
+ }
125
+
126
+ // The binary is at ~/.polaris/mcp/node_modules/.bin/polaris-mcp
127
+ const mcpBin = join(mcpDir, "node_modules", ".bin", "polaris-mcp");
128
+
116
129
  const mcpConfig = {
117
130
  mcpServers: {
118
131
  polaris: {
119
- command: "npx",
120
- args: ["-y", "polaris-mcp"],
132
+ command: mcpBin,
133
+ args: [],
121
134
  env: {
122
135
  POLARIS_DAEMON_URL: "http://127.0.0.1:4322",
123
136
  },