polydev-ai 1.4.0 → 1.4.1

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/README.md CHANGED
@@ -1,359 +1,160 @@
1
- # Polydev AI Website
1
+ # Polydev AI MCP Server
2
2
 
3
- Advanced Model Context Protocol platform with comprehensive multi-LLM integrations, subscription-based CLI access, OAuth bridges, and advanced tooling for AI development.
3
+ Get diverse AI perspectives from multiple LLMs via Model Context Protocol (MCP). Supports Cline, Claude Code, and other MCP clients with local CLI detection and remote AI perspectives.
4
4
 
5
5
  ## Features
6
6
 
7
- ### 🤖 **Comprehensive LLM Integration**
8
- - **API-Based Providers**: Direct integration with 8+ providers (Anthropic, OpenAI, Google, etc.)
9
- - **Subscription-Based CLI Access**: Use your existing ChatGPT Plus, Claude Pro, GitHub Copilot subscriptions
10
- - **Unified Interface**: Single API for all providers with consistent streaming responses
11
- - **Auto-Detection**: Automatic CLI tool discovery and path configuration
12
-
13
- ### 🔧 **CLI Provider Support**
14
- - **Codex CLI**: Access GPT-5 with high reasoning through ChatGPT subscription
15
- - **Claude Code CLI**: Use Claude via Anthropic subscription
16
- - **Gemini CLI**: Google Cloud authentication integration
17
- - **GitHub Copilot**: VS Code Language Model API integration
18
-
19
- ### 🛠 **Advanced Tooling**
20
- - **Model Context Protocol (MCP)**: Hosted MCP server with OAuth authentication (like Vercel)
21
- - **Multi-Authentication**: Both OAuth and API token support for maximum flexibility
22
- - **Process Execution**: Cross-platform CLI management with timeout handling
23
- - **Path Auto-Discovery**: Smart detection of CLI installations across Windows, macOS, Linux
24
- - **Real-time Status**: Live CLI availability and authentication checking
25
-
26
- ### 🔒 **Security & Authentication**
27
- - **Encrypted Storage**: Browser-based API key encryption
28
- - **OAuth Bridges**: Secure authentication flows
29
- - **Subscription Auth**: No API costs - use existing subscriptions
30
- - **Local Storage**: Keys never leave your device
31
-
32
- ### 📊 **Monitoring & Analytics**
33
- - **PostHog Integration**: Advanced user analytics and feature tracking
34
- - **BetterStack Monitoring**: System health and performance monitoring
35
- - **Upstash Redis**: High-performance caching layer
36
- - **Supabase Auth**: Robust authentication system
37
-
38
- ## Tech Stack
39
-
40
- ### **Frontend**
41
- - **Framework**: Next.js 15 with App Router
42
- - **UI Library**: React 18 with TypeScript
43
- - **Styling**: Tailwind CSS with shadcn/ui components
44
- - **Icons**: Lucide React
45
- - **State Management**: React hooks with custom providers
46
-
47
- ### **LLM Integration**
48
- - **API Handlers**: Custom TypeScript handlers for each provider
49
- - **CLI Integration**: Cross-platform process execution utilities
50
- - **Streaming**: Server-Sent Events for real-time responses
51
- - **Authentication**: Both API key and subscription-based authentication
52
-
53
- ### **Backend Services**
54
- - **Analytics**: PostHog for user tracking and feature analytics
55
- - **Monitoring**: BetterStack for system health and logging
56
- - **Caching**: Upstash Redis for high-performance data caching
57
- - **Authentication**: Supabase for user management and auth flows
58
- - **Database**: Supabase PostgreSQL for user data
59
-
60
- ### **Security & Storage**
61
- - **Encryption**: Browser SubtleCrypto API for client-side encryption
62
- - **Storage**: Local browser storage with encrypted API keys
63
- - **CORS**: Configured for secure cross-origin requests
64
-
65
- ### **Development & Deployment**
66
- - **Package Manager**: npm with Node.js 18+
67
- - **Build System**: Next.js with TypeScript compilation
68
- - **Deployment**: Vercel with automatic deployments
69
- - **Environment**: Support for multiple deployment environments
70
-
71
- ## Getting Started
72
-
73
- ### **Prerequisites**
74
- - Node.js 18+
75
- - npm or yarn package manager
76
- - (Optional) CLI tools for subscription-based access:
77
- - Codex CLI for ChatGPT Plus integration
78
- - Claude Code CLI for Anthropic Pro integration
79
- - Gemini CLI for Google Cloud integration
80
- - VS Code with GitHub Copilot for Copilot integration
81
-
82
- ### **Installation**
83
-
84
- 1. **Clone the repository**
85
- ```bash
86
- git clone <repository-url>
87
- cd polydev-website
88
- ```
7
+ - 🤖 **Multi-Model AI Perspectives**: Get responses from GPT-4, Claude, Gemini, and more
8
+ - 🔧 **Local CLI Detection**: Automatically detect and use Claude Code, Codex CLI, Gemini CLI
9
+ - **Smart Caching**: Intelligent refresh intervals based on CLI status
10
+ - 🔄 **Fallback Support**: Local CLI + remote perspectives for comprehensive responses
11
+ - 🔐 **Secure**: Token-based authentication with your Polydev account
89
12
 
