@pkagentic/mcp 1.4.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 +68 -0
- package/dist/handlers/image-generation.d.ts +14 -0
- package/dist/handlers/image-generation.js +77 -0
- package/dist/handlers/image-generation.js.map +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/pk-agent.d.ts +156 -0
- package/dist/handlers/pk-agent.js +500 -0
- package/dist/handlers/pk-agent.js.map +1 -0
- package/dist/handlers/tailwind.d.ts +11 -0
- package/dist/handlers/tailwind.js +93 -0
- package/dist/handlers/tailwind.js.map +1 -0
- package/dist/handlers/utility.d.ts +41 -0
- package/dist/handlers/utility.js +153 -0
- package/dist/handlers/utility.js.map +1 -0
- package/dist/handlers/web-crawler.d.ts +30 -0
- package/dist/handlers/web-crawler.js +101 -0
- package/dist/handlers/web-crawler.js.map +1 -0
- package/dist/handlers.d.ts +234 -0
- package/dist/handlers.js +855 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +745 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +2 -0
- package/dist/tools.js +806 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +329 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { InitProjectArgs, GetAgentGuideArgs, OptimizeImageArgs, DownloadImageArgs } from "../types.js";
|
|
2
|
+
export declare class UtilityApi {
|
|
3
|
+
initProject(args: InitProjectArgs): Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
root: string;
|
|
7
|
+
directories: string[];
|
|
8
|
+
}>;
|
|
9
|
+
getAgentGuide(args: GetAgentGuideArgs): Promise<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
message: string;
|
|
12
|
+
file_written: string;
|
|
13
|
+
absolute_path: string;
|
|
14
|
+
}>;
|
|
15
|
+
optimizeImage(args: OptimizeImageArgs): Promise<{
|
|
16
|
+
success: boolean;
|
|
17
|
+
message: string;
|
|
18
|
+
input_path: string;
|
|
19
|
+
output_path: string;
|
|
20
|
+
original: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
size_bytes: number;
|
|
24
|
+
format: string;
|
|
25
|
+
};
|
|
26
|
+
output: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
size_bytes: number;
|
|
30
|
+
format: string;
|
|
31
|
+
};
|
|
32
|
+
resized: boolean;
|
|
33
|
+
converted_to_webp: boolean;
|
|
34
|
+
size_reduction: string;
|
|
35
|
+
}>;
|
|
36
|
+
downloadImage(args: DownloadImageArgs): Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
message: string;
|
|
39
|
+
path: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import sharp from "sharp";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { finished } from "stream/promises";
|
|
7
|
+
// Resolve the directory of this compiled file so we can locate bundled guide files
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
export class UtilityApi {
|
|
11
|
+
async initProject(args) {
|
|
12
|
+
const rootPath = args.path || ".";
|
|
13
|
+
const dirs = [
|
|
14
|
+
".pk-agentic/agent-guide",
|
|
15
|
+
"workspace/templates",
|
|
16
|
+
"workspace/scripts",
|
|
17
|
+
"workspace/contents/pages",
|
|
18
|
+
"workspace/contents/posts",
|
|
19
|
+
"resources/assets",
|
|
20
|
+
"resources/context",
|
|
21
|
+
];
|
|
22
|
+
// Clear agent-guide contents so the latest guide is always used
|
|
23
|
+
const agentGuideDir = path.join(rootPath, ".pk-agentic/agent-guide");
|
|
24
|
+
if (fs.existsSync(agentGuideDir)) {
|
|
25
|
+
for (const entry of fs.readdirSync(agentGuideDir)) {
|
|
26
|
+
fs.rmSync(path.join(agentGuideDir, entry), { recursive: true, force: true });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const dir of dirs) {
|
|
30
|
+
const fullPath = path.join(rootPath, dir);
|
|
31
|
+
if (!fs.existsSync(fullPath)) {
|
|
32
|
+
fs.mkdirSync(fullPath, { recursive: true });
|
|
33
|
+
// Create .gitkeep to ensure empty directories are kept in version control
|
|
34
|
+
fs.writeFileSync(path.join(fullPath, ".gitkeep"), "");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
success: true,
|
|
39
|
+
message: "Project structure initialized successfully.",
|
|
40
|
+
root: path.resolve(rootPath),
|
|
41
|
+
directories: dirs
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async getAgentGuide(args) {
|
|
45
|
+
const { guide } = args;
|
|
46
|
+
// Source: the agent-guide/ folder shipped alongside this MCP server
|
|
47
|
+
// Note: Since this is now in src/handlers/, the path to agent-guide/ might need adjustment
|
|
48
|
+
// relative to the compiled dist/handlers/ directory.
|
|
49
|
+
const sourceDir = path.resolve(__dirname, "..", "..", "agent-guide");
|
|
50
|
+
const sourceFile = path.join(sourceDir, `${guide}.md`);
|
|
51
|
+
if (!fs.existsSync(sourceFile)) {
|
|
52
|
+
throw new Error(`Guide file not found in MCP server: agent-guide/${guide}.md`);
|
|
53
|
+
}
|
|
54
|
+
// Destination: agent-guide/ in the agent's current working directory
|
|
55
|
+
const destDir = path.resolve(".pk-agentic/agent-guide");
|
|
56
|
+
if (!fs.existsSync(destDir)) {
|
|
57
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
58
|
+
}
|
|
59
|
+
const destFile = path.join(destDir, `${guide}.md`);
|
|
60
|
+
fs.copyFileSync(sourceFile, destFile);
|
|
61
|
+
const relativePath = `.pk-agentic/agent-guide/${guide}.md`;
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
message: `Guide written to ${relativePath}. Read that file now to learn about '${guide}'.`,
|
|
65
|
+
file_written: relativePath,
|
|
66
|
+
absolute_path: destFile,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async optimizeImage(args) {
|
|
70
|
+
const { file_path, output_path, width, height, quality = 80 } = args;
|
|
71
|
+
if (!fs.existsSync(file_path)) {
|
|
72
|
+
throw new Error(`File not found: ${file_path}`);
|
|
73
|
+
}
|
|
74
|
+
const ext = path.extname(file_path).toLowerCase().replace(".", "");
|
|
75
|
+
const convertToWebP = ["png", "jpg", "jpeg", "bmp", "tiff", "tif", "heic", "heif"].includes(ext);
|
|
76
|
+
// Output path: replace extension with .webp, or use provided path
|
|
77
|
+
const baseName = path.basename(file_path, path.extname(file_path));
|
|
78
|
+
const inputDir = path.dirname(file_path);
|
|
79
|
+
const resolvedOutput = output_path || path.join(inputDir, `${baseName}.webp`);
|
|
80
|
+
const outputDir = path.dirname(resolvedOutput);
|
|
81
|
+
if (!fs.existsSync(outputDir)) {
|
|
82
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
83
|
+
}
|
|
84
|
+
const originalSize = fs.statSync(file_path).size;
|
|
85
|
+
let image = sharp(file_path);
|
|
86
|
+
const metadata = await image.metadata();
|
|
87
|
+
const originalWidth = metadata.width ?? 0;
|
|
88
|
+
const originalHeight = metadata.height ?? 0;
|
|
89
|
+
// Only resize if the image exceeds the specified dimension
|
|
90
|
+
const resizeWidth = (width && originalWidth > width) ? width : undefined;
|
|
91
|
+
const resizeHeight = (height && originalHeight > height) ? height : undefined;
|
|
92
|
+
if (resizeWidth || resizeHeight) {
|
|
93
|
+
image = image.resize({
|
|
94
|
+
width: resizeWidth,
|
|
95
|
+
height: resizeHeight,
|
|
96
|
+
fit: "inside",
|
|
97
|
+
withoutEnlargement: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const outputExt = path.extname(resolvedOutput).toLowerCase();
|
|
101
|
+
if (convertToWebP || outputExt === ".webp") {
|
|
102
|
+
image = image.webp({ quality });
|
|
103
|
+
}
|
|
104
|
+
const info = await image.toFile(resolvedOutput);
|
|
105
|
+
const newSize = fs.statSync(resolvedOutput).size;
|
|
106
|
+
const reduction = originalSize > 0
|
|
107
|
+
? `${Math.round((1 - newSize / originalSize) * 100)}%`
|
|
108
|
+
: "0%";
|
|
109
|
+
return {
|
|
110
|
+
success: true,
|
|
111
|
+
message: "Image optimized successfully.",
|
|
112
|
+
input_path: file_path,
|
|
113
|
+
output_path: resolvedOutput,
|
|
114
|
+
original: {
|
|
115
|
+
width: originalWidth,
|
|
116
|
+
height: originalHeight,
|
|
117
|
+
size_bytes: originalSize,
|
|
118
|
+
format: ext,
|
|
119
|
+
},
|
|
120
|
+
output: {
|
|
121
|
+
width: info.width,
|
|
122
|
+
height: info.height,
|
|
123
|
+
size_bytes: newSize,
|
|
124
|
+
format: info.format,
|
|
125
|
+
},
|
|
126
|
+
resized: !!(resizeWidth || resizeHeight),
|
|
127
|
+
converted_to_webp: convertToWebP || outputExt === ".webp",
|
|
128
|
+
size_reduction: reduction,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
async downloadImage(args) {
|
|
132
|
+
const { url, path: filePath } = args;
|
|
133
|
+
// Ensure directory exists
|
|
134
|
+
const dir = path.dirname(filePath);
|
|
135
|
+
if (!fs.existsSync(dir)) {
|
|
136
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
137
|
+
}
|
|
138
|
+
const writer = fs.createWriteStream(filePath);
|
|
139
|
+
const response = await axios({
|
|
140
|
+
method: "get",
|
|
141
|
+
url: url,
|
|
142
|
+
responseType: "stream",
|
|
143
|
+
});
|
|
144
|
+
response.data.pipe(writer);
|
|
145
|
+
await finished(writer);
|
|
146
|
+
return {
|
|
147
|
+
success: true,
|
|
148
|
+
message: `Image downloaded successfully to ${filePath}`,
|
|
149
|
+
path: filePath
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/handlers/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAM3C,mFAAmF;AACnF,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,OAAO,UAAU;IACrB,KAAK,CAAC,WAAW,CAAC,IAAqB;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;QAClC,MAAM,IAAI,GAAG;YACX,yBAAyB;YACzB,qBAAqB;YACrB,mBAAmB;YACnB,0BAA0B;YAC1B,0BAA0B;YAC1B,kBAAkB;YAClB,mBAAmB;SACpB,CAAC;QAEF,gEAAgE;QAChE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACjC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;gBAClD,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IA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ACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,MAAM,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC;YAC3B,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,GAAG;YACR,YAAY,EAAE,QAAQ;SACvB,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEvB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,oCAAoC,QAAQ,EAAE;YACvD,IAAI,EAAE,QAAQ;SACf,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReadWebPageArgs } from "../types.js";
|
|
2
|
+
export declare class WebCrawlerApi {
|
|
3
|
+
private turndownService;
|
|
4
|
+
constructor();
|
|
5
|
+
readWebPage(args: ReadWebPageArgs): Promise<{
|
|
6
|
+
success: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
url?: undefined;
|
|
9
|
+
title?: undefined;
|
|
10
|
+
content?: undefined;
|
|
11
|
+
byline?: undefined;
|
|
12
|
+
excerpt?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
success: boolean;
|
|
15
|
+
url: string;
|
|
16
|
+
title: string;
|
|
17
|
+
content: string;
|
|
18
|
+
message?: undefined;
|
|
19
|
+
byline?: undefined;
|
|
20
|
+
excerpt?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
success: boolean;
|
|
23
|
+
url: string;
|
|
24
|
+
title: string;
|
|
25
|
+
byline: string | null | undefined;
|
|
26
|
+
excerpt: string | null | undefined;
|
|
27
|
+
content: string;
|
|
28
|
+
message?: undefined;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { Readability } from "@mozilla/readability";
|
|
3
|
+
import { JSDOM, VirtualConsole } from "jsdom";
|
|
4
|
+
import TurndownService from "turndown";
|
|
5
|
+
export class WebCrawlerApi {
|
|
6
|
+
turndownService;
|
|
7
|
+
constructor() {
|
|
8
|
+
this.turndownService = new TurndownService({
|
|
9
|
+
headingStyle: "atx",
|
|
10
|
+
codeBlockStyle: "fenced"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async readWebPage(args) {
|
|
14
|
+
const { url, render_js = true, wait_selector, css_selector } = args;
|
|
15
|
+
let dom;
|
|
16
|
+
if (render_js) {
|
|
17
|
+
const virtualConsole = new VirtualConsole();
|
|
18
|
+
// Forward virtual console logs to terminal if needed for debugging
|
|
19
|
+
// virtualConsole.sendTo(console);
|
|
20
|
+
try {
|
|
21
|
+
dom = await JSDOM.fromURL(url, {
|
|
22
|
+
resources: "usable",
|
|
23
|
+
runScripts: "dangerously",
|
|
24
|
+
virtualConsole,
|
|
25
|
+
pretendToBeVisual: true,
|
|
26
|
+
});
|
|
27
|
+
// Wait for JS to execute. JSDOM doesn't have a perfect "networkidle"
|
|
28
|
+
// so we wait for the wait_selector or a fixed timeout.
|
|
29
|
+
if (wait_selector) {
|
|
30
|
+
await new Promise((resolve) => {
|
|
31
|
+
const start = Date.now();
|
|
32
|
+
const interval = setInterval(() => {
|
|
33
|
+
if (dom.window.document.querySelector(wait_selector) || Date.now() - start > 10000) {
|
|
34
|
+
clearInterval(interval);
|
|
35
|
+
resolve();
|
|
36
|
+
}
|
|
37
|
+
}, 100);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Default wait for some potential async rendering
|
|
42
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return {
|
|
47
|
+
success: false,
|
|
48
|
+
message: `Failed to load page with JSDOM: ${error.message}`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
try {
|
|
54
|
+
const response = await axios.get(url);
|
|
55
|
+
dom = new JSDOM(response.data, { url });
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return {
|
|
59
|
+
success: false,
|
|
60
|
+
message: `Failed to fetch page with Axios: ${error.message}`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const reader = new Readability(dom.window.document);
|
|
65
|
+
const article = reader.parse();
|
|
66
|
+
if (!article || !article.content) {
|
|
67
|
+
// If readability fails, try to get raw HTML from selector or body
|
|
68
|
+
let contentHtml;
|
|
69
|
+
if (css_selector) {
|
|
70
|
+
const el = dom.window.document.querySelector(css_selector);
|
|
71
|
+
contentHtml = el ? el.innerHTML : dom.window.document.body.innerHTML;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
contentHtml = dom.window.document.body.innerHTML;
|
|
75
|
+
}
|
|
76
|
+
if (!contentHtml) {
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
message: "Failed to extract content from the page."
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const markdown = this.turndownService.turndown(contentHtml);
|
|
83
|
+
return {
|
|
84
|
+
success: true,
|
|
85
|
+
url,
|
|
86
|
+
title: dom.window.document.title,
|
|
87
|
+
content: markdown
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const markdown = this.turndownService.turndown(article.content);
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
url,
|
|
94
|
+
title: article.title || dom.window.document.title,
|
|
95
|
+
byline: article.byline,
|
|
96
|
+
excerpt: article.excerpt,
|
|
97
|
+
content: markdown
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101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CAAC,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;gBAC3D,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YACvE,CAAC;iBAAM,CAAC;gBACN,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YACnD,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,0CAA0C;iBACpD,CAAC;YACJ,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC5D,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,GAAG;gBACH,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;gBAChC,OAAO,EAAE,QAAQ;aAClB,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhE,OAAO;YACL,OAAO,EAAE,IAAI;YACb,GAAG;YACH,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;YACjD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,QAAQ;SAClB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { SyncArgs, GetFileArgs, GetFilesBatchArgs, SaveItemArgs, PublishItemArgs, CreateItemArgs, ToggleItemArgs, UpdateConditionsArgs, UpdateMetadataArgs, DeleteItemArgs, GetRevisionsArgs, RestoreRevisionArgs, SearchContentsArgs, MarkContentEditArgs, UploadMediaArgs, GetImageSrcsetArgs, DownloadImageArgs, ReadWebPageArgs, InitProjectArgs, SearchMediaArgs, GetAgentGuideArgs, UpdateTailwindConfigArgs, GenerateImageArgs, OptimizeImageArgs, ListLibrariesArgs, CreateLibraryArgs, UpdateLibraryArgs, DeleteLibraryArgs, SearchLibrariesArgs, GetLibraryArgs, CdnDownloadLibraryArgs, SaveLibraryFilesArgs, RestoreLibraryBackupArgs, UpdateLibraryConditionsArgs, ToggleLibraryArgs, ToggleLibraryLockArgs, TailwindOptimizeArgs } from "./types.js";
|
|
2
|
+
export declare class ImageGenerationApi {
|
|
3
|
+
private client;
|
|
4
|
+
private modelId;
|
|
5
|
+
constructor(apiKey?: string, modelId?: string);
|
|
6
|
+
generateImage(args: GenerateImageArgs): Promise<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
file_path: string;
|
|
10
|
+
image_name: string;
|
|
11
|
+
page_name: string;
|
|
12
|
+
model: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare class UtilityApi {
|
|
16
|
+
initProject(args: InitProjectArgs): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
root: string;
|
|
20
|
+
directories: string[];
|
|
21
|
+
}>;
|
|
22
|
+
getAgentGuide(args: GetAgentGuideArgs): Promise<{
|
|
23
|
+
success: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
file_written: string;
|
|
26
|
+
absolute_path: string;
|
|
27
|
+
}>;
|
|
28
|
+
optimizeImage(args: OptimizeImageArgs): Promise<{
|
|
29
|
+
success: boolean;
|
|
30
|
+
message: string;
|
|
31
|
+
input_path: string;
|
|
32
|
+
output_path: string;
|
|
33
|
+
original: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
size_bytes: number;
|
|
37
|
+
format: string;
|
|
38
|
+
};
|
|
39
|
+
output: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
size_bytes: number;
|
|
43
|
+
format: string;
|
|
44
|
+
};
|
|
45
|
+
resized: boolean;
|
|
46
|
+
converted_to_webp: boolean;
|
|
47
|
+
size_reduction: string;
|
|
48
|
+
}>;
|
|
49
|
+
downloadImage(args: DownloadImageArgs): Promise<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
message: string;
|
|
52
|
+
path: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
export declare class TailwindApi {
|
|
56
|
+
optimize(args: TailwindOptimizeArgs): Promise<{
|
|
57
|
+
success: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
output_path: string;
|
|
60
|
+
css_size: number;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
export declare class WebCrawlerApi {
|
|
64
|
+
private turndownService;
|
|
65
|
+
constructor();
|
|
66
|
+
readWebPage(args: ReadWebPageArgs): Promise<{
|
|
67
|
+
success: boolean;
|
|
68
|
+
message: string;
|
|
69
|
+
url?: undefined;
|
|
70
|
+
title?: undefined;
|
|
71
|
+
content?: undefined;
|
|
72
|
+
byline?: undefined;
|
|
73
|
+
excerpt?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
success: boolean;
|
|
76
|
+
url: string;
|
|
77
|
+
title: string;
|
|
78
|
+
content: string;
|
|
79
|
+
message?: undefined;
|
|
80
|
+
byline?: undefined;
|
|
81
|
+
excerpt?: undefined;
|
|
82
|
+
} | {
|
|
83
|
+
success: boolean;
|
|
84
|
+
url: string;
|
|
85
|
+
title: string;
|
|
86
|
+
byline: string | null | undefined;
|
|
87
|
+
excerpt: string | null | undefined;
|
|
88
|
+
content: string;
|
|
89
|
+
message?: undefined;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export declare class PKAgentApi {
|
|
93
|
+
private axiosInstance;
|
|
94
|
+
constructor(baseURL: string, key: string, email: string);
|
|
95
|
+
/**
|
|
96
|
+
* Ensure a directory exists and write JSON content to a file.
|
|
97
|
+
*/
|
|
98
|
+
private writeJsonFile;
|
|
99
|
+
/**
|
|
100
|
+
* Write downloaded code fields (html/css/js) from an API item to the
|
|
101
|
+
* correct workspace sub-directory derived from the item's virtual_path.
|
|
102
|
+
*
|
|
103
|
+
* Layout:
|
|
104
|
+
* template → workspace/templates/{slug}/{slug}.php .css .js
|
|
105
|
+
* script → workspace/scripts/{slug}/{slug}.php .css .js
|
|
106
|
+
* content → workspace/contents/{vp_parts}/{slug}.html .css .js
|
|
107
|
+
*
|
|
108
|
+
* Returns relative paths of every file that was written.
|
|
109
|
+
*/
|
|
110
|
+
private writeItemFiles;
|
|
111
|
+
getSiteInfo(): Promise<{
|
|
112
|
+
success: boolean;
|
|
113
|
+
message: string;
|
|
114
|
+
file_written: string;
|
|
115
|
+
summary: {
|
|
116
|
+
site_name: any;
|
|
117
|
+
site_url: any;
|
|
118
|
+
batch_file_limit: any;
|
|
119
|
+
css_framework: any;
|
|
120
|
+
timezone: any;
|
|
121
|
+
language: any;
|
|
122
|
+
permissions: any;
|
|
123
|
+
menu_locations: any;
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
syncItems(args: SyncArgs): Promise<{
|
|
127
|
+
success: boolean;
|
|
128
|
+
message: string;
|
|
129
|
+
file_written: string;
|
|
130
|
+
summary: {
|
|
131
|
+
page: any;
|
|
132
|
+
per_page: any;
|
|
133
|
+
total_items: any;
|
|
134
|
+
total_pages: any;
|
|
135
|
+
has_more: any;
|
|
136
|
+
items_on_page: {
|
|
137
|
+
templates: any;
|
|
138
|
+
scripts: any;
|
|
139
|
+
content: any;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
getFile(args: GetFileArgs): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
partial_download: boolean;
|
|
146
|
+
message: string;
|
|
147
|
+
metadata: {
|
|
148
|
+
id: any;
|
|
149
|
+
type: any;
|
|
150
|
+
slug: any;
|
|
151
|
+
virtual_path: any;
|
|
152
|
+
download_type: any;
|
|
153
|
+
total_lines: any;
|
|
154
|
+
line_range: any;
|
|
155
|
+
is_locked?: undefined;
|
|
156
|
+
status?: undefined;
|
|
157
|
+
description?: undefined;
|
|
158
|
+
document_content?: undefined;
|
|
159
|
+
};
|
|
160
|
+
content: {
|
|
161
|
+
js?: any;
|
|
162
|
+
css?: any;
|
|
163
|
+
html?: any;
|
|
164
|
+
};
|
|
165
|
+
files_written?: undefined;
|
|
166
|
+
files_count?: undefined;
|
|
167
|
+
} | {
|
|
168
|
+
success: boolean;
|
|
169
|
+
message: string;
|
|
170
|
+
files_written: string[];
|
|
171
|
+
files_count: number;
|
|
172
|
+
metadata: {
|
|
173
|
+
id: any;
|
|
174
|
+
type: any;
|
|
175
|
+
slug: any;
|
|
176
|
+
virtual_path: any;
|
|
177
|
+
is_locked: any;
|
|
178
|
+
status: any;
|
|
179
|
+
download_type: any;
|
|
180
|
+
total_lines: any;
|
|
181
|
+
description: any;
|
|
182
|
+
document_content: any;
|
|
183
|
+
line_range?: undefined;
|
|
184
|
+
};
|
|
185
|
+
partial_download?: undefined;
|
|
186
|
+
content?: undefined;
|
|
187
|
+
}>;
|
|
188
|
+
getFilesBatch(args: GetFilesBatchArgs): Promise<{
|
|
189
|
+
success: boolean;
|
|
190
|
+
message: string;
|
|
191
|
+
items_downloaded: number;
|
|
192
|
+
total_files_written: number;
|
|
193
|
+
items: any[];
|
|
194
|
+
}>;
|
|
195
|
+
getTemplateInfo(id: number): Promise<any>;
|
|
196
|
+
getScriptInfo(id: number): Promise<any>;
|
|
197
|
+
getContentInfo(id: number): Promise<any>;
|
|
198
|
+
private readFileContent;
|
|
199
|
+
saveItem(args: SaveItemArgs): Promise<any>;
|
|
200
|
+
publishItem(args: PublishItemArgs): Promise<any>;
|
|
201
|
+
createItem(args: CreateItemArgs): Promise<any>;
|
|
202
|
+
toggleItem(args: ToggleItemArgs): Promise<any>;
|
|
203
|
+
updateConditions(args: UpdateConditionsArgs): Promise<any>;
|
|
204
|
+
updateMetadata(args: UpdateMetadataArgs): Promise<any>;
|
|
205
|
+
deleteItem(args: DeleteItemArgs): Promise<any>;
|
|
206
|
+
getRevisions(args: GetRevisionsArgs): Promise<any>;
|
|
207
|
+
restoreRevision(args: RestoreRevisionArgs): Promise<any>;
|
|
208
|
+
searchContents(args: SearchContentsArgs): Promise<any>;
|
|
209
|
+
markContentEdit(args: MarkContentEditArgs): Promise<any>;
|
|
210
|
+
searchMedia(args: SearchMediaArgs): Promise<any>;
|
|
211
|
+
uploadMedia(args: UploadMediaArgs): Promise<any>;
|
|
212
|
+
getImageSrcset(args: GetImageSrcsetArgs): Promise<any>;
|
|
213
|
+
getRoles(): Promise<any>;
|
|
214
|
+
getTailwindConfig(): Promise<any>;
|
|
215
|
+
updateTailwindConfig(args: UpdateTailwindConfigArgs): Promise<any>;
|
|
216
|
+
listLibraries(args: ListLibrariesArgs): Promise<{
|
|
217
|
+
success: boolean;
|
|
218
|
+
message: string;
|
|
219
|
+
file_written: string;
|
|
220
|
+
data: any;
|
|
221
|
+
pagination: any;
|
|
222
|
+
}>;
|
|
223
|
+
createLibrary(args: CreateLibraryArgs): Promise<any>;
|
|
224
|
+
updateLibrary(args: UpdateLibraryArgs): Promise<any>;
|
|
225
|
+
deleteLibrary(args: DeleteLibraryArgs): Promise<any>;
|
|
226
|
+
searchLibraries(args: SearchLibrariesArgs): Promise<any>;
|
|
227
|
+
getLibrary(args: GetLibraryArgs): Promise<any>;
|
|
228
|
+
cdnDownloadLibrary(args: CdnDownloadLibraryArgs): Promise<any>;
|
|
229
|
+
saveLibraryFiles(args: SaveLibraryFilesArgs): Promise<any>;
|
|
230
|
+
restoreLibraryBackup(args: RestoreLibraryBackupArgs): Promise<any>;
|
|
231
|
+
updateLibraryConditions(args: UpdateLibraryConditionsArgs): Promise<any>;
|
|
232
|
+
toggleLibrary(args: ToggleLibraryArgs): Promise<any>;
|
|
233
|
+
toggleLibraryLock(args: ToggleLibraryLockArgs): Promise<any>;
|
|
234
|
+
}
|