@primeuicom/mcp 0.1.9 → 0.1.11
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 +12 -10
- package/dist/service.js +1754 -17
- package/dist/service.js.map +1 -1
- package/package.json +3 -2
- package/dist/instructions.d.ts +0 -173
- package/dist/instructions.js +0 -294
- package/dist/instructions.js.map +0 -1
- package/dist/lib/fs.d.ts +0 -4
- package/dist/lib/fs.js +0 -25
- package/dist/lib/fs.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.js +0 -70
- package/dist/server.js.map +0 -1
- package/dist/service.d.ts +0 -2
- package/dist/services/project-sync-service.d.ts +0 -22
- package/dist/services/project-sync-service.js +0 -60
- package/dist/services/project-sync-service.js.map +0 -1
- package/dist/sources/api-provider.d.ts +0 -25
- package/dist/sources/api-provider.js +0 -247
- package/dist/sources/api-provider.js.map +0 -1
- package/dist/sources/project-data-provider.d.ts +0 -7
- package/dist/sources/project-data-provider.js +0 -2
- package/dist/sources/project-data-provider.js.map +0 -1
- package/dist/sources/project-sync-source.d.ts +0 -8
- package/dist/sources/project-sync-source.js +0 -2
- package/dist/sources/project-sync-source.js.map +0 -1
- package/dist/types.d.ts +0 -33
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { createWriteStream } from "node:fs";
|
|
2
|
-
import { unlink } from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { Readable, Transform } from "node:stream";
|
|
5
|
-
import { pipeline } from "node:stream/promises";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { ensureDir } from "../lib/fs.js";
|
|
8
|
-
const DEFAULT_API_BASE_URL = "https://app.primeui.com/";
|
|
9
|
-
const ZIP_CONTENT_TYPES = [
|
|
10
|
-
"application/zip",
|
|
11
|
-
"application/octet-stream",
|
|
12
|
-
"application/x-zip-compressed",
|
|
13
|
-
];
|
|
14
|
-
const exportStatusSchema = z.enum(["in_progress", "completed", "failed"]);
|
|
15
|
-
const projectPageSchema = z.object({
|
|
16
|
-
id: z.string(),
|
|
17
|
-
title: z.string(),
|
|
18
|
-
slug: z.string(),
|
|
19
|
-
pageType: z.string(),
|
|
20
|
-
isReadyToExport: z.boolean(),
|
|
21
|
-
pagePath: z.string(),
|
|
22
|
-
componentsPath: z.string(),
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Consumer-side runtime contract for GET /api/v1/project.
|
|
26
|
-
* Producer source of truth: apps/studio/src/app/api/v1/project/route.ts
|
|
27
|
-
* Keep this schema synchronized with the producer payload.
|
|
28
|
-
*/
|
|
29
|
-
const projectInfoSchema = z.object({
|
|
30
|
-
projectId: z.string(),
|
|
31
|
-
projectName: z.string(),
|
|
32
|
-
metadata: z.record(z.unknown()),
|
|
33
|
-
pages: z.array(projectPageSchema),
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Consumer-side runtime contract for GET /api/v1/project/exports.
|
|
37
|
-
* Producer source of truth: apps/studio/src/app/api/v1/project/exports/route.ts
|
|
38
|
-
* Keep this schema synchronized with the producer payload.
|
|
39
|
-
*/
|
|
40
|
-
const exportsResponseSchema = z.object({
|
|
41
|
-
exports: z.array(z.object({
|
|
42
|
-
id: z.string(),
|
|
43
|
-
status: exportStatusSchema,
|
|
44
|
-
createdAt: z.string().datetime({ offset: true }),
|
|
45
|
-
})),
|
|
46
|
-
});
|
|
47
|
-
/**
|
|
48
|
-
* Consumer-side runtime contract for POST /api/v1/project/exports.
|
|
49
|
-
* Producer source of truth: apps/studio/src/app/api/v1/project/exports/route.ts
|
|
50
|
-
* Keep this schema synchronized with the producer payload.
|
|
51
|
-
*/
|
|
52
|
-
const createExportResponseSchema = z.object({
|
|
53
|
-
export: z.object({
|
|
54
|
-
id: z.string(),
|
|
55
|
-
status: exportStatusSchema,
|
|
56
|
-
}),
|
|
57
|
-
pages: z.array(projectPageSchema),
|
|
58
|
-
});
|
|
59
|
-
class PrimeUiApiContractError extends Error {
|
|
60
|
-
constructor(endpoint, details) {
|
|
61
|
-
super(`PrimeUI API contract mismatch for "${endpoint}": ${details}`);
|
|
62
|
-
this.name = "PrimeUiApiContractError";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const normalizeApiRoot = (rawBaseUrl) => {
|
|
66
|
-
const normalizedBase = rawBaseUrl.trim() || DEFAULT_API_BASE_URL;
|
|
67
|
-
const parsed = new URL(normalizedBase);
|
|
68
|
-
const normalizedPath = parsed.pathname.replace(/\/+$/, "");
|
|
69
|
-
if (normalizedPath.endsWith("/api/v1")) {
|
|
70
|
-
parsed.pathname = `${normalizedPath}/`;
|
|
71
|
-
return parsed.toString();
|
|
72
|
-
}
|
|
73
|
-
parsed.pathname = `${normalizedPath}/api/v1/`.replace("//api/v1/", "/api/v1/");
|
|
74
|
-
return parsed.toString();
|
|
75
|
-
};
|
|
76
|
-
const isJsonContentType = (contentType) => contentType.includes("application/json") || contentType.includes("+json");
|
|
77
|
-
const isZipContentType = (contentType) => ZIP_CONTENT_TYPES.some((allowedType) => contentType.includes(allowedType));
|
|
78
|
-
const looksLikeZipArchive = (buffer) => {
|
|
79
|
-
if (buffer.length < 4) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
if (buffer[0] !== 0x50 || buffer[1] !== 0x4b) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
const signature = `${buffer[2]}:${buffer[3]}`;
|
|
86
|
-
return signature === "3:4" || signature === "5:6" || signature === "7:8";
|
|
87
|
-
};
|
|
88
|
-
const createZipSignatureGuard = (endpoint) => {
|
|
89
|
-
let signature = Buffer.alloc(0);
|
|
90
|
-
let validated = false;
|
|
91
|
-
return new Transform({
|
|
92
|
-
transform(chunk, _encoding, callback) {
|
|
93
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
94
|
-
if (!validated) {
|
|
95
|
-
const requiredBytes = Math.max(0, 4 - signature.length);
|
|
96
|
-
if (requiredBytes > 0) {
|
|
97
|
-
signature = Buffer.concat([
|
|
98
|
-
signature,
|
|
99
|
-
chunkBuffer.subarray(0, requiredBytes),
|
|
100
|
-
]);
|
|
101
|
-
}
|
|
102
|
-
if (signature.length >= 4) {
|
|
103
|
-
if (!looksLikeZipArchive(signature)) {
|
|
104
|
-
callback(new PrimeUiApiContractError(endpoint, "response body is not a valid zip archive"));
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
validated = true;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
callback(null, chunkBuffer);
|
|
111
|
-
},
|
|
112
|
-
flush(callback) {
|
|
113
|
-
if (!validated) {
|
|
114
|
-
callback(new PrimeUiApiContractError(endpoint, "response body is not a valid zip archive"));
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
callback();
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
export class ApiProjectDataProvider {
|
|
122
|
-
apiKey;
|
|
123
|
-
apiRoot;
|
|
124
|
-
constructor(options) {
|
|
125
|
-
this.apiKey = options.apiKey;
|
|
126
|
-
this.apiRoot = normalizeApiRoot(options.baseUrl ?? DEFAULT_API_BASE_URL);
|
|
127
|
-
}
|
|
128
|
-
async getProjectInfo() {
|
|
129
|
-
return this.requestJson("project", projectInfoSchema);
|
|
130
|
-
}
|
|
131
|
-
async listExports() {
|
|
132
|
-
const response = await this.requestJson("project/exports", exportsResponseSchema);
|
|
133
|
-
return response.exports;
|
|
134
|
-
}
|
|
135
|
-
async createExport() {
|
|
136
|
-
return this.requestJson("project/exports", createExportResponseSchema, {
|
|
137
|
-
method: "POST",
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Consumer-side runtime contract for GET /api/v1/project/exports/:exportId/download.
|
|
142
|
-
* Producer source of truth: apps/studio/src/app/api/v1/project/exports/[exportId]/download/route.ts
|
|
143
|
-
* Keep content-type and archive format checks synchronized with the producer response.
|
|
144
|
-
*/
|
|
145
|
-
async downloadExportArchive(exportId, destinationPath) {
|
|
146
|
-
const endpoint = `project/exports/${encodeURIComponent(exportId)}/download`;
|
|
147
|
-
const apiKey = this.requireApiKey();
|
|
148
|
-
const response = await fetch(this.buildUrl(endpoint), {
|
|
149
|
-
method: "GET",
|
|
150
|
-
headers: {
|
|
151
|
-
Authorization: `Bearer ${apiKey}`,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
if (!response.ok) {
|
|
155
|
-
const details = await this.readError(response);
|
|
156
|
-
throw new Error(`PrimeUI API request failed (${response.status}) while downloading export "${exportId}": ${details}`);
|
|
157
|
-
}
|
|
158
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
159
|
-
if (!isZipContentType(contentType)) {
|
|
160
|
-
throw new PrimeUiApiContractError(endpoint, `expected zip content-type but got "${contentType || "unknown"}"`);
|
|
161
|
-
}
|
|
162
|
-
if (!response.body) {
|
|
163
|
-
throw new PrimeUiApiContractError(endpoint, "response body is empty");
|
|
164
|
-
}
|
|
165
|
-
await ensureDir(path.dirname(destinationPath));
|
|
166
|
-
const zipStream = Readable.fromWeb(response.body);
|
|
167
|
-
const signatureGuard = createZipSignatureGuard(endpoint);
|
|
168
|
-
const fileStream = createWriteStream(destinationPath);
|
|
169
|
-
try {
|
|
170
|
-
await pipeline(zipStream, signatureGuard, fileStream);
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
await unlink(destinationPath).catch(() => undefined);
|
|
174
|
-
throw error;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
buildUrl(endpoint) {
|
|
178
|
-
return new URL(endpoint, this.apiRoot).toString();
|
|
179
|
-
}
|
|
180
|
-
async requestJson(endpoint, schema, requestInit = {}) {
|
|
181
|
-
const apiKey = this.requireApiKey();
|
|
182
|
-
const method = requestInit.method ?? "GET";
|
|
183
|
-
const response = await fetch(this.buildUrl(endpoint), {
|
|
184
|
-
...requestInit,
|
|
185
|
-
method,
|
|
186
|
-
headers: {
|
|
187
|
-
...(requestInit.headers ?? {}),
|
|
188
|
-
Authorization: `Bearer ${apiKey}`,
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
|
-
if (!response.ok) {
|
|
192
|
-
const details = await this.readError(response);
|
|
193
|
-
throw new Error(`PrimeUI API request failed (${response.status}) for "${endpoint}": ${details}`);
|
|
194
|
-
}
|
|
195
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
196
|
-
if (!isJsonContentType(contentType)) {
|
|
197
|
-
throw new PrimeUiApiContractError(endpoint, `expected JSON content-type but got "${contentType || "unknown"}"`);
|
|
198
|
-
}
|
|
199
|
-
let payload;
|
|
200
|
-
try {
|
|
201
|
-
payload = await response.json();
|
|
202
|
-
}
|
|
203
|
-
catch {
|
|
204
|
-
throw new PrimeUiApiContractError(endpoint, "response body is not valid JSON");
|
|
205
|
-
}
|
|
206
|
-
const parsed = schema.safeParse(payload);
|
|
207
|
-
if (!parsed.success) {
|
|
208
|
-
const details = parsed.error.issues
|
|
209
|
-
.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
|
|
210
|
-
.join("; ");
|
|
211
|
-
throw new PrimeUiApiContractError(endpoint, details);
|
|
212
|
-
}
|
|
213
|
-
return parsed.data;
|
|
214
|
-
}
|
|
215
|
-
async readError(response) {
|
|
216
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
217
|
-
try {
|
|
218
|
-
if (isJsonContentType(contentType)) {
|
|
219
|
-
const body = (await response.json());
|
|
220
|
-
if (body?.message && body?.code) {
|
|
221
|
-
return `${body.code}: ${body.message}`;
|
|
222
|
-
}
|
|
223
|
-
if (body?.message) {
|
|
224
|
-
return body.message;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
const bodyText = await response.text();
|
|
229
|
-
if (bodyText.trim()) {
|
|
230
|
-
return bodyText.trim();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
catch {
|
|
235
|
-
// No-op: fall through to generic status text.
|
|
236
|
-
}
|
|
237
|
-
return response.statusText || "Unknown error";
|
|
238
|
-
}
|
|
239
|
-
requireApiKey() {
|
|
240
|
-
const apiKey = this.apiKey?.trim();
|
|
241
|
-
if (!apiKey) {
|
|
242
|
-
throw new Error("PRIMEUI_API_KEY is required to call PrimeUI API tools.");
|
|
243
|
-
}
|
|
244
|
-
return apiKey;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=api-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-provider.js","sourceRoot":"","sources":["../../src/sources/api-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAczC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AACxD,MAAM,iBAAiB,GAAG;IACxB,iBAAiB;IACjB,0BAA0B;IAC1B,8BAA8B;CAC/B,CAAC;AACF,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1E,MAAM,iBAAiB,GAAkC,CAAC,CAAC,MAAM,CAAC;IAChE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MA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AAC;IAChD,CAAC;IAEO,aAAa;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PrimeUiCreateExportResult, PrimeUiExport, PrimeUiProjectInfo } from "../types.js";
|
|
2
|
-
export interface ProjectDataProvider {
|
|
3
|
-
getProjectInfo(): Promise<PrimeUiProjectInfo>;
|
|
4
|
-
listExports(): Promise<PrimeUiExport[]>;
|
|
5
|
-
createExport(): Promise<PrimeUiCreateExportResult>;
|
|
6
|
-
downloadExportArchive(exportId: string, destinationPath: string): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-data-provider.js","sourceRoot":"","sources":["../../src/sources/project-data-provider.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PrimeUiCreateExportResult, PrimeUiDownloadResult, PrimeUiExport, PrimeUiProjectInfo } from "../types.js";
|
|
2
|
-
export interface ProjectSyncSource {
|
|
3
|
-
getProjectInfo(): Promise<PrimeUiProjectInfo>;
|
|
4
|
-
listExports(): Promise<PrimeUiExport[]>;
|
|
5
|
-
createExport(): Promise<PrimeUiCreateExportResult>;
|
|
6
|
-
downloadExportById(id: string): Promise<PrimeUiDownloadResult>;
|
|
7
|
-
clearTemp(): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-sync-source.js","sourceRoot":"","sources":["../../src/sources/project-sync-source.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export type PrimeUiExportStatus = "in_progress" | "completed" | "failed";
|
|
2
|
-
export interface PrimeUiProjectPage {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
slug: string;
|
|
6
|
-
pageType: string;
|
|
7
|
-
isReadyToExport: boolean;
|
|
8
|
-
pagePath: string;
|
|
9
|
-
componentsPath: string;
|
|
10
|
-
}
|
|
11
|
-
export interface PrimeUiProjectInfo {
|
|
12
|
-
projectId: string;
|
|
13
|
-
projectName: string;
|
|
14
|
-
metadata: Record<string, unknown>;
|
|
15
|
-
pages: PrimeUiProjectPage[];
|
|
16
|
-
}
|
|
17
|
-
export interface PrimeUiExport {
|
|
18
|
-
id: string;
|
|
19
|
-
status: PrimeUiExportStatus;
|
|
20
|
-
createdAt: string;
|
|
21
|
-
}
|
|
22
|
-
export interface PrimeUiCreateExportResult {
|
|
23
|
-
export: {
|
|
24
|
-
id: string;
|
|
25
|
-
status: PrimeUiExportStatus;
|
|
26
|
-
};
|
|
27
|
-
pages: PrimeUiProjectPage[];
|
|
28
|
-
}
|
|
29
|
-
export interface PrimeUiDownloadResult {
|
|
30
|
-
exportId: string;
|
|
31
|
-
projectPath: string;
|
|
32
|
-
pages: PrimeUiProjectPage[];
|
|
33
|
-
}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|