90
- 2. **Install dependencies**
91
- ```bash
92
- npm install
93
- ```
13
+ ## Installation
94
14
 
95
- 3. **Set up environment variables** (see Environment Variables section)
15
+ ### For Claude Code Users
96
16
 
97
- 4. **Start development server**
98
17
  ```bash
99
- npm run dev
100
- ```
18
+ # Install globally
19
+ npm install -g polydev-ai
101
20
 
102
- 5. **Open the application**
103
- Navigate to [http://localhost:3000](http://localhost:3000) to view the application.
21
+ # Or use directly with npx
22
+ npx polydev-ai
23
+ ```
104
24
 
105
- ### **Quick Configuration**
25
+ ### For Cline Users
26
+
27
+ Add to your MCP settings (`.cline/mcp_servers.json`):
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "polydev": {
33
+ "command": "npx",
34
+ "args": ["polydev-ai"],
35
+ "env": {
36
+ "POLYDEV_USER_TOKEN": "your_token_here"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
106
42
 
107
- 1. **API Key Setup**: Go to Settings → API Keys tab to configure traditional API access
108
- 2. **CLI Setup**: Go to Settings → CLI Subscriptions tab to set up subscription-based access
109
- 3. **Provider Selection**: Choose your preferred LLM provider from the dropdown
110
- 4. **Test Integration**: Use the chat interface to test your configuration
43
+ ## Configuration
111
44
 
112
- ## Environment Variables
45
+ ### Get Your Token
113
46
 
114
- Create a `.env.local` file with the following variables:
47
+ 1. Sign up at [polydev.ai](https://polydev.ai)
48
+ 2. Go to your dashboard and copy your MCP token
49
+ 3. Set the environment variable:
115
50
 
116
- ```env
117
- # Supabase
118
- NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
119
- NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
120
- SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
51
+ ```bash
52
+ export POLYDEV_USER_TOKEN="pd_your_token_here"
53
+ ```
121
54
 
122
- # PostHog Analytics
123
- NEXT_PUBLIC_POSTHOG_KEY=your_posthog_key
124
- NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
55
+ ### Claude Code Integration
125
56
 
126
- # Upstash Redis
127
- UPSTASH_REDIS_REST_URL=your_upstash_redis_url
128
- UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
57
+ Add to your Claude Code MCP configuration:
129
58
 
130
- # BetterStack Logging
131
- BETTERSTACK_LOGS_TOKEN=your_betterstack_token
59
+ ```json
60
+ "polydev": {
61
+ "disabled": false,
62
+ "timeout": 120,
63
+ "type": "http",
64
+ "url": "https://www.polydev.ai/api/mcp"
65
+ },
132
66
  ```
133
67
 
134
- ## CLI Provider Setup
135
-
136
- ### **Codex CLI (ChatGPT Plus Integration)**
137
-
138
- 1. **Install Codex CLI**:
139
- - Download from [OpenAI's official repository](https://openai.com/chatgpt/desktop)
140
- - Ensure you have an active ChatGPT Plus subscription
141
-
142
- 2. **Authentication**:
143
- ```bash
144
- codex auth
145
- ```
146
-
147
- 3. **Verify Installation**:
148
- ```bash
149
- codex --version
150
- ```
151
-
152
- ### **Claude Code CLI (Anthropic Pro Integration)**
153
-
154
- 1. **Install Claude Code CLI**:
155
- - Follow instructions at [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
156
- - Requires active Claude Pro subscription
157
-
158
- 2. **Authentication**:
159
- ```bash
160
- claude login
161
- ```
162
-
163
- 3. **Verify Installation**:
164
- ```bash
165
- claude --version
166
- ```
167
-
168
- ### **Gemini CLI (Google Cloud Integration)**
169
-
170
- 1. **Install Google Cloud CLI**:
171
- ```bash
172
- # macOS
173
- brew install google-cloud-sdk
174
-
175
- # Windows
176
- # Download from https://cloud.google.com/sdk/docs/install
177
-
178
- # Linux
179
- curl https://sdk.cloud.google.com | bash
180
- ```
181
-
182
- 2. **Authentication**:
183
- ```bash
184
- gcloud auth login
185
- gcloud auth application-default login
186
- ```
187
-
188
- ### **GitHub Copilot Integration**
189
-
190
- 1. **Install VS Code** with GitHub Copilot extension
191
- 2. **Authentication**: Sign in with your GitHub account that has Copilot access
192
- 3. **Verification**: The application will detect VS Code and Copilot availability automatically
193
-
194
- ## API Provider Configuration
195
-
196
- ### **Setting Up API Keys**
197
-
198
- 1. Navigate to Settings → API Keys tab
199
- 2. Select your preferred provider from the dropdown
200
- 3. Enter your API key (encrypted automatically)
201
- 4. Choose your preferred model
202
- 5. Test the configuration
203
-
204
- ### **Supported API Providers**
205
-
206
- | Provider | Models | Context Window | Features |
207
- |----------|--------|---------------|----------|
208
- | **Anthropic** | Claude 3.5 Sonnet, Haiku, Opus | 200K tokens | Best for reasoning and code |
209
- | **OpenAI** | GPT-4o, GPT-4 Turbo, GPT-3.5 | 128K tokens | Versatile, widely adopted |
210
- | **Google Gemini** | Gemini 1.5 Pro, Flash | 1M+ tokens | Large context window |
211
- | **OpenRouter** | 100+ models | Varies | Access to multiple providers |
212
- | **Groq** | Open-source models | Varies | Ultra-fast inference |
213
- | **Perplexity** | Search-optimized models | Varies | AI search and reasoning |
214
- | **DeepSeek** | Reasoning models | Varies | Advanced reasoning capabilities |
215
- | **Mistral AI** | European AI models | Varies | Strong performance, EU-based |
68
+ ## Available Tools
69
+
70
+ - `get_perspectives` - Get AI responses from multiple models
71
+ - `force_cli_detection` - Force detection of local CLI tools
72
+ - `get_cli_status` - Check status of CLI tools (Claude Code, Codex, Gemini)
73
+ - `send_cli_prompt` - Send prompts to local CLI with perspectives fallback
216
74
 
217
75
  ## Usage Examples
218
76
 
219
- ### **Basic Chat Interface**
77
+ ### Get Multi-Model Perspectives
220
78
 
221
- 1. Configure your preferred provider (API key or CLI)
222
- 2. Select a model from the dropdown
223
- 3. Start chatting in the main interface
224
- 4. Switch providers anytime without losing conversation history
79
+ ```typescript
80
+ // Use the get_perspectives tool
81
+ {
82
+ "prompt": "How do I optimize React performance?",
83
+ "models": ["gpt-4", "claude-3-sonnet", "gemini-pro"]
84
+ }
85
+ ```
225
86
 
226
- ### **CLI Provider Usage**
87
+ ### Check CLI Status
227
88
 
228
89
  ```typescript
229
- // The application automatically detects CLI availability
230
- // Users can configure custom paths if needed
231
-
232
- // Example: Using Codex CLI for high reasoning
233
- const response = await llmService.createCliMessage(
234
- 'codex',
235
- 'You are a helpful AI assistant',
236
- [{ role: 'user', content: 'Explain quantum computing' }],
237
- { temperature: 0.7 }
238
- )
90
+ // Check all CLI tools
91
+ await get_cli_status({})
92
+
93
+ // Check specific tool
94
+ await get_cli_status({ provider_id: "claude_code" })
239
95
  ```
240
96
 
241
- ### **API Provider Usage**
97
+ ### Send CLI Prompt with Fallback
242
98
 
243
99
  ```typescript
244
- // Standard API key usage
245
- const response = await llmService.createMessage(
246
- 'You are a helpful AI assistant',
247
- [{ role: 'user', content: 'Write a Python function' }],
248
- { provider: 'anthropic', model: 'claude-3-5-sonnet-20241022' }
249
- )
100
+ await send_cli_prompt({
101
+ provider_id: "claude_code",
102
+ prompt: "Write a Python function to parse JSON",
103
+ mode: "args"
104
+ })
250
105
  ```
251
106
 
252
- ## Architecture Overview
107
+ ## Supported CLI Tools
253
108
 
254
- ### **CLI Integration Architecture**
109
+ - **Claude Code** (`claude`) - Anthropic's official CLI
110
+ - **Codex CLI** (`codex`) - OpenAI's code CLI
111
+ - **Gemini CLI** (`gemini`) - Google's Gemini CLI
255
112
 
256
- ```
257
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
258
- │ Frontend UI │────│ Process Utils │────│ CLI Tools │
259
- │ (React/TS) │ │ (Node.js) │ │ (External) │
260
- └─────────────────┘ └──────────────────┘ └─────────────────┘
261
- │ │ │
262
- │ │ │
263
- ▼ ▼ ▼
264
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
265
- │ LLM Service │ │ CLI Handlers │ │ Subscriptions │
266
- │ (Unified API) │ │ (Per Provider) │ │ (ChatGPT+, etc) │
267
- └─────────────────┘ └──────────────────┘ └─────────────────┘
268
- ```
113
+ ## Smart Refresh System
114
+
115
+ The MCP server automatically detects CLI status changes:
269
116
 
270
- ### **Security Model**
117
+ - **Unavailable CLIs**: Check every 2 minutes
118
+ - **Unauthenticated CLIs**: Check every 3 minutes
119
+ - **Working CLIs**: Check every 10 minutes
120
+ - **Fallback detection**: Check every 5 minutes
121
+
122
+ ## Environment Variables
271
123
 
272
- - **API Keys**: Encrypted using browser SubtleCrypto API
273
- - **Local Storage**: Keys never leave your device
274
- - **CLI Authentication**: Uses existing subscription authentication
275
- - **Process Isolation**: CLI processes run in isolated environments
124
+ - `POLYDEV_USER_TOKEN` - Your Polydev authentication token (required)
125
+ - `POLYDEV_CLI_DEBUG` - Enable CLI debugging output
126
+ - `CLAUDE_CODE_PATH` - Custom path to Claude Code CLI
127
+ - `CODEX_CLI_PATH` - Custom path to Codex CLI
128
+ - `GEMINI_CLI_PATH` - Custom path to Gemini CLI
276
129
 
277
130
  ## Troubleshooting
278
131
 
279
- ### **CLI Provider Issues**
280
-
281
- **Codex CLI not detected:**
282
- 1. Verify ChatGPT Plus subscription is active
283
- 2. Check installation path: `which codex`
284
- 3. Re-run authentication: `codex auth`
285
- 4. Configure custom path in Settings → CLI Subscriptions
286
-
287
- **Claude Code CLI authentication failed:**
288
- 1. Ensure Claude Pro subscription
289
- 2. Run `claude login` manually
290
- 3. Check network connectivity
291
- 4. Verify CLI version compatibility
292
-
293
- **Gemini CLI setup issues:**
294
- 1. Install Google Cloud SDK completely
295
- 2. Run both `gcloud auth` commands
296
- 3. Enable required APIs in Google Cloud Console
297
- 4. Check quota limits
298
-
299
- **GitHub Copilot not available:**
300
- 1. Install VS Code with Copilot extension
301
- 2. Sign in to GitHub account with Copilot access
302
- 3. Restart the application
303
- 4. Check VS Code Language Model API availability
304
-
305
- ### **API Provider Issues**
306
-
307
- **API key validation failed:**
308
- 1. Verify the key is correctly copied (no extra spaces)
309
- 2. Check if the key has required permissions
310
- 3. Ensure sufficient account credits/quota
311
- 4. Try regenerating the API key
312
-
313
- **Connection timeout:**
314
- 1. Check internet connectivity
315
- 2. Verify firewall settings
316
- 3. Try different model/provider
317
- 4. Increase timeout in settings
318
-
319
- **Model not available:**
320
- 1. Check provider documentation for model availability
321
- 2. Verify your account tier supports the model
322
- 3. Try alternative models from the same provider
323
-
324
- ## Development
325
-
326
- ### **Adding New CLI Providers**
327
-
328
- 1. **Create handler** in `src/lib/llm/handlers/`
329
- 2. **Update types** in `src/types/api-configuration.ts`
330
- 3. **Add configuration** to `CLI_PROVIDERS` constant
331
- 4. **Update UI** in `CliProviderConfiguration.tsx`
332
- 5. **Register handler** in `LLMService`
333
-
334
- ### **Adding New API Providers**
335
-
336
- 1. **Create handler** implementing `ApiHandler` interface
337
- 2. **Update `ApiProvider` type** and `PROVIDERS` configuration
338
- 3. **Add API key fields** to `ApiConfiguration`
339
- 4. **Update UI** components for new provider
340
- 5. **Add authentication logic**
341
-
342
- ## Performance Optimization
343
-
344
- ### **CLI Response Optimization**
345
- - CLI processes are cached and reused when possible
346
- - Streaming responses reduce perceived latency
347
- - Process timeouts prevent hanging connections
348
- - Cross-platform path detection minimizes setup time
349
-
350
- ### **API Response Optimization**
351
- - Server-Sent Events for real-time streaming
352
- - Connection pooling for API requests
353
- - Response caching for repeated queries
354
- - Automatic retry logic with exponential backoff
355
-
356
- ## Health Check
357
-
358
- The application includes a health check endpoint at `/api/health` for monitoring purposes.
359
- # Trigger deployment
132
+ ### CLI Not Detected
133
+
134
+ 1. Ensure the CLI is installed and in your PATH
135
+ 2. Check authentication: `claude auth status` / `codex login status`
136
+ 3. Enable debugging: `export POLYDEV_CLI_DEBUG=1`
137
+
138
+ ### Token Issues
139
+
140
+ 1. Verify your token at [polydev.ai/dashboard](https://polydev.ai/dashboard)
141
+ 2. Ensure the token starts with `pd_`
142
+ 3. Check environment variable is set correctly
143
+
144
+ ### Permission Errors
145
+
146
+ ```bash
147
+ # Fix npm permissions
148
+ npm config set prefix '~/.npm-global'
149
+ export PATH=~/.npm-global/bin:$PATH
150
+ ```
151
+
152
+ ## Support
153
+
154
+ - 📧 Email: [support@polydev.ai](mailto:support@polydev.ai)
155
+ - 📖 Docs: [polydev.ai/docs](https://polydev.ai/docs)
156
+ - 🐛 Issues: [GitHub Issues](https://github.com/backspacevenkat/polydev-website/issues)
157
+
158
+ ## License
159
+
160
+ MIT License - see LICENSE file for details.
package/package.json CHANGED
@@ -1,102 +1,46 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.4.0",
4
- "description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
3
+ "version": "1.4.1",
4
+ "description": "Get diverse AI perspectives from multiple LLMs via MCP - supports Cline, Claude Code, and other MCP clients",
5
+ "main": "stdio-wrapper.js",
6
+ "bin": {
7
+ "polydev-ai": "./stdio-wrapper.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node server.js",
11
+ "test": "node server.js --help"
12
+ },
5
13
  "keywords": [
6
14
  "mcp",
7
15
  "model-context-protocol",
8
16
  "ai",
17
+ "llm",
18
+ "perspectives",
19
+ "multi-model",
20
+ "cline",
9
21
  "claude",
10
22
  "openai",
11
- "perspectives",
12
- "cli",
13
- "agent",
14
- "assistant"
23
+ "anthropic",
24
+ "gemini",
25
+ "polydev"
15
26
  ],
16
- "author": "Polydev AI",
27
+ "author": "Polydev AI <support@polydev.ai>",
17
28
  "license": "MIT",
18
- "private": false,
19
- "main": "mcp/server.js",
20
- "bin": {
21
- "polydev-stdio": "mcp/stdio-wrapper.js"
29
+ "engines": {
30
+ "node": ">=16.0.0"
22
31
  },
23
32
  "files": [
24
- "mcp/",
25
- "lib/",
26
- "README.md",
27
- "LICENSE"
33
+ "stdio-wrapper.js",
34
+ "manifest.json",
35
+ "README.md"
28
36
  ],
29
- "scripts": {
30
- "dev": "next dev",
31
- "build": "next build",
32
- "start": "next start",
33
- "lint": "next lint",
34
- "test": "jest",
35
- "test:watch": "jest --watch",
36
- "test:coverage": "jest --coverage",
37
- "test:api": "jest __tests__/api",
38
- "test:vm": "jest __tests__/api/vm",
39
- "test:admin": "jest __tests__/api/admin",
40
- "mcp": "node mcp/server.js",
41
- "mcp-stdio": "node mcp/stdio-wrapper.js",
42
- "cli-detect": "node -e \"const CLIManager = require('./lib/cliManager').default; const m = new CLIManager(); m.forceCliDetection().then(console.log);\""
43
- },
44
37
  "repository": {
45
38
  "type": "git",
46
- "url": "https://github.com/polydev-ai/perspectives-mcp.git"
39
+ "url": "https://github.com/backspacevenkat/polydev-website.git",
40
+ "directory": "mcp"
47
41
  },
48
- "homepage": "https://polydev.ai",
42
+ "homepage": "https://polydev.ai/docs/mcp-integration",
49
43
  "bugs": {
50
- "url": "https://github.com/polydev-ai/perspectives-mcp/issues"
51
- },
52
- "dependencies": {
53
- "@hello-pangea/dnd": "^18.0.1",
54
- "@radix-ui/react-dialog": "^1.1.15",
55
- "@radix-ui/react-progress": "^1.1.7",
56
- "@radix-ui/react-select": "^2.2.6",
57
- "@radix-ui/react-slot": "^1.2.3",
58
- "@radix-ui/react-tabs": "^1.1.13",
59
- "@supabase/ssr": "^0.4.0",
60
- "@supabase/supabase-js": "^2.45.0",
61
- "@upstash/redis": "^1.34.0",
62
- "class-variance-authority": "^0.7.1",
63
- "clsx": "^2.1.1",
64
- "date-fns": "^4.1.0",
65
- "dotenv": "^17.2.2",
66
- "framer-motion": "^12.23.22",
67
- "lucide-react": "^0.542.0",
68
- "marked": "^16.2.1",
69
- "next": "15.0.0",
70
- "polydev-ai": "^1.2.0",
71
- "posthog-js": "^1.157.2",
72
- "prismjs": "^1.30.0",
73
- "react": "^18.3.1",
74
- "react-dom": "^18.3.1",
75
- "resend": "^6.0.2",
76
- "shelljs": "^0.8.5",
77
- "sonner": "^2.0.7",
78
- "stripe": "^18.5.0",
79
- "tailwind-merge": "^3.3.1",
80
- "tailwindcss-animate": "^1.0.7",
81
- "ts-node": "^10.9.2",
82
- "use-debounce": "^10.0.6",
83
- "which": "^5.0.0"
84
- },
85
- "devDependencies": {
86
- "@testing-library/jest-dom": "^6.9.1",
87
- "@testing-library/react": "^16.3.0",
88
- "@types/jest": "^30.0.0",
89
- "@types/node": "^20.16.1",
90
- "@types/react": "^18.3.3",
91
- "@types/react-dom": "^18.3.0",
92
- "autoprefixer": "^10.4.20",
93
- "eslint": "^8.57.0",
94
- "eslint-config-next": "15.0.0",
95
- "jest": "^30.2.0",
96
- "jest-environment-jsdom": "^30.2.0",
97
- "postcss": "^8.4.41",
98
- "tailwindcss": "^3.4.10",
99
- "ts-jest": "^29.4.4",
100
- "typescript": "^5.5.4"
44
+ "url": "https://github.com/backspacevenkat/polydev-website/issues"
101
45
  }
102
- }
46
+ }
@@ -505,9 +505,13 @@ class StdioMCPWrapper {
505
505
  raw: true // Flag to indicate this is pre-formatted content
506
506
  };
507
507
  } else if (remoteResponse.error) {
508
+ // Normalize error - handle both string and object formats
509
+ const errorMessage = typeof remoteResponse.error === 'string'
510
+ ? remoteResponse.error
511
+ : (remoteResponse.error?.message || JSON.stringify(remoteResponse.error) || 'Remote perspectives failed');
508
512
  return {
509
513
  success: false,
510
- error: remoteResponse.error.message || 'Remote perspectives failed',
514
+ error: errorMessage,
511
515
  timestamp: new Date().toISOString()
512
516
  };
513
517
  } else {
@@ -564,8 +568,9 @@ class StdioMCPWrapper {
564
568
  } else {
565
569
  // Both failed
566
570
  combinedResult.success = false;
567
- const cliErrors = localResults.map(cli => `${cli.provider_id}: ${cli.error}`).join('; ');
568
- combinedResult.error = `All local CLIs failed: ${cliErrors}; Perspectives also failed: ${perspectivesResult.error}`;
571
+ const cliErrors = localResults.map(cli => `${cli.provider_id}: ${cli.error || 'Unknown error'}`).join('; ');
572
+ const perspectivesError = perspectivesResult?.error || 'Unknown remote error';
573
+ combinedResult.error = `All local CLIs failed: ${cliErrors}; Perspectives also failed: ${perspectivesError}`;
569
574
  }
570
575
 
571
576
  return combinedResult;