Skip to content

Commit de1a1d3

Browse files
committed
cli and MCP fixes
1 parent bee4207 commit de1a1d3

File tree

8 files changed

+635
-103
lines changed

8 files changed

+635
-103
lines changed

DEPLOY_INSTRUCTIONS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ This document covers the deployment steps for the Phase 3+ database changes (pro
44

55
---
66

7+
## ⚠️ CRITICAL: Pre-Deploy Code Changes
8+
9+
Before deploying, ensure these development overrides are reverted:
10+
11+
### CLI Remote URL
12+
13+
In `apps/cli/src/client/remote.ts`, change the `DEFAULT_REMOTE_URL` back to production:
14+
15+
```typescript
16+
// Change FROM (development):
17+
const DEFAULT_REMOTE_URL = 'http://localhost:5173';
18+
19+
// Change TO (production):
20+
const DEFAULT_REMOTE_URL = 'https://btca.dev';
21+
```
22+
23+
---
24+
725
## Pre-Deploy Checklist
826

927
- [ ] Backup production Convex database (optional but recommended)

apps/cli/src/client/remote.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* Communicates with the web app's API endpoints via the MCP protocol.
44
*/
55

6-
const DEFAULT_REMOTE_URL = 'https://btca.dev';
6+
// TODO: Change back to 'https://btca.dev' before deploying!
7+
const DEFAULT_REMOTE_URL = 'http://localhost:5173';
78

89
// Local type definitions to avoid circular dependencies
910
export interface GitResource {
@@ -152,6 +153,17 @@ export class RemoteClient {
152153
});
153154
}
154155

156+
const contentType = response.headers.get('content-type') ?? '';
157+
158+
if (contentType.includes('text/event-stream')) {
159+
const text = await response.text();
160+
const dataLine = text.split('\n').find((line) => line.startsWith('data: '));
161+
if (!dataLine) {
162+
throw new RemoteApiError('No data in SSE response');
163+
}
164+
return JSON.parse(dataLine.slice(6)) as T;
165+
}
166+
155167
return response.json() as Promise<T>;
156168
}
157169

0 commit comments

Comments
 (0)