@prompt-optimizer/mcp-server 0.1.0 → 0.1.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.
Files changed (67) hide show
  1. package/README.md +9 -7
  2. package/dist/browser.js +10 -4200
  3. package/dist/chunk-2AOVKKBT.js +7 -0
  4. package/dist/chunk-5QROM7SH.js +3 -0
  5. package/dist/chunk-7FYOSVIN.js +3 -0
  6. package/dist/chunk-AKXNS3YY.js +4 -0
  7. package/dist/chunk-BBXFEEUH.js +43 -0
  8. package/dist/chunk-CHINCAF5.js +33 -0
  9. package/dist/chunk-EJ2IIPFF.js +3 -0
  10. package/dist/chunk-FLQML3XF.js +64 -0
  11. package/dist/chunk-GA7S5A7R.js +3 -0
  12. package/dist/chunk-IABPRAPS.js +3 -0
  13. package/dist/chunk-JE2EBI2C.js +3 -0
  14. package/dist/chunk-JL6XIA4S.js +4 -0
  15. package/dist/chunk-JXWLV6TC.js +12 -0
  16. package/dist/chunk-MUXGFCOV.js +7012 -0
  17. package/dist/chunk-NT2DBZVA.js +3 -0
  18. package/dist/chunk-NVZFDKDX.js +3 -0
  19. package/dist/chunk-PKJ2PK6J.js +106 -0
  20. package/dist/chunk-SDHFVY4F.js +6 -0
  21. package/dist/chunk-TWLLFRFQ.js +6 -0
  22. package/dist/desktop-business.js +4 -1225
  23. package/dist/desktop-comparison-UIIN3WK4.js +3 -0
  24. package/dist/desktop-storage-KJWV2A3P.js +3 -0
  25. package/dist/desktop.js +1 -24
  26. package/dist/dist-OM6QMJNC.js +10 -0
  27. package/dist/dist-YR425RV6.js +3 -0
  28. package/dist/index.js +1 -10
  29. package/dist/legacy.js +97 -26634
  30. package/dist/multipart-parser-XGXMMB2Z.js +4 -0
  31. package/dist/node-2SMUH4FH.js +3 -0
  32. package/dist/node-NX6BPYD5.js +3 -0
  33. package/dist/node-U7LDATXE.js +17 -0
  34. package/dist/registry-H5F4DGAM-2GPEVJMD.js +3 -0
  35. package/dist/src-3F22P42W.js +5 -0
  36. package/dist/start.js +2 -13
  37. package/package.json +10 -1
  38. package/preload-env.cjs +3 -352
  39. package/dist/chunk-3FYJ3FRD.js +0 -57
  40. package/dist/chunk-E7Z4Y3F4.js +0 -36402
  41. package/dist/chunk-GBDJTSRW.js +0 -298
  42. package/dist/chunk-HLCN3DLS.js +0 -19745
  43. package/dist/chunk-HYVN7FZZ.js +0 -4787
  44. package/dist/chunk-MEUCFQGU.js +0 -537
  45. package/dist/chunk-N6AUTPPS.js +0 -10647
  46. package/dist/chunk-Q52SACHI.js +0 -304
  47. package/dist/chunk-Q5B3KFB3.js +0 -31
  48. package/dist/chunk-QSPNNVX3.js +0 -49017
  49. package/dist/chunk-SO4YJHYW.js +0 -13450
  50. package/dist/chunk-SV2GETJH.js +0 -65
  51. package/dist/chunk-TFH2LO2H.js +0 -58
  52. package/dist/chunk-TFJEYQ3G.js +0 -786
  53. package/dist/chunk-TLOFCHZI.js +0 -70
  54. package/dist/chunk-TQGHULC7.js +0 -188
  55. package/dist/chunk-UTOMPKTK.js +0 -2209
  56. package/dist/chunk-XXALDAL7.js +0 -1838
  57. package/dist/chunk-YT3U6B54.js +0 -21
  58. package/dist/desktop-comparison-HDIQ6K45.js +0 -22
  59. package/dist/desktop-storage-YRABQCLF.js +0 -14
  60. package/dist/dist-O5VNBF5I.js +0 -622
  61. package/dist/dist-UMX52UME.js +0 -481
  62. package/dist/multipart-parser-XE6WGDAU.js +0 -373
  63. package/dist/node-2RBNZOSK.js +0 -2225
  64. package/dist/node-4Z3USCHW.js +0 -21
  65. package/dist/node-QHGLD5ST.js +0 -25
  66. package/dist/registry-H5F4DGAM-UHR4F6LL.js +0 -13
  67. package/dist/src-7PBMYCGI.js +0 -1398
