@insforge/install 0.0.50 → 0.0.51
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/.mcp.json +2 -2
- package/AGENTS.md +99 -0
- package/dist/index.js +3 -1
- package/dist/utils.js +4 -4
- package/package.json +1 -1
package/.mcp.json
CHANGED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Instructions building apps with MCP
|
|
3
|
+
globs: *
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# InsForge SDK Documentation - Overview
|
|
8
|
+
|
|
9
|
+
## What is InsForge?
|
|
10
|
+
|
|
11
|
+
Backend-as-a-service (BaaS) platform providing:
|
|
12
|
+
|
|
13
|
+
- **Database**: PostgreSQL with PostgREST API
|
|
14
|
+
- **Authentication**: Email/password + OAuth (Google, GitHub)
|
|
15
|
+
- **Storage**: File upload/download
|
|
16
|
+
- **AI**: Chat completions and image generation (OpenAI-compatible)
|
|
17
|
+
- **Functions**: Serverless function deployment
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### 🚨 CRITICAL: Follow these steps in order
|
|
22
|
+
|
|
23
|
+
### Step 1: Download Template
|
|
24
|
+
|
|
25
|
+
Use the `download-template` MCP tool to create a new project with your backend URL and anon key pre-configured.
|
|
26
|
+
|
|
27
|
+
### Step 2: Install SDK
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @insforge/sdk@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Step 3: Create SDK Client
|
|
34
|
+
|
|
35
|
+
You must create a client instance using `createClient()` with your base URL and anon key:
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
import { createClient } from '@insforge/sdk';
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
baseUrl: 'https://your-app.region.insforge.app', // Your InsForge backend URL
|
|
42
|
+
anonKey: 'your-anon-key-here' // Get this from backend metadata
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**API BASE URL**: Your API base URL is `https://your-app.region.insforge.app`.
|
|
48
|
+
|
|
49
|
+
## Getting Detailed Documentation
|
|
50
|
+
|
|
51
|
+
### 🚨 CRITICAL: Always Fetch Documentation Before Writing Code
|
|
52
|
+
|
|
53
|
+
Before writing or editing any InsForge integration code, you **MUST** call the `fetch-docs` MCP tool to get the latest SDK documentation. This ensures you have accurate, up-to-date implementation patterns.
|
|
54
|
+
|
|
55
|
+
### Use the InsForge `fetch-docs` MCP tool to get specific SDK documentation:
|
|
56
|
+
|
|
57
|
+
Available documentation types:
|
|
58
|
+
|
|
59
|
+
- `"instructions"` - Essential backend setup (START HERE)
|
|
60
|
+
- `"db-sdk"` - Database operations with SDK
|
|
61
|
+
- **Authentication** - Choose based on implementation:
|
|
62
|
+
- `"auth-sdk"` - Direct SDK methods for custom auth flows
|
|
63
|
+
- `"auth-components-react"` - Pre-built auth UI for React+Vite (singlepage App)
|
|
64
|
+
- `"auth-components-react-router"` - Pre-built auth UI for React(Vite+React Router) (Multipage App)
|
|
65
|
+
- `"auth-components-nextjs"` - Pre-built auth UI for Nextjs (SSR App)
|
|
66
|
+
- `"storage-sdk"` - File storage operations
|
|
67
|
+
- `"functions-sdk"` - Serverless functions invocation
|
|
68
|
+
- `"ai-integration-sdk"` - AI chat and image generation
|
|
69
|
+
- `"real-time"` - Real-time pub/sub (database + client events) via WebSockets
|
|
70
|
+
- `"deployment"` - Deploy frontend applications via MCP tool
|
|
71
|
+
|
|
72
|
+
## When to Use SDK vs MCP Tools
|
|
73
|
+
|
|
74
|
+
### Always SDK for Application Logic:
|
|
75
|
+
|
|
76
|
+
- Authentication (register, login, logout, profiles)
|
|
77
|
+
- Database CRUD (select, insert, update, delete)
|
|
78
|
+
- Storage operations (upload, download files)
|
|
79
|
+
- AI operations (chat, image generation)
|
|
80
|
+
- Serverless function invocation
|
|
81
|
+
|
|
82
|
+
### Use MCP Tools for Infrastructure:
|
|
83
|
+
|
|
84
|
+
- Project scaffolding (`download-template`) - Download starter templates with InsForge integration
|
|
85
|
+
- Backend setup and metadata (`get-backend-metadata`)
|
|
86
|
+
- Database schema management (`run-raw-sql`, `get-table-schema`)
|
|
87
|
+
- Storage bucket creation (`create-bucket`, `list-buckets`, `delete-bucket`)
|
|
88
|
+
- Serverless function deployment (`create-function`, `update-function`, `delete-function`)
|
|
89
|
+
- Frontend deployment (`create-deployment`) - Deploy frontend apps to InsForge hosting
|
|
90
|
+
|
|
91
|
+
## Important Notes
|
|
92
|
+
|
|
93
|
+
- For auth: use `auth-sdk` for custom UI, or framework-specific components for pre-built UI
|
|
94
|
+
- SDK returns `{data, error}` structure for all operations
|
|
95
|
+
- Database inserts require array format: `[{...}]`
|
|
96
|
+
- Serverless functions have single endpoint (no subpaths)
|
|
97
|
+
- Storage: Upload files to buckets, store URLs in database
|
|
98
|
+
- AI operations are OpenAI-compatible
|
|
99
|
+
- **EXTRA IMPORTANT**: Use Tailwind CSS 3.4 (do not upgrade to v4). Lock these dependencies in `package.json`
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,9 @@ import {
|
|
|
101
101
|
console.log();
|
|
102
102
|
|
|
103
103
|
selectedClient = await select({
|
|
104
|
-
message: 'Select your
|
|
104
|
+
message: 'Select your coding agent:',
|
|
105
|
+
pageSize: 15,
|
|
106
|
+
loop: false,
|
|
105
107
|
choices: clientNames.map(name => ({
|
|
106
108
|
name: clientDisplayNames[name] || name,
|
|
107
109
|
value: name
|
package/dist/utils.js
CHANGED
|
@@ -28,15 +28,15 @@ var platformPaths = {
|
|
|
28
28
|
var platform = process.platform;
|
|
29
29
|
var { baseDir, vscodePath } = platformPaths[platform];
|
|
30
30
|
var clientPaths = {
|
|
31
|
-
"claude-code": {
|
|
32
|
-
type: "file",
|
|
33
|
-
path: path.join(process.cwd(), ".mcp.json")
|
|
34
|
-
},
|
|
35
31
|
cursor: {
|
|
36
32
|
type: "file",
|
|
37
33
|
path: path.join(homeDir, ".cursor", "mcp.json"),
|
|
38
34
|
localPath: path.join(process.cwd(), ".cursor", "mcp.json")
|
|
39
35
|
},
|
|
36
|
+
"claude-code": {
|
|
37
|
+
type: "file",
|
|
38
|
+
path: path.join(process.cwd(), ".mcp.json")
|
|
39
|
+
},
|
|
40
40
|
windsurf: {
|
|
41
41
|
type: "file",
|
|
42
42
|
path: path.join(homeDir, ".codeium", "windsurf", "mcp_config.json")
|