@becrafter/prompt-manager 0.1.31 → 0.2.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@becrafter/prompt-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Remote MCP Server for managing prompts",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"fix:pty": "npm rebuild node-pty",
|
|
27
27
|
"help": "cd packages/server && node server.js --help",
|
|
28
28
|
"build": "npm run build:admin-ui && npm run build:core",
|
|
29
|
-
"build:core": "
|
|
30
|
-
"build:admin-ui": "
|
|
29
|
+
"build:core": "cd packages/server && npx esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18",
|
|
30
|
+
"build:admin-ui": "cd packages/admin-ui && npx webpack --mode production",
|
|
31
31
|
"build:desktop": "bash scripts/build.sh",
|
|
32
32
|
"build:desktop:all": "bash scripts/build.sh build:all",
|
|
33
33
|
"build:icons": "node ./scripts/build-icons.js",
|
|
@@ -47,12 +47,19 @@
|
|
|
47
47
|
"format:check": "cd packages/server && npm run format:check",
|
|
48
48
|
"verify": "npm run verify:publish",
|
|
49
49
|
"verify:publish": "node scripts/verify-publish.js",
|
|
50
|
+
"verify:build": "node scripts/verify-build.js",
|
|
50
51
|
"release:pre-check": "node scripts/pre-release-check.js",
|
|
51
52
|
"release:update-version": "node scripts/update-version.js",
|
|
52
53
|
"release:rollback": "node scripts/rollback-release.js rollback",
|
|
53
54
|
"check:deps": "bash scripts/check-dependencies.sh",
|
|
54
55
|
"check:env": "bash scripts/check-env.sh",
|
|
55
56
|
"setup:env": "node scripts/preinstall-check.js",
|
|
57
|
+
"clean": "bash scripts/clean-environment.sh",
|
|
58
|
+
"clean:cache": "bash scripts/clean-environment.sh cache-only",
|
|
59
|
+
"clean:deps": "bash scripts/clean-environment.sh deps-only",
|
|
60
|
+
"clean:build": "bash scripts/clean-environment.sh build-only",
|
|
61
|
+
"clean:reinstall": "npm run clean && npm install",
|
|
62
|
+
"test:build": "bash scripts/build.sh test-build",
|
|
56
63
|
"postinstall": "npm rebuild node-pty && chmod +x node_modules/node-pty/prebuilds/*/pty.node node_modules/node-pty/prebuilds/*/spawn-helper 2>/dev/null || true"
|
|
57
64
|
},
|
|
58
65
|
"keywords": [
|
|
@@ -795,7 +795,7 @@ export default {
|
|
|
795
795
|
return { dragged: { from: params.source, to: params.target } };
|
|
796
796
|
|
|
797
797
|
case 'screenshot':
|
|
798
|
-
const
|
|
798
|
+
const screenshotPage = browser.getPage();
|
|
799
799
|
const screenshotOptions = {};
|
|
800
800
|
if (params.fullPage) screenshotOptions.fullPage = true;
|
|
801
801
|
if (params.screenshotFormat) screenshotOptions.type = params.screenshotFormat;
|
|
@@ -806,7 +806,7 @@ export default {
|
|
|
806
806
|
const buffer = await locator.screenshot(screenshotOptions);
|
|
807
807
|
return { buffer: buffer.toString('base64'), selector: params.selector };
|
|
808
808
|
} else {
|
|
809
|
-
const buffer = await
|
|
809
|
+
const buffer = await screenshotPage.screenshot(screenshotOptions);
|
|
810
810
|
if (params.screenshotPath) {
|
|
811
811
|
const fs = await import('fs');
|
|
812
812
|
fs.writeFileSync(params.screenshotPath, buffer);
|
|
@@ -908,60 +908,60 @@ export default {
|
|
|
908
908
|
|
|
909
909
|
case 'getbyrole':
|
|
910
910
|
if (params.role && params.subaction) {
|
|
911
|
-
const
|
|
912
|
-
const locator =
|
|
911
|
+
const rolePage = browser.getPage();
|
|
912
|
+
const locator = rolePage.getByRole(params.role, { name: params.name });
|
|
913
913
|
await this.executeSubaction(locator, params.subaction, params.value);
|
|
914
914
|
}
|
|
915
915
|
return { role: params.role, name: params.name };
|
|
916
916
|
|
|
917
917
|
case 'getbytext':
|
|
918
918
|
if (params.text && params.subaction) {
|
|
919
|
-
const
|
|
919
|
+
const textPage = browser.getPage();
|
|
920
920
|
const options = {};
|
|
921
921
|
if (params.exact !== undefined) options.exact = params.exact;
|
|
922
|
-
const locator =
|
|
922
|
+
const locator = textPage.getByText(params.text, options);
|
|
923
923
|
await this.executeSubaction(locator, params.subaction);
|
|
924
924
|
}
|
|
925
925
|
return { text: params.text };
|
|
926
926
|
|
|
927
927
|
case 'getbylabel':
|
|
928
928
|
if (params.label && params.subaction) {
|
|
929
|
-
const
|
|
930
|
-
const locator =
|
|
929
|
+
const labelPage = browser.getPage();
|
|
930
|
+
const locator = labelPage.getByLabel(params.label);
|
|
931
931
|
await this.executeSubaction(locator, params.subaction, params.value);
|
|
932
932
|
}
|
|
933
933
|
return { label: params.label };
|
|
934
934
|
|
|
935
935
|
case 'getbyplaceholder':
|
|
936
936
|
if (params.placeholder && params.subaction) {
|
|
937
|
-
const
|
|
938
|
-
const locator =
|
|
937
|
+
const placeholderPage = browser.getPage();
|
|
938
|
+
const locator = placeholderPage.getByPlaceholder(params.placeholder);
|
|
939
939
|
await this.executeSubaction(locator, params.subaction, params.value);
|
|
940
940
|
}
|
|
941
941
|
return { placeholder: params.placeholder };
|
|
942
942
|
|
|
943
943
|
case 'getbyalttext':
|
|
944
944
|
if (params.altText && params.subaction) {
|
|
945
|
-
const
|
|
946
|
-
const locator =
|
|
945
|
+
const altTextPage = browser.getPage();
|
|
946
|
+
const locator = altTextPage.getByAltText(params.altText);
|
|
947
947
|
await this.executeSubaction(locator, params.subaction);
|
|
948
948
|
}
|
|
949
949
|
return { altText: params.altText };
|
|
950
950
|
|
|
951
951
|
case 'getbytitle':
|
|
952
952
|
if (params.name && params.subaction) {
|
|
953
|
-
const
|
|
953
|
+
const titlePage = browser.getPage();
|
|
954
954
|
const options = {};
|
|
955
955
|
if (params.exact !== undefined) options.exact = params.exact;
|
|
956
|
-
const locator =
|
|
956
|
+
const locator = titlePage.getByTitle(params.name, options);
|
|
957
957
|
await this.executeSubaction(locator, params.subaction);
|
|
958
958
|
}
|
|
959
959
|
return { title: params.name };
|
|
960
960
|
|
|
961
961
|
case 'getbytestid':
|
|
962
962
|
if (params.testId && params.subaction) {
|
|
963
|
-
const
|
|
964
|
-
const locator =
|
|
963
|
+
const testIdPage = browser.getPage();
|
|
964
|
+
const locator = testIdPage.getByTestId(params.testId);
|
|
965
965
|
await this.executeSubaction(locator, params.subaction, params.value);
|
|
966
966
|
}
|
|
967
967
|
return { testId: params.testId };
|
|
@@ -1199,7 +1199,8 @@ export default {
|
|
|
1199
1199
|
case 'download':
|
|
1200
1200
|
if (params.selector && params.downloadPath) {
|
|
1201
1201
|
const locator = browser.getLocator(params.selector);
|
|
1202
|
-
const
|
|
1202
|
+
const downloadPage = browser.getPage();
|
|
1203
|
+
const downloadPromise = downloadPage.waitForEvent('download');
|
|
1203
1204
|
await locator.click();
|
|
1204
1205
|
const download = await downloadPromise;
|
|
1205
1206
|
await download.saveAs(params.downloadPath);
|