contextforge-mcp 0.1.0
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 +195 -0
- package/dist/api-client.d.ts +74 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +310 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1483 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +706 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +156 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# ContextForge MCP Server
|
|
2
|
+
|
|
3
|
+
Intelligent contextual memory system for AI-powered development. Store and retrieve knowledge across conversations, perfect for Claude Desktop and Claude Code.
|
|
4
|
+
|
|
5
|
+
## 🚀 Quick Start
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g contextforge-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or use without installing:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx contextforge-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Configuration
|
|
20
|
+
|
|
21
|
+
#### For Claude Desktop
|
|
22
|
+
|
|
23
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"contextforge": {
|
|
29
|
+
"command": "contextforge-mcp",
|
|
30
|
+
"env": {
|
|
31
|
+
"CONTEXTFORGE_API_KEY": "your-api-key-here",
|
|
32
|
+
"CONTEXTFORGE_API_URL": "https://your-instance.supabase.co/functions/v1"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### For Claude Code (CLI)
|
|
40
|
+
|
|
41
|
+
Create `.claude/mcp_settings.json` in your project:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"contextforge": {
|
|
47
|
+
"command": "contextforge-mcp",
|
|
48
|
+
"env": {
|
|
49
|
+
"CONTEXTFORGE_API_KEY": "your-api-key-here",
|
|
50
|
+
"CONTEXTFORGE_API_URL": "https://your-instance.supabase.co/functions/v1"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Get Your API Key
|
|
58
|
+
|
|
59
|
+
1. Go to your ContextForge dashboard
|
|
60
|
+
2. Navigate to Settings → API Keys
|
|
61
|
+
3. Click "Create New Key"
|
|
62
|
+
4. Copy and paste into your configuration
|
|
63
|
+
|
|
64
|
+
## 📚 Available Tools
|
|
65
|
+
|
|
66
|
+
### `memory_ingest`
|
|
67
|
+
Store knowledge in your memory spaces.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Store this API endpoint: POST /api/users creates a new user
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### `memory_query`
|
|
74
|
+
Search across your knowledge base.
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
How do I create a new user?
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `memory_list_spaces`
|
|
81
|
+
View all your memory spaces.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Show me my memory spaces
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `memory_create_space`
|
|
88
|
+
Create a new memory space for organizing knowledge.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Create a space called "API Documentation"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `memory_delete`
|
|
95
|
+
Remove specific memories.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Delete memory with ID abc123
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 🎯 Use Cases
|
|
102
|
+
|
|
103
|
+
- **API Documentation**: Store endpoints, parameters, and examples
|
|
104
|
+
- **Code Patterns**: Remember team conventions and best practices
|
|
105
|
+
- **Project Context**: Keep track of architecture decisions
|
|
106
|
+
- **Personal Notes**: Store shortcuts, commands, and workflows
|
|
107
|
+
|
|
108
|
+
## 🔧 Environment Variables
|
|
109
|
+
|
|
110
|
+
| Variable | Required | Description |
|
|
111
|
+
|----------|----------|-------------|
|
|
112
|
+
| `CONTEXTFORGE_API_KEY` | Yes | Your ContextForge API key |
|
|
113
|
+
| `CONTEXTFORGE_API_URL` | Yes | Your ContextForge instance URL |
|
|
114
|
+
|
|
115
|
+
## 📖 Examples
|
|
116
|
+
|
|
117
|
+
### Storing API Knowledge
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
User: Store this: The authentication endpoint is POST /api/auth/login
|
|
121
|
+
and requires email and password fields.
|
|
122
|
+
|
|
123
|
+
Claude: ✅ Stored in your API Documentation space
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Querying Knowledge
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
User: How do I authenticate users?
|
|
130
|
+
|
|
131
|
+
Claude: Based on your memory, the authentication endpoint is
|
|
132
|
+
POST /api/auth/login and requires email and password fields.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 🛠️ Development
|
|
136
|
+
|
|
137
|
+
### Local Setup
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git clone https://github.com/alfredoizdev/MCP-context-forge.git
|
|
141
|
+
cd contextforge/packages/mcp-client
|
|
142
|
+
npm install
|
|
143
|
+
npm run build
|
|
144
|
+
npm link
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Testing Locally with Claude Code
|
|
148
|
+
|
|
149
|
+
After `npm link`, add the server with:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
claude mcp add -e CONTEXTFORGE_API_KEY=cf_test_secret123 -e CONTEXTFORGE_API_URL=http://127.0.0.1:54321/functions/v1 contextforge -- contextforge-mcp
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Verify it's configured:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
claude mcp list
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
You should see "contextforge" listed. Now in any Claude Code session, use `/mcp` to see available tools.
|
|
162
|
+
|
|
163
|
+
### Testing Locally with Claude Desktop
|
|
164
|
+
|
|
165
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"contextforge": {
|
|
171
|
+
"command": "contextforge-mcp",
|
|
172
|
+
"env": {
|
|
173
|
+
"CONTEXTFORGE_API_KEY": "cf_test_secret123",
|
|
174
|
+
"CONTEXTFORGE_API_URL": "http://127.0.0.1:54321/functions/v1"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Restart Claude Desktop.
|
|
182
|
+
|
|
183
|
+
## 🤝 Contributing
|
|
184
|
+
|
|
185
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
186
|
+
|
|
187
|
+
## 📄 License
|
|
188
|
+
|
|
189
|
+
MIT
|
|
190
|
+
|
|
191
|
+
## 🆘 Support
|
|
192
|
+
|
|
193
|
+
- Documentation: https://contextforge.dev/docs
|
|
194
|
+
- Issues: https://github.com/alfredoizdev/MCP-context-forge/issues
|
|
195
|
+
- Discord: https://discord.gg/contextforge
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Config, Space, QueryInput, QueryResponse, IngestInput, IngestResponse, CreateSpaceInput, RelateInput, Relationship, StatsResponse, DeleteInput, GitConnectInput, GitConnectResponse, GitActivateInput, GitDisconnectInput, GitListResponse, GitSyncInput, GitSyncResponse, GitHistoryInput, GitHistoryResponse, SnapshotCreateInput, SnapshotCreateResponse, SnapshotRestoreInput, SnapshotRestoreResponse, SnapshotDeleteInput, SnapshotListResponse, ExportInput, ExportResponse, ImportInput, ImportResponse, IngestBatchInput, DeleteBatchInput, DeleteBatchResponse } from './types.js';
|
|
2
|
+
export declare class ApiClientError extends Error {
|
|
3
|
+
readonly statusCode: number;
|
|
4
|
+
readonly code?: string | undefined;
|
|
5
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
6
|
+
constructor(message: string, statusCode: number, code?: string | undefined, details?: Record<string, unknown> | undefined);
|
|
7
|
+
}
|
|
8
|
+
export declare class ApiClient {
|
|
9
|
+
private readonly apiKey;
|
|
10
|
+
private readonly baseUrl;
|
|
11
|
+
private readonly defaultSpaceId?;
|
|
12
|
+
constructor(config: Config);
|
|
13
|
+
private request;
|
|
14
|
+
private getSpaceId;
|
|
15
|
+
listSpaces(): Promise<Space[]>;
|
|
16
|
+
getSpace(spaceId: string): Promise<Space>;
|
|
17
|
+
createSpace(input: CreateSpaceInput): Promise<Space>;
|
|
18
|
+
deleteSpace(spaceId: string): Promise<void>;
|
|
19
|
+
query(input: QueryInput): Promise<QueryResponse>;
|
|
20
|
+
ingest(input: IngestInput): Promise<IngestResponse>;
|
|
21
|
+
ingestBatch(spaceId: string | undefined, items: Array<Omit<IngestInput, 'space_id'>>): Promise<IngestResponse>;
|
|
22
|
+
relate(input: RelateInput): Promise<Relationship>;
|
|
23
|
+
deleteItem(input: DeleteInput): Promise<{
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
}>;
|
|
27
|
+
getStats(spaceId?: string): Promise<StatsResponse>;
|
|
28
|
+
listItems(spaceId?: string, limit?: number, offset?: number): Promise<{
|
|
29
|
+
items: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
content_preview: string;
|
|
33
|
+
source_type: string;
|
|
34
|
+
tags: string[];
|
|
35
|
+
category?: string;
|
|
36
|
+
space: string;
|
|
37
|
+
created_at: string;
|
|
38
|
+
}>;
|
|
39
|
+
total: number;
|
|
40
|
+
limit: number;
|
|
41
|
+
offset: number;
|
|
42
|
+
}>;
|
|
43
|
+
healthCheck(): Promise<boolean>;
|
|
44
|
+
gitConnect(input: GitConnectInput): Promise<GitConnectResponse>;
|
|
45
|
+
gitList(spaceId?: string): Promise<GitListResponse>;
|
|
46
|
+
gitActivate(input: GitActivateInput): Promise<{
|
|
47
|
+
success: boolean;
|
|
48
|
+
repository: {
|
|
49
|
+
id: string;
|
|
50
|
+
full_name: string;
|
|
51
|
+
status: string;
|
|
52
|
+
webhook_active: boolean;
|
|
53
|
+
};
|
|
54
|
+
message: string;
|
|
55
|
+
}>;
|
|
56
|
+
gitDisconnect(input: GitDisconnectInput): Promise<{
|
|
57
|
+
success: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
}>;
|
|
60
|
+
gitSync(input: GitSyncInput): Promise<GitSyncResponse>;
|
|
61
|
+
gitHistory(input: GitHistoryInput): Promise<GitHistoryResponse>;
|
|
62
|
+
snapshotCreate(input: SnapshotCreateInput): Promise<SnapshotCreateResponse>;
|
|
63
|
+
snapshotList(spaceId?: string): Promise<SnapshotListResponse>;
|
|
64
|
+
snapshotRestore(input: SnapshotRestoreInput): Promise<SnapshotRestoreResponse>;
|
|
65
|
+
snapshotDelete(input: SnapshotDeleteInput): Promise<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
message: string;
|
|
68
|
+
}>;
|
|
69
|
+
exportSpace(input: ExportInput): Promise<ExportResponse>;
|
|
70
|
+
importToSpace(input: ImportInput): Promise<ImportResponse>;
|
|
71
|
+
ingestBatchItems(input: IngestBatchInput): Promise<IngestResponse>;
|
|
72
|
+
deleteBatch(input: DeleteBatchInput): Promise<DeleteBatchResponse>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.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CAAC,mBAAmB,CAAC;CAOzE"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
export class ApiClientError extends Error {
|
|
2
|
+
statusCode;
|
|
3
|
+
code;
|
|
4
|
+
details;
|
|
5
|
+
constructor(message, statusCode, code, details) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.statusCode = statusCode;
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.details = details;
|
|
10
|
+
this.name = 'ApiClientError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class ApiClient {
|
|
14
|
+
apiKey;
|
|
15
|
+
baseUrl;
|
|
16
|
+
defaultSpaceId;
|
|
17
|
+
constructor(config) {
|
|
18
|
+
this.apiKey = config.apiKey;
|
|
19
|
+
this.baseUrl = config.apiUrl.replace(/\/$/, '');
|
|
20
|
+
this.defaultSpaceId = config.defaultSpace;
|
|
21
|
+
}
|
|
22
|
+
async request(method, path, body) {
|
|
23
|
+
const url = `${this.baseUrl}${path}`;
|
|
24
|
+
const headers = {
|
|
25
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
};
|
|
28
|
+
const options = {
|
|
29
|
+
method,
|
|
30
|
+
headers,
|
|
31
|
+
};
|
|
32
|
+
if (body && (method === 'POST' || method === 'PATCH')) {
|
|
33
|
+
options.body = JSON.stringify(body);
|
|
34
|
+
}
|
|
35
|
+
let response;
|
|
36
|
+
try {
|
|
37
|
+
response = await fetch(url, options);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new ApiClientError(`Network error: ${error instanceof Error ? error.message : 'Unknown error'}`, 0, 'NETWORK_ERROR');
|
|
41
|
+
}
|
|
42
|
+
const contentType = response.headers.get('content-type');
|
|
43
|
+
const isJson = contentType?.includes('application/json');
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
let errorData = { error: 'Unknown error' };
|
|
46
|
+
if (isJson) {
|
|
47
|
+
try {
|
|
48
|
+
errorData = await response.json();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Ignore JSON parse errors
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
throw new ApiClientError(errorData.error, response.status, errorData.code, errorData.details);
|
|
55
|
+
}
|
|
56
|
+
if (!isJson) {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
return response.json();
|
|
60
|
+
}
|
|
61
|
+
getSpaceId(providedSpaceId) {
|
|
62
|
+
const spaceId = providedSpaceId ?? this.defaultSpaceId;
|
|
63
|
+
if (!spaceId) {
|
|
64
|
+
throw new ApiClientError('No space_id provided and no default space configured', 400, 'MISSING_SPACE_ID');
|
|
65
|
+
}
|
|
66
|
+
return spaceId;
|
|
67
|
+
}
|
|
68
|
+
// ============ Spaces ============
|
|
69
|
+
async listSpaces() {
|
|
70
|
+
return this.request('GET', '/functions/v1/spaces');
|
|
71
|
+
}
|
|
72
|
+
async getSpace(spaceId) {
|
|
73
|
+
const spaces = await this.request('GET', '/functions/v1/spaces');
|
|
74
|
+
const space = spaces.find(s => s.id === spaceId);
|
|
75
|
+
if (!space) {
|
|
76
|
+
throw new ApiClientError('Space not found', 404, 'NOT_FOUND');
|
|
77
|
+
}
|
|
78
|
+
return space;
|
|
79
|
+
}
|
|
80
|
+
async createSpace(input) {
|
|
81
|
+
return this.request('POST', '/functions/v1/spaces', {
|
|
82
|
+
name: input.name,
|
|
83
|
+
description: input.description,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async deleteSpace(spaceId) {
|
|
87
|
+
// TODO: Implement delete space edge function
|
|
88
|
+
throw new ApiClientError('Delete space not implemented yet', 501, 'NOT_IMPLEMENTED');
|
|
89
|
+
}
|
|
90
|
+
// ============ Query ============
|
|
91
|
+
async query(input) {
|
|
92
|
+
const spaceId = this.getSpaceId(input.space_id);
|
|
93
|
+
return this.request('POST', '/functions/v1/query', {
|
|
94
|
+
space_id: spaceId,
|
|
95
|
+
query: input.query,
|
|
96
|
+
limit: input.limit,
|
|
97
|
+
min_score: input.min_score,
|
|
98
|
+
filters: input.filters,
|
|
99
|
+
include_relationships: input.include_relationships,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// ============ Ingest ============
|
|
103
|
+
async ingest(input) {
|
|
104
|
+
const spaceId = this.getSpaceId(input.space_id);
|
|
105
|
+
return this.request('POST', '/functions/v1/ingest', {
|
|
106
|
+
space_id: spaceId,
|
|
107
|
+
items: [{
|
|
108
|
+
content: input.content,
|
|
109
|
+
title: input.title,
|
|
110
|
+
source_type: input.source_type,
|
|
111
|
+
source_uri: input.source_uri,
|
|
112
|
+
tags: input.tags,
|
|
113
|
+
category: input.category,
|
|
114
|
+
}],
|
|
115
|
+
options: {
|
|
116
|
+
deduplicate: true,
|
|
117
|
+
chunk_large_content: true,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async ingestBatch(spaceId, items) {
|
|
122
|
+
const resolvedSpaceId = this.getSpaceId(spaceId);
|
|
123
|
+
return this.request('POST', '/functions/v1/ingest', {
|
|
124
|
+
space_id: resolvedSpaceId,
|
|
125
|
+
items: items.map(item => ({
|
|
126
|
+
content: item.content,
|
|
127
|
+
title: item.title,
|
|
128
|
+
source_type: item.source_type ?? 'manual',
|
|
129
|
+
source_uri: item.source_uri,
|
|
130
|
+
tags: item.tags ?? [],
|
|
131
|
+
category: item.category,
|
|
132
|
+
})),
|
|
133
|
+
options: {
|
|
134
|
+
deduplicate: true,
|
|
135
|
+
chunk_large_content: true,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// ============ Relationships ============
|
|
140
|
+
async relate(input) {
|
|
141
|
+
return this.request('POST', '/rest/v1/relationships', {
|
|
142
|
+
source_item_id: input.source_id,
|
|
143
|
+
target_item_id: input.target_id,
|
|
144
|
+
relationship_type: input.relationship_type,
|
|
145
|
+
weight: input.weight,
|
|
146
|
+
is_auto_detected: false,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// ============ Delete ============
|
|
150
|
+
async deleteItem(input) {
|
|
151
|
+
const result = await this.request('POST', '/functions/v1/delete-item', {
|
|
152
|
+
id: input.id,
|
|
153
|
+
title: input.title,
|
|
154
|
+
});
|
|
155
|
+
return result.deleted;
|
|
156
|
+
}
|
|
157
|
+
// ============ Stats ============
|
|
158
|
+
async getStats(spaceId) {
|
|
159
|
+
const resolvedSpaceId = spaceId ?? this.defaultSpaceId;
|
|
160
|
+
const path = resolvedSpaceId
|
|
161
|
+
? `/functions/v1/stats?space_id=${resolvedSpaceId}`
|
|
162
|
+
: '/functions/v1/stats';
|
|
163
|
+
return this.request('GET', path);
|
|
164
|
+
}
|
|
165
|
+
// ============ List Items ============
|
|
166
|
+
async listItems(spaceId, limit, offset) {
|
|
167
|
+
const params = new URLSearchParams();
|
|
168
|
+
if (spaceId)
|
|
169
|
+
params.set('space_id', spaceId);
|
|
170
|
+
if (limit)
|
|
171
|
+
params.set('limit', limit.toString());
|
|
172
|
+
if (offset)
|
|
173
|
+
params.set('offset', offset.toString());
|
|
174
|
+
const queryString = params.toString();
|
|
175
|
+
const path = `/functions/v1/items${queryString ? `?${queryString}` : ''}`;
|
|
176
|
+
return this.request('GET', path);
|
|
177
|
+
}
|
|
178
|
+
// ============ Health Check ============
|
|
179
|
+
async healthCheck() {
|
|
180
|
+
try {
|
|
181
|
+
await this.request('GET', '/functions/v1/health');
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// ============ Git Integration ============
|
|
189
|
+
async gitConnect(input) {
|
|
190
|
+
return this.request('POST', '/functions/v1/git-repos', {
|
|
191
|
+
repo_url: input.repo_url,
|
|
192
|
+
space_id: input.space_id,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
async gitList(spaceId) {
|
|
196
|
+
const params = new URLSearchParams();
|
|
197
|
+
if (spaceId)
|
|
198
|
+
params.set('space_id', spaceId);
|
|
199
|
+
const queryString = params.toString();
|
|
200
|
+
const path = `/functions/v1/git-repos${queryString ? `?${queryString}` : ''}`;
|
|
201
|
+
return this.request('GET', path);
|
|
202
|
+
}
|
|
203
|
+
async gitActivate(input) {
|
|
204
|
+
return this.request('POST', '/functions/v1/git-activate', {
|
|
205
|
+
repository_id: input.repository_id,
|
|
206
|
+
repo: input.repo,
|
|
207
|
+
active: input.active,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
async gitDisconnect(input) {
|
|
211
|
+
const params = new URLSearchParams();
|
|
212
|
+
if (input.repository_id)
|
|
213
|
+
params.set('id', input.repository_id);
|
|
214
|
+
if (input.repo)
|
|
215
|
+
params.set('repo', input.repo);
|
|
216
|
+
return this.request('DELETE', `/functions/v1/git-repos?${params.toString()}`);
|
|
217
|
+
}
|
|
218
|
+
async gitSync(input) {
|
|
219
|
+
return this.request('POST', '/functions/v1/git-sync', {
|
|
220
|
+
repository_id: input.repository_id,
|
|
221
|
+
repo: input.repo,
|
|
222
|
+
sync_type: input.sync_type,
|
|
223
|
+
limit: input.limit,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
async gitHistory(input) {
|
|
227
|
+
const params = new URLSearchParams();
|
|
228
|
+
if (input.type)
|
|
229
|
+
params.set('type', input.type);
|
|
230
|
+
if (input.repository_id)
|
|
231
|
+
params.set('repository_id', input.repository_id);
|
|
232
|
+
if (input.repo)
|
|
233
|
+
params.set('repo', input.repo);
|
|
234
|
+
if (input.space_id)
|
|
235
|
+
params.set('space_id', input.space_id);
|
|
236
|
+
if (input.limit)
|
|
237
|
+
params.set('limit', input.limit.toString());
|
|
238
|
+
if (input.offset)
|
|
239
|
+
params.set('offset', input.offset.toString());
|
|
240
|
+
return this.request('GET', `/functions/v1/git-history?${params.toString()}`);
|
|
241
|
+
}
|
|
242
|
+
// ============ Snapshots ============
|
|
243
|
+
async snapshotCreate(input) {
|
|
244
|
+
return this.request('POST', '/functions/v1/snapshots', {
|
|
245
|
+
space_id: input.space_id,
|
|
246
|
+
name: input.name,
|
|
247
|
+
description: input.description,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
async snapshotList(spaceId) {
|
|
251
|
+
const params = new URLSearchParams();
|
|
252
|
+
if (spaceId)
|
|
253
|
+
params.set('space_id', spaceId);
|
|
254
|
+
const queryString = params.toString();
|
|
255
|
+
const path = `/functions/v1/snapshots${queryString ? `?${queryString}` : ''}`;
|
|
256
|
+
return this.request('GET', path);
|
|
257
|
+
}
|
|
258
|
+
async snapshotRestore(input) {
|
|
259
|
+
return this.request('POST', '/functions/v1/snapshots', {
|
|
260
|
+
action: 'restore',
|
|
261
|
+
snapshot_id: input.snapshot_id,
|
|
262
|
+
mode: input.mode,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
async snapshotDelete(input) {
|
|
266
|
+
return this.request('DELETE', `/functions/v1/snapshots?id=${input.snapshot_id}`);
|
|
267
|
+
}
|
|
268
|
+
// ============ Import/Export ============
|
|
269
|
+
async exportSpace(input) {
|
|
270
|
+
const params = new URLSearchParams();
|
|
271
|
+
params.set('space_id', input.space_id);
|
|
272
|
+
params.set('format', input.format || 'json');
|
|
273
|
+
return this.request('GET', `/functions/v1/export?${params.toString()}`);
|
|
274
|
+
}
|
|
275
|
+
async importToSpace(input) {
|
|
276
|
+
return this.request('POST', '/functions/v1/import', {
|
|
277
|
+
space_id: input.space_id,
|
|
278
|
+
format: input.format,
|
|
279
|
+
data: input.data,
|
|
280
|
+
items: input.items,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
// ============ Batch Operations ============
|
|
284
|
+
async ingestBatchItems(input) {
|
|
285
|
+
const spaceId = this.getSpaceId(input.space_id);
|
|
286
|
+
return this.request('POST', '/functions/v1/ingest', {
|
|
287
|
+
space_id: spaceId,
|
|
288
|
+
items: input.items.map(item => ({
|
|
289
|
+
content: item.content,
|
|
290
|
+
title: item.title,
|
|
291
|
+
source_type: item.source_type ?? 'manual',
|
|
292
|
+
source_uri: item.source_uri,
|
|
293
|
+
tags: item.tags ?? [],
|
|
294
|
+
category: item.category,
|
|
295
|
+
})),
|
|
296
|
+
options: {
|
|
297
|
+
deduplicate: true,
|
|
298
|
+
chunk_large_content: true,
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
async deleteBatch(input) {
|
|
303
|
+
return this.request('POST', '/functions/v1/delete-batch', {
|
|
304
|
+
space_id: input.space_id,
|
|
305
|
+
filter: input.filter,
|
|
306
|
+
dry_run: input.dry_run ?? true,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAqCA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGrB;IACA;IACA;IAJlB,YACE,OAAe,EACC,UAAkB,EAClB,IAAa,EACb,OAAiC;QAEjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAA0B;QAGjD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,SAAS;IACH,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,cAAc,CAAU;IAEzC,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC;IAC5C,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,MAA2C,EAC3C,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GA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