@@ -1,65 +0,0 @@
1
- import { createRequire as __mcpCreateRequire } from "node:module";
2
- const require = __mcpCreateRequire(import.meta.url);
3
- import {
4
- DesktopSourceError
5
- } from "./chunk-GBDJTSRW.js";
6
-
7
- // src/desktop-storage.ts
8
- var openReadonlyDesktop = async (absoluteUserDataPath) => {
9
- try {
10
- const { openExistingDesktopStorage } = await import("./node-QHGLD5ST.js");
11
- const lease = await openExistingDesktopStorage(absoluteUserDataPath);
12
- if (!lease.provider.readOnly) {
13
- await lease.provider.close();
14
- throw new DesktopSourceError("SOURCE_NOT_READY");
15
- }
16
- return lease;
17
- } catch {
18
- throw new DesktopSourceError("SOURCE_NOT_READY");
19
- }
20
- };
21
- function isSourceDiverged(error, expectedReason) {
22
- const reason = error?.params?.reason;
23
- return typeof reason === "string" && reason === expectedReason;
24
- }
25
- var openComparisonDesktop = async (absoluteUserDataPath, executionSource) => {
26
- let lease;
27
- try {
28
- const node = await import("./node-QHGLD5ST.js");
29
- try {
30
- lease = await node.openExistingDesktopStorageForWriting(absoluteUserDataPath);
31
- } catch (error) {
32
- if (isSourceDiverged(error, node.DESKTOP_STORAGE_DIVERGENCE_REASON)) throw new DesktopSourceError("SOURCE_DATA_DIVERGED");
33
- throw error;
34
- }
35
- if (lease.provider.readOnly) throw new DesktopSourceError("SOURCE_NOT_READY");
36
- const core = await import("./desktop-comparison-HDIQ6K45.js");
37
- const runner = core.createTextComparisonService({ storage: lease.provider, executionSource });
38
- return {
39
- ...lease,
40
- comparison: {
41
- runner,
42
- repository: core.createComparisonRepository(lease.provider),
43
- errorCode(error) {
44
- if (isSourceDiverged(error, node.DESKTOP_STORAGE_DIVERGENCE_REASON)) return "SOURCE_DATA_DIVERGED";
45
- return error instanceof core.TextComparisonError || error instanceof core.ComparisonRepositoryError || error instanceof core.AssetReadError ? error.code : void 0;
46
- }
47
- }
48
- };
49
- } catch (error) {
50
- if (lease) {
51
- try {
52
- await lease.provider.close();
53
- } catch {
54
- throw new DesktopSourceError("SOURCE_CLOSE_FAILED");
55
- }
56
- }
57
- if (error instanceof DesktopSourceError) throw error;
58
- throw new DesktopSourceError("SOURCE_NOT_READY");
59
- }
60
- };
61
-
62
- export {
63
- openReadonlyDesktop,
64
- openComparisonDesktop
65
- };
@@ -1,58 +0,0 @@
1
- import { createRequire as __mcpCreateRequire } from "node:module";
2
- const require = __mcpCreateRequire(import.meta.url);
3
- import {
4
- __publicField
5
- } from "./chunk-TQGHULC7.js";
6
-
7
- // ../core/dist/chunk-T2XYHODO.js
8
- var BROWSER_BRIDGE_PROTOCOL = "po-browser-bridge/1";
9
- var BROWSER_BRIDGE_MAX_BYTES = 2 * 1024 * 1024;
10
- var browserTextRunKinds = ["optimize", "test"];
11
- var BrowserBridgeError = class extends Error {
12
- constructor(code) {
13
- super(`Browser source request failed (${code}).`);
14
- __publicField(this, "code", code);
15
- this.name = "BrowserBridgeError";
16
- }
17
- };
18
- var browserFavoriteOperations = [
19
- { operation: "getFavorites", access: "read", arguments: ["options?"], minimum: 0 },
20
- { operation: "getFavorite", access: "read", arguments: ["id"], minimum: 1 },
21
- { operation: "getCategories", access: "read", arguments: [], minimum: 0 },
22
- { operation: "getAllTags", access: "read", arguments: [], minimum: 0 },
23
- { operation: "addFavorite", access: "write", arguments: ["favorite"], minimum: 1 },
24
- { operation: "updateFavorite", access: "write", arguments: ["id", "updates"], minimum: 2 },
25
- { operation: "setFavoritePromptAssetCurrentVersion", access: "write", arguments: ["id", "versionId"], minimum: 2 },
26
- { operation: "deleteFavoritePromptAssetVersion", access: "write", arguments: ["id", "versionId"], minimum: 2 },
27
- { operation: "deleteFavorite", access: "write", arguments: ["id"], minimum: 1 }
28
- ];
29
- function assertBridgeJson(value, depth = 0, budget = { remaining: 1e5 }) {
30
- if (depth > 32 || --budget.remaining < 0) throw new BrowserBridgeError("INVALID_INPUT");
31
- if (value === null || typeof value === "string" || typeof value === "boolean") return;
32
- if (typeof value === "number" && Number.isFinite(value)) return;
33
- if (Array.isArray(value)) {
34
- for (const item of value) assertBridgeJson(item, depth + 1, budget);
35
- return;
36
- }
37
- if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value))) {
38
- throw new BrowserBridgeError("INVALID_INPUT");
39
- }
40
- for (const [key, item] of Object.entries(value)) {
41
- if (["__proto__", "constructor", "prototype"].includes(key)) throw new BrowserBridgeError("INVALID_INPUT");
42
- assertBridgeJson(item, depth + 1, budget);
43
- }
44
- }
45
- function publicBrowserError(error) {
46
- const code = error instanceof Error && "code" in error ? error.code : void 0;
47
- return typeof code === "string" && /^[A-Z][A-Z_]{0,79}$/.test(code) ? code : "PRODUCT_REQUEST_FAILED";
48
- }
49
-
50
- export {
51
- BROWSER_BRIDGE_PROTOCOL,
52
- BROWSER_BRIDGE_MAX_BYTES,
53
- browserTextRunKinds,
54
- BrowserBridgeError,
55
- browserFavoriteOperations,
56
- assertBridgeJson,
57
- publicBrowserError
58
- };