@taghost/mcp 0.0.0-stage → 1.0.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.
@@ -0,0 +1,344 @@
1
+ export { S as ServerOptions, T as TagHostClient, a as TagHostClientOptions, c as createTagHostMcpServer, s as startServer } from './server-BzjamriK.cjs';
2
+ export { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
3
+ import '@modelcontextprotocol/sdk/server/mcp.js';
4
+
5
+ declare const TAGHOST_OPENAPI_SPEC: {
6
+ openapi: string;
7
+ info: {
8
+ title: string;
9
+ description: string;
10
+ version: string;
11
+ contact: {
12
+ name: string;
13
+ url: string;
14
+ email: string;
15
+ };
16
+ };
17
+ servers: {
18
+ url: string;
19
+ description: string;
20
+ }[];
21
+ paths: {
22
+ "/mcp": {
23
+ post: {
24
+ operationId: string;
25
+ summary: string;
26
+ description: string;
27
+ requestBody: {
28
+ required: boolean;
29
+ content: {
30
+ "application/json": {
31
+ schema: {
32
+ type: string;
33
+ required: string[];
34
+ properties: {
35
+ jsonrpc: {
36
+ type: string;
37
+ example: string;
38
+ };
39
+ id: {
40
+ type: string[];
41
+ example: number;
42
+ };
43
+ method: {
44
+ type: string;
45
+ example: string;
46
+ };
47
+ params: {
48
+ type: string;
49
+ };
50
+ };
51
+ };
52
+ };
53
+ };
54
+ };
55
+ responses: {
56
+ 200: {
57
+ description: string;
58
+ content: {
59
+ "application/json": {
60
+ schema: {
61
+ type: string;
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
69
+ "/projects": {
70
+ get: {
71
+ operationId: string;
72
+ summary: string;
73
+ description: string;
74
+ responses: {
75
+ 200: {
76
+ description: string;
77
+ };
78
+ };
79
+ };
80
+ post: {
81
+ operationId: string;
82
+ summary: string;
83
+ description: string;
84
+ requestBody: {
85
+ required: boolean;
86
+ content: {
87
+ "application/json": {
88
+ schema: {
89
+ type: string;
90
+ required: string[];
91
+ properties: {
92
+ name: {
93
+ type: string;
94
+ description: string;
95
+ };
96
+ slug: {
97
+ type: string;
98
+ description: string;
99
+ };
100
+ framework: {
101
+ type: string;
102
+ description: string;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ };
108
+ };
109
+ responses: {
110
+ 201: {
111
+ description: string;
112
+ };
113
+ };
114
+ };
115
+ };
116
+ "/projects/{id}": {
117
+ get: {
118
+ operationId: string;
119
+ summary: string;
120
+ parameters: {
121
+ name: string;
122
+ in: string;
123
+ required: boolean;
124
+ schema: {
125
+ type: string;
126
+ };
127
+ description: string;
128
+ }[];
129
+ responses: {
130
+ 200: {
131
+ description: string;
132
+ };
133
+ };
134
+ };
135
+ };
136
+ "/projects/{id}/collections": {
137
+ get: {
138
+ operationId: string;
139
+ summary: string;
140
+ parameters: {
141
+ name: string;
142
+ in: string;
143
+ required: boolean;
144
+ schema: {
145
+ type: string;
146
+ };
147
+ }[];
148
+ responses: {
149
+ 200: {
150
+ description: string;
151
+ };
152
+ };
153
+ };
154
+ post: {
155
+ operationId: string;
156
+ summary: string;
157
+ parameters: {
158
+ name: string;
159
+ in: string;
160
+ required: boolean;
161
+ schema: {
162
+ type: string;
163
+ };
164
+ }[];
165
+ requestBody: {
166
+ required: boolean;
167
+ content: {
168
+ "application/json": {
169
+ schema: {
170
+ type: string;
171
+ required: string[];
172
+ properties: {
173
+ name: {
174
+ type: string;
175
+ };
176
+ description: {
177
+ type: string;
178
+ };
179
+ fields: {
180
+ type: string;
181
+ items: {
182
+ type: string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ };
189
+ };
190
+ responses: {
191
+ 201: {
192
+ description: string;
193
+ };
194
+ };
195
+ };
196
+ };
197
+ "/projects/{id}/orders": {
198
+ get: {
199
+ operationId: string;
200
+ summary: string;
201
+ parameters: {
202
+ name: string;
203
+ in: string;
204
+ required: boolean;
205
+ schema: {
206
+ type: string;
207
+ };
208
+ }[];
209
+ responses: {
210
+ 200: {
211
+ description: string;
212
+ };
213
+ };
214
+ };
215
+ };
216
+ "/projects/{id}/sql/query": {
217
+ post: {
218
+ operationId: string;
219
+ summary: string;
220
+ parameters: {
221
+ name: string;
222
+ in: string;
223
+ required: boolean;
224
+ schema: {
225
+ type: string;
226
+ };
227
+ }[];
228
+ requestBody: {
229
+ required: boolean;
230
+ content: {
231
+ "application/json": {
232
+ schema: {
233
+ type: string;
234
+ required: string[];
235
+ properties: {
236
+ query: {
237
+ type: string;
238
+ };
239
+ params: {
240
+ type: string;
241
+ items: {
242
+ type: string;
243
+ };
244
+ };
245
+ };
246
+ };
247
+ };
248
+ };
249
+ };
250
+ responses: {
251
+ 200: {
252
+ description: string;
253
+ };
254
+ 403: {
255
+ description: string;
256
+ };
257
+ };
258
+ };
259
+ };
260
+ "/domains/check": {
261
+ get: {
262
+ operationId: string;
263
+ summary: string;
264
+ parameters: {
265
+ name: string;
266
+ in: string;
267
+ required: boolean;
268
+ schema: {
269
+ type: string;
270
+ };
271
+ }[];
272
+ responses: {
273
+ 200: {
274
+ description: string;
275
+ };
276
+ };
277
+ };
278
+ };
279
+ };
280
+ components: {
281
+ securitySchemes: {
282
+ bearerAuth: {
283
+ type: string;
284
+ scheme: string;
285
+ bearerFormat: string;
286
+ };
287
+ };
288
+ };
289
+ security: {
290
+ bearerAuth: never[];
291
+ }[];
292
+ };
293
+
294
+ declare function getApiUrl(): string;
295
+ declare function sanitizeAuthToken(value?: string | null): string | null;
296
+ declare function resolveAuthToken(): string | null;
297
+
298
+ declare function findProjectBinding(startDir?: string): {
299
+ projectId: string;
300
+ slug?: string;
301
+ } | null;
302
+
303
+ /**
304
+ * Strict client-side SQL guard for TagHost Serverless D1 SQL Explorer.
305
+ *
306
+ * Enforces read-only execution: permits only SELECT, PRAGMA, EXPLAIN, and read-only WITH CTEs.
307
+ * Blocks all data mutations (INSERT, UPDATE, DELETE, REPLACE, TRUNCATE) and schema mutations (DROP, ALTER, CREATE).
308
+ * Also blocks access to platform-sensitive internal tables.
309
+ */
310
+ interface SqlValidationResult {
311
+ valid: boolean;
312
+ error?: string;
313
+ }
314
+ declare function validateReadOnlySql(sqlQuery: string): SqlValidationResult;
315
+
316
+ interface BundledResult {
317
+ zipBuffer: Uint8Array;
318
+ fileCount: number;
319
+ totalBytes: number;
320
+ fileList: string[];
321
+ }
322
+ declare function bundleDirectory(dirPath: string): BundledResult;
323
+ declare function bundleVirtualFiles(files: Record<string, string | Uint8Array>): BundledResult;
324
+
325
+ type McpScopeId = 'projects:read' | 'deployments:write' | 'content:write' | 'domains:write' | 'mail:read' | 'mail:send' | 'commerce:write' | 'forms:read' | 'sql:read' | 'workspace:collaborate';
326
+ interface McpScopeDefinition {
327
+ id: McpScopeId;
328
+ label: string;
329
+ description: string;
330
+ icon: string;
331
+ access: 'read' | 'write';
332
+ defaultSelected?: boolean;
333
+ }
334
+ /**
335
+ * Canonical OAuth 2.1 permission catalog for mcp.taghost.io.
336
+ * Shared across @taghost/mcp (tool filtering), control-plane (OAuth 2.1),
337
+ * and Console (permission picker UI).
338
+ */
339
+ declare const MCP_SCOPES: readonly McpScopeDefinition[];
340
+ declare const ALL_MCP_SCOPES: readonly McpScopeId[];
341
+ declare function normalizeMcpScopes(input?: string | string[] | null): McpScopeId[];
342
+ declare function hasMcpScope(granted: readonly string[] | null | undefined, required: McpScopeId): boolean;
343
+
344
+ export { ALL_MCP_SCOPES, type BundledResult, MCP_SCOPES, type McpScopeDefinition, type McpScopeId, type SqlValidationResult, TAGHOST_OPENAPI_SPEC, bundleDirectory, bundleVirtualFiles, findProjectBinding, getApiUrl, hasMcpScope, normalizeMcpScopes, resolveAuthToken, sanitizeAuthToken, validateReadOnlySql };
@@ -0,0 +1,344 @@
1
+ export { S as ServerOptions, T as TagHostClient, a as TagHostClientOptions, c as createTagHostMcpServer, s as startServer } from './server-BzjamriK.js';
2
+ export { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
3
+ import '@modelcontextprotocol/sdk/server/mcp.js';
4
+
5
+ declare const TAGHOST_OPENAPI_SPEC: {
6
+ openapi: string;
7
+ info: {
8
+ title: string;
9
+ description: string;
10
+ version: string;
11
+ contact: {
12
+ name: string;
13
+ url: string;
14
+ email: string;
15
+ };
16
+ };
17
+ servers: {
18
+ url: string;
19
+ description: string;
20
+ }[];
21
+ paths: {
22
+ "/mcp": {
23
+ post: {
24
+ operationId: string;
25
+ summary: string;
26
+ description: string;
27
+ requestBody: {
28
+ required: boolean;
29
+ content: {
30
+ "application/json": {
31
+ schema: {
32
+ type: string;
33
+ required: string[];
34
+ properties: {
35
+ jsonrpc: {
36
+ type: string;
37
+ example: string;
38
+ };
39
+ id: {
40
+ type: string[];
41
+ example: number;
42
+ };
43
+ method: {
44
+ type: string;
45
+ example: string;
46
+ };
47
+ params: {
48
+ type: string;
49
+ };
50
+ };
51
+ };
52
+ };
53
+ };
54
+ };
55
+ responses: {
56
+ 200: {
57
+ description: string;
58
+ content: {
59
+ "application/json": {
60
+ schema: {
61
+ type: string;
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
69
+ "/projects": {
70
+ get: {
71
+ operationId: string;
72
+ summary: string;
73
+ description: string;
74
+ responses: {
75
+ 200: {
76
+ description: string;
77
+ };
78
+ };
79
+ };
80
+ post: {
81
+ operationId: string;
82
+ summary: string;
83
+ description: string;
84
+ requestBody: {
85
+ required: boolean;
86
+ content: {
87
+ "application/json": {
88
+ schema: {
89
+ type: string;
90
+ required: string[];
91
+ properties: {
92
+ name: {
93
+ type: string;
94
+ description: string;
95
+ };
96
+ slug: {
97
+ type: string;
98
+ description: string;
99
+ };
100
+ framework: {
101
+ type: string;
102
+ description: string;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ };
108
+ };
109
+ responses: {
110
+ 201: {
111
+ description: string;
112
+ };
113
+ };
114
+ };
115
+ };
116
+ "/projects/{id}": {
117
+ get: {
118
+ operationId: string;
119
+ summary: string;
120
+ parameters: {
121
+ name: string;
122
+ in: string;
123
+ required: boolean;
124
+ schema: {
125
+ type: string;
126
+ };
127
+ description: string;
128
+ }[];
129
+ responses: {
130
+ 200: {
131
+ description: string;
132
+ };
133
+ };
134
+ };
135
+ };
136
+ "/projects/{id}/collections": {
137
+ get: {
138
+ operationId: string;
139
+ summary: string;
140
+ parameters: {
141
+ name: string;
142
+ in: string;
143
+ required: boolean;
144
+ schema: {
145
+ type: string;
146
+ };
147
+ }[];
148
+ responses: {
149
+ 200: {
150
+ description: string;
151
+ };
152
+ };
153
+ };
154
+ post: {
155
+ operationId: string;
156
+ summary: string;
157
+ parameters: {
158
+ name: string;
159
+ in: string;
160
+ required: boolean;
161
+ schema: {
162
+ type: string;
163
+ };
164
+ }[];
165
+ requestBody: {
166
+ required: boolean;
167
+ content: {
168
+ "application/json": {
169
+ schema: {
170
+ type: string;
171
+ required: string[];
172
+ properties: {
173
+ name: {
174
+ type: string;
175
+ };
176
+ description: {
177
+ type: string;
178
+ };
179
+ fields: {
180
+ type: string;
181
+ items: {
182
+ type: string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ };
189
+ };
190
+ responses: {
191
+ 201: {
192
+ description: string;
193
+ };
194
+ };
195
+ };
196
+ };
197
+ "/projects/{id}/orders": {
198
+ get: {
199
+ operationId: string;
200
+ summary: string;
201
+ parameters: {
202
+ name: string;
203
+ in: string;
204
+ required: boolean;
205
+ schema: {
206
+ type: string;
207
+ };
208
+ }[];
209
+ responses: {
210
+ 200: {
211
+ description: string;
212
+ };
213
+ };
214
+ };
215
+ };
216
+ "/projects/{id}/sql/query": {
217
+ post: {
218
+ operationId: string;
219
+ summary: string;
220
+ parameters: {
221
+ name: string;
222
+ in: string;
223
+ required: boolean;
224
+ schema: {
225
+ type: string;
226
+ };
227
+ }[];
228
+ requestBody: {
229
+ required: boolean;
230
+ content: {
231
+ "application/json": {
232
+ schema: {
233
+ type: string;
234
+ required: string[];
235
+ properties: {
236
+ query: {
237
+ type: string;
238
+ };
239
+ params: {
240
+ type: string;
241
+ items: {
242
+ type: string;
243
+ };
244
+ };
245
+ };
246
+ };
247
+ };
248
+ };
249
+ };
250
+ responses: {
251
+ 200: {
252
+ description: string;
253
+ };
254
+ 403: {
255
+ description: string;
256
+ };
257
+ };
258
+ };
259
+ };
260
+ "/domains/check": {
261
+ get: {
262
+ operationId: string;
263
+ summary: string;
264
+ parameters: {
265
+ name: string;
266
+ in: string;
267
+ required: boolean;
268
+ schema: {
269
+ type: string;
270
+ };
271
+ }[];
272
+ responses: {
273
+ 200: {
274
+ description: string;
275
+ };
276
+ };
277
+ };
278
+ };
279
+ };
280
+ components: {
281
+ securitySchemes: {
282
+ bearerAuth: {
283
+ type: string;
284
+ scheme: string;
285
+ bearerFormat: string;
286
+ };
287
+ };
288
+ };
289
+ security: {
290
+ bearerAuth: never[];
291
+ }[];
292
+ };
293
+
294
+ declare function getApiUrl(): string;
295
+ declare function sanitizeAuthToken(value?: string | null): string | null;
296
+ declare function resolveAuthToken(): string | null;
297
+
298
+ declare function findProjectBinding(startDir?: string): {
299
+ projectId: string;
300
+ slug?: string;
301
+ } | null;
302
+
303
+ /**
304
+ * Strict client-side SQL guard for TagHost Serverless D1 SQL Explorer.
305
+ *
306
+ * Enforces read-only execution: permits only SELECT, PRAGMA, EXPLAIN, and read-only WITH CTEs.
307
+ * Blocks all data mutations (INSERT, UPDATE, DELETE, REPLACE, TRUNCATE) and schema mutations (DROP, ALTER, CREATE).
308
+ * Also blocks access to platform-sensitive internal tables.
309
+ */
310
+ interface SqlValidationResult {
311
+ valid: boolean;
312
+ error?: string;
313
+ }
314
+ declare function validateReadOnlySql(sqlQuery: string): SqlValidationResult;
315
+
316
+ interface BundledResult {
317
+ zipBuffer: Uint8Array;
318
+ fileCount: number;
319
+ totalBytes: number;
320
+ fileList: string[];
321
+ }
322
+ declare function bundleDirectory(dirPath: string): BundledResult;
323
+ declare function bundleVirtualFiles(files: Record<string, string | Uint8Array>): BundledResult;
324
+
325
+ type McpScopeId = 'projects:read' | 'deployments:write' | 'content:write' | 'domains:write' | 'mail:read' | 'mail:send' | 'commerce:write' | 'forms:read' | 'sql:read' | 'workspace:collaborate';
326
+ interface McpScopeDefinition {
327
+ id: McpScopeId;
328
+ label: string;
329
+ description: string;
330
+ icon: string;
331
+ access: 'read' | 'write';
332
+ defaultSelected?: boolean;
333
+ }
334
+ /**
335
+ * Canonical OAuth 2.1 permission catalog for mcp.taghost.io.
336
+ * Shared across @taghost/mcp (tool filtering), control-plane (OAuth 2.1),
337
+ * and Console (permission picker UI).
338
+ */
339
+ declare const MCP_SCOPES: readonly McpScopeDefinition[];
340
+ declare const ALL_MCP_SCOPES: readonly McpScopeId[];
341
+ declare function normalizeMcpScopes(input?: string | string[] | null): McpScopeId[];
342
+ declare function hasMcpScope(granted: readonly string[] | null | undefined, required: McpScopeId): boolean;
343
+
344
+ export { ALL_MCP_SCOPES, type BundledResult, MCP_SCOPES, type McpScopeDefinition, type McpScopeId, type SqlValidationResult, TAGHOST_OPENAPI_SPEC, bundleDirectory, bundleVirtualFiles, findProjectBinding, getApiUrl, hasMcpScope, normalizeMcpScopes, resolveAuthToken, sanitizeAuthToken, validateReadOnlySql };