@cloudinary/asset-management-mcp 0.9.0 → 0.9.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/README.md +12 -15
- package/bin/mcp-server.js +269 -379
- package/bin/mcp-server.js.map +17 -17
- package/esm/funcs/searchSearchAssets.d.ts +46 -2
- package/esm/funcs/searchSearchAssets.d.ts.map +1 -1
- package/esm/funcs/searchSearchAssets.js +46 -2
- package/esm/funcs/searchSearchAssets.js.map +1 -1
- package/esm/landing-page.d.ts.map +1 -1
- package/esm/landing-page.js +9 -3
- package/esm/landing-page.js.map +1 -1
- package/esm/lib/config.d.ts +4 -4
- package/esm/lib/config.js +4 -4
- package/esm/mcp-server/apps/app-shared.d.ts +5 -4
- package/esm/mcp-server/apps/app-shared.d.ts.map +1 -1
- package/esm/mcp-server/apps/app-shared.js +79 -12
- package/esm/mcp-server/apps/app-shared.js.map +1 -1
- package/esm/mcp-server/apps/asset-details-app.d.ts.map +1 -1
- package/esm/mcp-server/apps/asset-details-app.js +7 -14
- package/esm/mcp-server/apps/asset-details-app.js.map +1 -1
- package/esm/mcp-server/apps/asset-gallery-app.d.ts.map +1 -1
- package/esm/mcp-server/apps/asset-gallery-app.js +75 -298
- package/esm/mcp-server/apps/asset-gallery-app.js.map +1 -1
- package/esm/mcp-server/apps/asset-upload-app.d.ts.map +1 -1
- package/esm/mcp-server/apps/asset-upload-app.js +29 -24
- package/esm/mcp-server/apps/asset-upload-app.js.map +1 -1
- package/esm/mcp-server/apps/config.d.ts.map +1 -1
- package/esm/mcp-server/apps/config.js +1 -2
- package/esm/mcp-server/apps/config.js.map +1 -1
- package/esm/mcp-server/apps/extensions.d.ts.map +1 -1
- package/esm/mcp-server/apps/extensions.js +6 -1
- package/esm/mcp-server/apps/extensions.js.map +1 -1
- package/esm/mcp-server/cli/serve/impl.js +1 -1
- package/esm/mcp-server/cli/serve/impl.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/mcp-server/tools/searchSearchAssets.d.ts.map +1 -1
- package/esm/mcp-server/tools/searchSearchAssets.js +46 -2
- package/esm/mcp-server/tools/searchSearchAssets.js.map +1 -1
- package/esm/models/searchparameters.d.ts +4 -1
- package/esm/models/searchparameters.d.ts.map +1 -1
- package/esm/models/searchparameters.js +9 -8
- package/esm/models/searchparameters.js.map +1 -1
- package/esm/tool-names.js +1 -1
- package/esm/tool-names.js.map +1 -1
- package/esm/types/bigint.d.ts.map +1 -1
- package/esm/types/bigint.js +4 -3
- package/esm/types/bigint.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/searchSearchAssets.ts +46 -2
- package/src/landing-page.ts +9 -3
- package/src/lib/config.ts +4 -4
- package/src/mcp-server/apps/app-shared.ts +80 -12
- package/src/mcp-server/apps/asset-details-app.ts +7 -13
- package/src/mcp-server/apps/asset-gallery-app.ts +75 -297
- package/src/mcp-server/apps/asset-upload-app.ts +29 -23
- package/src/mcp-server/apps/config.ts +1 -2
- package/src/mcp-server/apps/extensions.ts +6 -1
- package/src/mcp-server/cli/serve/impl.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/searchSearchAssets.ts +46 -2
- package/src/models/searchparameters.ts +25 -9
- package/src/tool-names.ts +1 -1
- package/src/types/bigint.ts +18 -17
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* with the gallery/details apps via app-shared.ts.
|
|
15
15
|
*/
|
|
16
16
|
import { toJSONSchema } from "zod";
|
|
17
|
-
import { SHARED_CSS_TOKENS, SHARED_CSS_COMPONENTS, SHARED_JS_MCP_CLIENT, SHARED_JS_HELPERS, SHARED_JS_TOOLTIPS, SHARED_JS_MODAL, SHARED_JS_DETAIL_RENDERERS, SHARED_JS_HOST_CONTEXT, } from "./app-shared.js";
|
|
17
|
+
import { SHARED_CSS_TOKENS, SHARED_CSS_COMPONENTS, SHARED_JS_ICONS, SHARED_JS_MCP_CLIENT, SHARED_JS_HELPERS, SHARED_JS_TOOLTIPS, SHARED_JS_MODAL, SHARED_JS_DETAIL_RENDERERS, SHARED_JS_HOST_CONTEXT, } from "./app-shared.js";
|
|
18
18
|
import { UploadRequest$zodSchema } from "../../models/uploadrequest.js";
|
|
19
19
|
import { UploadResourceType$zodSchema } from "../../models/uploadresourcetype.js";
|
|
20
20
|
import { injectToolName } from "./uri.js";
|
|
@@ -41,15 +41,8 @@ const UPLOAD_CSS = /* css */ `
|
|
|
41
41
|
.upload-header h1 {
|
|
42
42
|
font-size: var(--cld-font-sm); font-weight: 600; color: var(--cld-text);
|
|
43
43
|
}
|
|
44
|
-
.upload-header-icon {
|
|
45
|
-
.upload-header {
|
|
46
|
-
.back-link {
|
|
47
|
-
position: absolute; top: -2px; right: 0;
|
|
48
|
-
background: none; border: none; cursor: pointer;
|
|
49
|
-
color: var(--cld-accent); font-size: var(--cld-font-xs);
|
|
50
|
-
padding: 2px 6px; border-radius: 4px;
|
|
51
|
-
}
|
|
52
|
-
.back-link:hover { text-decoration: underline; background: var(--cld-accent-bg); }
|
|
44
|
+
.upload-header-icon { display: flex; align-items: center; justify-content: center; }
|
|
45
|
+
.upload-header-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
53
46
|
|
|
54
47
|
.upload-result .detail-section { padding: 14px 16px; }
|
|
55
48
|
.upload-result .detail-section:first-child { padding-top: 0; }
|
|
@@ -487,16 +480,18 @@ function renderPicker() {
|
|
|
487
480
|
var h = "";
|
|
488
481
|
|
|
489
482
|
h += '<div class="upload-header">';
|
|
483
|
+
h += '<span class="upload-header-icon icon-accent">' + IC.uploadCloud + '</span>';
|
|
484
|
+
h += "<h1>Upload to Cloudinary</h1>";
|
|
485
|
+
h += '<div id="header-actions" style="display:flex;align-items:center;gap:6px;margin-left:auto">';
|
|
490
486
|
if (lastResult) {
|
|
491
|
-
h += '<button class="
|
|
487
|
+
h += '<button class="icon-btn" id="back-to-result-btn">' + IC.chevronLeft + ' Back</button>';
|
|
492
488
|
}
|
|
493
|
-
h += '
|
|
494
|
-
h += "<h1>Upload to Cloudinary</h1>";
|
|
489
|
+
h += '</div>';
|
|
495
490
|
h += "</div>";
|
|
496
491
|
|
|
497
492
|
if (stagedFile) {
|
|
498
493
|
h += '<div class="upload-staged">';
|
|
499
|
-
h += '<div class="upload-staged-icon"
|
|
494
|
+
h += '<div class="upload-staged-icon">' + IC.file + '</div>';
|
|
500
495
|
h += '<div class="upload-staged-info">';
|
|
501
496
|
h += '<div class="upload-staged-name">' + esc(stagedFile.name) + "</div>";
|
|
502
497
|
if (stagedFile.size) {
|
|
@@ -507,11 +502,11 @@ function renderPicker() {
|
|
|
507
502
|
h += '<div class="upload-staged-meta">Remote URL</div>';
|
|
508
503
|
}
|
|
509
504
|
h += "</div>";
|
|
510
|
-
h += '<button class="upload-staged-clear" id="clear-staged-btn" title="Remove"
|
|
505
|
+
h += '<button class="upload-staged-clear icon-btn icon-only" id="clear-staged-btn" title="Remove">' + IC.x + '</button>';
|
|
511
506
|
h += "</div>";
|
|
512
507
|
} else {
|
|
513
508
|
h += '<div class="upload-zone" id="drop-zone">';
|
|
514
|
-
h += '<div class="upload-zone-icon"
|
|
509
|
+
h += '<div class="upload-zone-icon">' + IC.folderOpen + '</div>';
|
|
515
510
|
h += '<div class="upload-zone-text">Drag & drop a file here</div>';
|
|
516
511
|
h += '<div class="upload-zone-hint">Images, videos, PDFs, and other files up to 60 MB</div>';
|
|
517
512
|
h += '<button class="upload-zone-btn" id="browse-btn">Browse Files</button>';
|
|
@@ -535,6 +530,7 @@ function renderPicker() {
|
|
|
535
530
|
}
|
|
536
531
|
|
|
537
532
|
root.innerHTML = h;
|
|
533
|
+
renderThemeToggle();
|
|
538
534
|
|
|
539
535
|
var backBtn = document.getElementById("back-to-result-btn");
|
|
540
536
|
if (backBtn && lastResult) {
|
|
@@ -614,12 +610,13 @@ function renderUploading(name, meta) {
|
|
|
614
610
|
var h = "";
|
|
615
611
|
|
|
616
612
|
h += '<div class="upload-header">';
|
|
617
|
-
h += '<span class="upload-header-icon"
|
|
618
|
-
h +=
|
|
613
|
+
h += '<span class="upload-header-icon icon-accent">' + IC.uploadCloud + '</span>';
|
|
614
|
+
h += '<h1>Uploading…</h1>';
|
|
615
|
+
h += '<div id="header-actions" style="display:flex;align-items:center;gap:6px;margin-left:auto"></div>';
|
|
619
616
|
h += "</div>";
|
|
620
617
|
|
|
621
618
|
h += '<div class="upload-preview">';
|
|
622
|
-
h += '<div class="upload-preview-icon"
|
|
619
|
+
h += '<div class="upload-preview-icon">' + IC.file + '</div>';
|
|
623
620
|
h += '<div class="upload-preview-info">';
|
|
624
621
|
h += '<div class="upload-preview-name">' + esc(name) + "</div>";
|
|
625
622
|
h += '<div class="upload-preview-meta">' + esc(meta) + "</div>";
|
|
@@ -631,6 +628,7 @@ function renderUploading(name, meta) {
|
|
|
631
628
|
h += "</div>";
|
|
632
629
|
|
|
633
630
|
root.innerHTML = h;
|
|
631
|
+
renderThemeToggle();
|
|
634
632
|
animateProgress();
|
|
635
633
|
}
|
|
636
634
|
|
|
@@ -684,7 +682,7 @@ function renderUploadError(title, msg) {
|
|
|
684
682
|
var header = document.querySelector(".upload-header h1");
|
|
685
683
|
if (header) header.textContent = title;
|
|
686
684
|
var icon = document.querySelector(".upload-header-icon");
|
|
687
|
-
if (icon) icon.
|
|
685
|
+
if (icon) { icon.innerHTML = IC.alertTriangle; icon.className = "upload-header-icon icon-warning"; }
|
|
688
686
|
|
|
689
687
|
var safeMsg = esc(msg).replace(/\\n/g, "<br>");
|
|
690
688
|
var h = '<div class="upload-error-msg">' + safeMsg + "</div>";
|
|
@@ -696,14 +694,16 @@ function renderUploadError(title, msg) {
|
|
|
696
694
|
var root = document.getElementById("app");
|
|
697
695
|
var safeMsg = esc(msg).replace(/\\n/g, "<br>");
|
|
698
696
|
var h = '<div class="upload-header">';
|
|
699
|
-
h += '<span class="upload-header-icon"
|
|
697
|
+
h += '<span class="upload-header-icon icon-warning">' + IC.alertTriangle + '</span>';
|
|
700
698
|
h += "<h1>" + esc(title) + "</h1>";
|
|
699
|
+
h += '<div id="header-actions" style="display:flex;align-items:center;gap:6px;margin-left:auto"></div>';
|
|
701
700
|
h += "</div>";
|
|
702
701
|
h += '<div class="upload-error-msg">' + safeMsg + "</div>";
|
|
703
702
|
h += '<div class="upload-another" style="margin-top:14px;text-align:center">';
|
|
704
703
|
h += '<button class="prompt-btn prompt-btn-primary" id="retry-upload-btn">Try from App</button>';
|
|
705
704
|
h += "</div>";
|
|
706
705
|
root.innerHTML = h;
|
|
706
|
+
renderThemeToggle();
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
var btn = document.getElementById("retry-upload-btn");
|
|
@@ -748,8 +748,9 @@ function renderLocalFileNeeded(expectedName, errMsg) {
|
|
|
748
748
|
var classified = classifyFileError(errMsg);
|
|
749
749
|
var root = document.getElementById("app");
|
|
750
750
|
var h = '<div class="upload-header">';
|
|
751
|
-
h += '<span class="upload-header-icon"
|
|
751
|
+
h += '<span class="upload-header-icon icon-accent">' + IC.folderOpen + '</span>';
|
|
752
752
|
h += "<h1>" + esc(classified.title) + "</h1>";
|
|
753
|
+
h += '<div id="header-actions" style="display:flex;align-items:center;gap:6px;margin-left:auto"></div>';
|
|
753
754
|
h += "</div>";
|
|
754
755
|
h += '<div class="prompt" style="margin-bottom:16px">';
|
|
755
756
|
h += '<div class="prompt-desc">The file <strong>' + esc(expectedName)
|
|
@@ -764,13 +765,14 @@ function renderLocalFileNeeded(expectedName, errMsg) {
|
|
|
764
765
|
}
|
|
765
766
|
h += "</div>";
|
|
766
767
|
h += '<div class="upload-zone" id="drop-zone">';
|
|
767
|
-
h += '<div class="upload-zone-icon"
|
|
768
|
+
h += '<div class="upload-zone-icon">' + IC.folderOpen + '</div>';
|
|
768
769
|
h += '<div class="upload-zone-text">Drop <strong>' + esc(expectedName) + "</strong> here</div>";
|
|
769
770
|
h += '<div class="upload-zone-hint">Or click to browse your files</div>';
|
|
770
771
|
h += '<button class="upload-zone-btn" id="browse-btn">Browse Files</button>';
|
|
771
772
|
h += '<input type="file" id="file-input" style="display:none">';
|
|
772
773
|
h += "</div>";
|
|
773
774
|
root.innerHTML = h;
|
|
775
|
+
renderThemeToggle();
|
|
774
776
|
|
|
775
777
|
function onFileSelected(file) {
|
|
776
778
|
var reader = new FileReader();
|
|
@@ -883,8 +885,9 @@ function renderResult(r) {
|
|
|
883
885
|
var h = "";
|
|
884
886
|
|
|
885
887
|
h += '<div class="upload-header">';
|
|
886
|
-
h += '<span class="upload-header-icon
|
|
888
|
+
h += '<span class="upload-header-icon ' + (isPending ? "icon-accent" : "icon-success") + '">' + (isPending ? IC.clock : IC.checkCircle) + '</span>';
|
|
887
889
|
h += "<h1>" + (isPending ? "Upload Queued" : "Upload Complete") + "</h1>";
|
|
890
|
+
h += '<div id="header-actions" style="display:flex;align-items:center;gap:6px;margin-left:auto"></div>';
|
|
888
891
|
h += "</div>";
|
|
889
892
|
|
|
890
893
|
h += '<div class="upload-result">';
|
|
@@ -945,6 +948,7 @@ function renderResult(r) {
|
|
|
945
948
|
h += "</div></div>";
|
|
946
949
|
|
|
947
950
|
root.innerHTML = h;
|
|
951
|
+
renderThemeToggle();
|
|
948
952
|
|
|
949
953
|
root.addEventListener("click", function handler(e) {
|
|
950
954
|
var el = e.target;
|
|
@@ -1080,6 +1084,7 @@ ${UPLOAD_CSS}
|
|
|
1080
1084
|
<div id="app"><div class="status">Preparing upload…</div></div>
|
|
1081
1085
|
|
|
1082
1086
|
<script>
|
|
1087
|
+
${SHARED_JS_ICONS}
|
|
1083
1088
|
${SHARED_JS_MCP_CLIENT}
|
|
1084
1089
|
${SHARED_JS_HELPERS}
|
|
1085
1090
|
${SHARED_JS_TOOLTIPS}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-upload-app.js","sourceRoot":"","sources":["../../../src/mcp-server/apps/asset-upload-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,UAAU,kBAAkB,CAAC,QAAiB;IAClD,OAAO,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,YAAY,CAAC,uBAAuB,CAE5D,CAAC;AACF,MAAM,YAAY,GAAG,YAAY,CAAC,4BAA4B,CAG7D,CAAC;AAEF,MAAM,mBAAmB,GAA4B;IACnD,GAAG,CAAC,gBAAgB,CAAC,UAAU,IAAI,EAAE,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;AACnC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;AACzB,mBAAmB,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAExD,uEAAuE;AACvE,MAAM,UAAU,GAAG,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"asset-upload-app.js","sourceRoot":"","sources":["../../../src/mcp-server/apps/asset-upload-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,o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3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/apps/config.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,MAAM,GAAG,eAAe,GAAG,eAAe,GAAG,cAAc,CAAC;AAExE,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAIrC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/apps/config.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,MAAM,GAAG,eAAe,GAAG,eAAe,GAAG,cAAc,CAAC;AAExE,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAIrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAkB,CAAC;AAEjE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBxD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAKnE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEvE"}
|
|
@@ -7,8 +7,7 @@ export const MCP_APPS = [
|
|
|
7
7
|
"asset-details",
|
|
8
8
|
"asset-upload",
|
|
9
9
|
];
|
|
10
|
-
|
|
11
|
-
export const DEFAULT_MCP_APPS = [];
|
|
10
|
+
export const DEFAULT_MCP_APPS = [...MCP_APPS];
|
|
12
11
|
export function parseMcpAppsList(value) {
|
|
13
12
|
const parts = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
14
13
|
// Bare `--mcp-apps` (empty value via inferEmpty) behaves like "all".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/mcp-server/apps/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,CAAC,MAAM,QAAQ,GAAsB;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,OAAO,KAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAA0B;IACvD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC/C,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/apps/extensions.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/apps/extensions.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAgE1C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,IAAI,CAwBN"}
|
|
@@ -50,7 +50,12 @@ function appResourceContent(uri, html) {
|
|
|
50
50
|
uri: uri.toString(),
|
|
51
51
|
mimeType: MCP_APP_MIME_TYPE,
|
|
52
52
|
text: html,
|
|
53
|
-
_meta: {
|
|
53
|
+
_meta: {
|
|
54
|
+
ui: {
|
|
55
|
+
csp: { resourceDomains: CSP_RESOURCE_DOMAINS },
|
|
56
|
+
permissions: { clipboardWrite: {} },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
54
59
|
// deno-lint-ignore no-explicit-any
|
|
55
60
|
}],
|
|
56
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/mcp-server/apps/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,oBAAoB,GAAG;IAC3B,4BAA4B;IAC5B,0BAA0B;CAC3B,CAAC;AAUF,MAAM,SAAS,GAAuB;IACpC;QACE,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,6FAA6F;QAC/F,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE;YAC/C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE;YAC/C,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE;YAC7C,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;SAClD;QACD,MAAM,EAAE,mBAAmB;KAC5B;IACD;QACE,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,4DAA4D;QACzE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QAC9D,MAAM,EAAE,mBAAmB;KAC5B;IACD;QACE,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE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E;gBACvD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;oBACjB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;wBAC9C,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;wBAC3B,IAAI,EAAE,KAAK;wBACX,QAAQ,EAAE,iBAAiB;qBAC5B,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;YACF,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;gBACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACxC,OAAO,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -23,7 +23,7 @@ async function startStreamableHTTP(cliFlags) {
|
|
|
23
23
|
app.use((req, res, next) => {
|
|
24
24
|
res.header("Access-Control-Allow-Origin", "*");
|
|
25
25
|
res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
26
|
-
res.header("Access-Control-Allow-Headers", "
|
|
26
|
+
res.header("Access-Control-Allow-Headers", "*");
|
|
27
27
|
if (req.method === "OPTIONS") {
|
|
28
28
|
res.sendStatus(204);
|
|
29
29
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl.js","sourceRoot":"","sources":["../../../../src/mcp-server/cli/serve/impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,cAA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AC,kBAAkB,CAAC,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;YACpB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACjC,CAAC"}
|
package/esm/mcp-server/server.js
CHANGED
|
@@ -32,7 +32,7 @@ import { tool$usageGetUsage } from "./tools/usageGetUsage.js";
|
|
|
32
32
|
export function createMCPServer(deps) {
|
|
33
33
|
const server = new McpServer({
|
|
34
34
|
name: "CloudinaryAssetMgmt",
|
|
35
|
-
version: "0.9.
|
|
35
|
+
version: "0.9.2",
|
|
36
36
|
});
|
|
37
37
|
const getClient = deps.getSDK || (() => new CloudinaryAssetMgmtCore({
|
|
38
38
|
security: deps.security,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchSearchAssets.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/searchSearchAssets.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"searchSearchAssets.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/searchSearchAssets.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,OAAO,IAAI,CAmF/D,CAAC"}
|
|
@@ -15,9 +15,53 @@ export const tool$searchSearchAssets = {
|
|
|
15
15
|
|
|
16
16
|
Returns a list of resources matching the specified search criteria.
|
|
17
17
|
|
|
18
|
-
Uses Lucene-like query language to
|
|
18
|
+
Uses a Lucene-like query language to filter assets by descriptive attributes (\`public_id\`, \`asset_id\`, \`filename\`, \`display_name\`, \`folder\` / \`asset_folder\`, \`tags\`, \`context.<key>\`), file details (\`resource_type\`, \`type\`, \`format\`, \`bytes\`, \`width\`, \`height\`, \`duration\`, \`pages\`, \`aspect_ratio\`, \`transparent\`, \`grayscale\`), lifecycle dates (\`uploaded_at\`, \`created_at\`, \`taken_at\`, \`updated_at\`, \`last_updated.<kind>\`), moderation and lifecycle state (\`status\`, \`moderation_status\`, \`moderation_kind\`), embedded data (\`image_metadata.*\`), structured metadata (\`metadata.<external_id>\`), and analysis fields (\`face_count\`, \`colors\`, \`quality_score\`, \`illustration_score\`, \`accessibility_analysis.*\`). Supports sorting, aggregate counts, and complex boolean expressions. See the \`expression\` parameter for the full field reference.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
## Expression syntax
|
|
21
|
+
|
|
22
|
+
- **Match**: \`field:value\` (token match) or \`field=value\` (exact match). Examples: \`tags:shirt\`, \`tags=cotton\`.
|
|
23
|
+
- **Comparisons**: \`>\`, \`<\`, \`>=\`, \`<=\` for numbers and dates. Example: \`bytes>10000000\`.
|
|
24
|
+
- **Ranges**: \`field:[from TO to]\` inclusive, \`field:{from TO to}\` exclusive. Example: \`width:{200 TO 1028}\`.
|
|
25
|
+
- **Booleans**: \`AND\`, \`OR\`, \`NOT\` (uppercase), or \`+\` (must), \`-\` (must not). \`NOT\` must appear between clauses — a bare leading \`NOT\` is a parse error; use \`-field:value\` to negate the first clause. Group with parentheses: \`(shirt OR pants) AND clothes\`.
|
|
26
|
+
- **Wildcards**: trailing \`*\` only, for prefix match (\`public_id:shoes_*\`, \`format:jp*\`, \`tags:shirt*\`). Not supported on \`folder\`, \`asset_folder\`, \`resource_type\`, or \`type\`. Leading \`*\`, middle \`*\`, \`?\`, and bare \`*\` (\`folder:*\`, \`context.alt:*\`) are all parse errors — wildcards cannot be used as a "field is present" probe.
|
|
27
|
+
- **Tokenized vs exact fields**: \`tags\`, \`filename\`, \`display_name\`, \`context.<key>\`, and \`metadata.<id>\` match on tokens split by whitespace and punctuation — \`tags:analysis\` matches the tag \`full-analysis\`. \`public_id\`, \`folder\`, \`asset_folder\`, and \`format\` match the whole value — \`public_id:dog\` will not match \`dog_pldcwy\`; use \`public_id="dog_pldcwy"\` (exact) or \`public_id:dog*\` (prefix). These exact-match fields still accept a trailing \`*\` for prefix match (except \`folder\` / \`asset_folder\`, where wildcards are ignored).
|
|
28
|
+
- **Dates**: ISO-8601 in quotes (\`uploaded_at>"2024-01-15"\`) or relative shorthand \`Nh\`, \`Nd\`, \`Nw\`, \`Nm\`, \`Ny\` (\`uploaded_at>1d\`, \`created_at:[4w TO 1w]\`). Send raw \`<\`/\`>\`, never HTML-escaped.
|
|
29
|
+
- **Quoting**: wrap any value containing a space, colon, or other reserved character (\`! ( ) { } [ ] ^ ~ ? \\ = & < > |\`) in double quotes, or escape each character with \`\\\`. Examples: \`tags:"service:mantels"\`, \`aspect_ratio:"16:9"\`, \`folder:"My Folder"\`.
|
|
30
|
+
|
|
31
|
+
## Common mistakes
|
|
32
|
+
|
|
33
|
+
- Use \`folder:\` or \`asset_folder:\` (singular); \`folders:\`, \`asset_folder_id:\`, and other invented variants are not valid fields. Pass the exact folder name — wildcards do not apply here.
|
|
34
|
+
- There is no "has any value" / presence probe. \`folder:*\`, \`metadata.alt:*\`, \`context.key:*\`, \`tags:*\`, and \`-tags:*\` are all parse errors. See *"Which assets have any value for \`metadata.<id>\`?"* under **Common tasks** for workarounds.
|
|
35
|
+
- \`NOT foo AND bar\` is a parse error. Write it as \`bar AND NOT foo\` or \`-foo AND bar\`, and keep every \`NOT\` between two clauses (\`a AND NOT b AND NOT c\` is fine; \`NOT b AND NOT c …\` is not).
|
|
36
|
+
- \`public_id:dog\` will not match \`dog_pldcwy\`. Use \`public_id="dog_pldcwy"\` (exact) or \`public_id:dog*\` (prefix).
|
|
37
|
+
- \`tags=service:mantels\` fails because the unquoted colon is parsed as a field separator. Use \`tags="service:mantels"\` or \`tags=service\\:mantels\`.
|
|
38
|
+
- Do not HTML-escape operators. Send \`uploaded_at<1h\`, not \`uploaded_at<1h\`.
|
|
39
|
+
- Do not leave an operand empty (e.g. \`tags: AND -tags:foo\`). Omit the empty clause entirely.
|
|
40
|
+
|
|
41
|
+
## Tips
|
|
42
|
+
|
|
43
|
+
- Set \`max_results: 0\` to return only \`total_count\` and \`aggregations\` without any resource payload — useful for counts and aggregation-only queries.
|
|
44
|
+
- \`total_count\` is always present in the response; prefer it over running an aggregation just to get a count.
|
|
45
|
+
- \`aggregate\` (both simple and range variants) and the \`metadata\`, \`image_metadata\`, \`image_analysis\` values of \`with_field\` require a Tier 2 search plan.
|
|
46
|
+
- Range aggregations require each range to include a \`key\` label (1–20 chars, \`[a-zA-Z0-9_-]+\`) and at least one of \`from\` / \`to\`.
|
|
47
|
+
|
|
48
|
+
## Common tasks
|
|
49
|
+
|
|
50
|
+
- **Count matching assets** — put the filter in \`expression\` with \`max_results: 0\` and read \`total_count\` from the response. Works on every tier; no \`aggregate\` needed.
|
|
51
|
+
- **Preview one matching asset** — set \`max_results: 1\`; add \`with_field: ["tags", "context"]\` (or \`metadata\`, Tier 2) to inspect values. Prefer this over fetching and scanning a full page.
|
|
52
|
+
- **Distribution of values for a field** — Tier 2: \`aggregate: [format|resource_type|type]\` for enum counts, or range aggregations on \`bytes\`, \`image_pixels\`, \`video_pixels\`, or \`duration\`. Tier 1 fallback: run N small queries with \`max_results: 0\`, one per candidate value, and read \`total_count\` from each.
|
|
53
|
+
- **"Which assets have any value for \`metadata.<id>\`?"** — not expressible directly (\`metadata.X:*\` is a parse error; there is no presence probe). Workarounds: (a) if the field has a known value set, enumerate — \`metadata.region:(apac OR emea OR amer)\`; (b) query broadly with \`with_field: ["metadata"]\` (Tier 2) and filter client-side for entries where the field is set; (c) at ingest time, attach a sentinel tag whenever the field is set, then search by that tag.
|
|
54
|
+
- **Newest / largest N** — keep the filter in \`expression\` and sort explicitly: \`sort_by: [{uploaded_at: "desc"}]\` with \`max_results: 10\`.
|
|
55
|
+
- **Filter by folder** — both \`asset_folder:"parent/child"\` and \`folder:"parent/child"\` match an exact folder path; there is no wildcard or "contains". To query across multiple folders, enumerate: \`asset_folder:("campaigns/2024" OR "campaigns/2025")\`.
|
|
56
|
+
- **Filter by metadata when you only know the label** — first call \`list-metadata-fields\` to resolve the label to an \`external_id\`, then query \`metadata.<external_id>:value\`.
|
|
57
|
+
- **Multiple independent filters in one turn** — prefer one \`expression\` with \`OR\` / parentheses over firing many parallel calls: \`metadata.region:apac OR metadata.region:emea\` in a single request is faster and more reliable than two parallel requests.
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
- \`tags:shirt AND uploaded_at>1d\`
|
|
62
|
+
- \`resource_type:image AND bytes>1000000 AND (format:png OR format:jpg)\`
|
|
63
|
+
- \`folder:products AND context.category:electronics\`
|
|
64
|
+
- \`tags:"service:mantels" AND -tags:discontinued\`
|
|
21
65
|
`,
|
|
22
66
|
scopes: ["librarian"],
|
|
23
67
|
annotations: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchSearchAssets.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/searchSearchAssets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA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E,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF,CAAC"}
|
|
@@ -15,6 +15,7 @@ export declare const Type$zodSchema: z.ZodEnum<{
|
|
|
15
15
|
video_pixels: "video_pixels";
|
|
16
16
|
}>;
|
|
17
17
|
export type SearchParametersRange = {
|
|
18
|
+
key: string;
|
|
18
19
|
from?: number | undefined;
|
|
19
20
|
to?: number | undefined;
|
|
20
21
|
};
|
|
@@ -36,7 +37,9 @@ export declare const AggregateEnum$zodSchema: z.ZodEnum<{
|
|
|
36
37
|
resource_type: "resource_type";
|
|
37
38
|
}>;
|
|
38
39
|
/**
|
|
39
|
-
* Fields or ranges to aggregate search results by.
|
|
40
|
+
* Fields or ranges to aggregate search results by. Requires a Tier 2 search plan; on Tier 1 the field is accepted but aggregations are omitted from the response.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
40
43
|
*/
|
|
41
44
|
export type AggregateUnion = Array<AggregateEnum> | Array<Aggregate>;
|
|
42
45
|
export declare const AggregateUnion$zodSchema: z.ZodType<AggregateUnion>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchparameters.d.ts","sourceRoot":"","sources":["../../src/models/searchparameters.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAC;AAE5E,eAAO,MAAM,IA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GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAE7D,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAErE,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAK9D,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;CAQZ,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAErD,eAAO,MAAM,mBAAmB;;;;;;;;EAQ9B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAChE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CA4BJ,CAAC"}
|
|
@@ -17,11 +17,12 @@ export const Type$zodSchema = z.enum([
|
|
|
17
17
|
"duration",
|
|
18
18
|
]);
|
|
19
19
|
export const SearchParametersRange$zodSchema = z.object({
|
|
20
|
-
from: z.number().optional().describe("Start of the range (inclusive)"),
|
|
21
|
-
|
|
20
|
+
from: z.number().optional().describe("Start of the range (inclusive). At least one of `from` / `to` is required."),
|
|
21
|
+
key: z.string().describe("A label for the bucket, returned in the aggregation response. 1–20 chars, alphanumeric plus `-` and `_`."),
|
|
22
|
+
to: z.number().optional().describe("End of the range (exclusive). At least one of `from` / `to` is required."),
|
|
22
23
|
});
|
|
23
24
|
export const Aggregate$zodSchema = z.object({
|
|
24
|
-
ranges: z.array(z.lazy(() => SearchParametersRange$zodSchema)),
|
|
25
|
+
ranges: z.array(z.lazy(() => SearchParametersRange$zodSchema)).describe("One or more ranges for the numeric field. Each range must include a `key` label and at least one of `from` / `to`.\n"),
|
|
25
26
|
type: Type$zodSchema,
|
|
26
27
|
});
|
|
27
28
|
export const AggregateEnum = {
|
|
@@ -37,7 +38,7 @@ export const AggregateEnum$zodSchema = z.enum([
|
|
|
37
38
|
export const AggregateUnion$zodSchema = z.union([
|
|
38
39
|
z.array(AggregateEnum$zodSchema),
|
|
39
40
|
z.array(z.lazy(() => Aggregate$zodSchema)),
|
|
40
|
-
]).describe("Fields or ranges to aggregate search results by.");
|
|
41
|
+
]).describe("Fields or ranges to aggregate search results by. Requires a Tier 2 search plan; on Tier 1 the field is accepted but aggregations are omitted from the response.\n");
|
|
41
42
|
export const WithField = {
|
|
42
43
|
Context: "context",
|
|
43
44
|
Tags: "tags",
|
|
@@ -60,13 +61,13 @@ export const SearchParameters$zodSchema = z.object({
|
|
|
60
61
|
aggregate: z.union([
|
|
61
62
|
z.array(AggregateEnum$zodSchema),
|
|
62
63
|
z.array(z.lazy(() => Aggregate$zodSchema)),
|
|
63
|
-
]).optional().describe("Fields or ranges to aggregate search results by."),
|
|
64
|
-
expression: z.string().optional().describe("The search expression. Supports
|
|
64
|
+
]).optional().describe("Fields or ranges to aggregate search results by. Requires a Tier 2 search plan; on Tier 1 the field is accepted but aggregations are omitted from the response.\n"),
|
|
65
|
+
expression: z.string().optional().describe("The Lucene-like search expression. Supports token match (`:`), exact match (`=`), trailing `*` for prefix match, ranges (`[a TO b]`, `{a TO b}`), and comparisons (`>`, `<`, `>=`, `<=`). Combine terms with uppercase `AND`, `OR`, `NOT`, or `+`/`-`. `NOT` must appear between clauses — a leading `NOT` is a parse error; use `-field:value` to negate the first clause. Group with parentheses.\n\nWrap values containing spaces, colons, or other reserved characters (`! ( ) { } [ ] ^ ~ ? \\ = & < > |`) in double quotes, e.g. `tags:\"service:mantels\"`, `aspect_ratio:\"16:9\"`. Send raw `<`/`>`, never HTML-escaped.\n\nWildcards are prefix-only (trailing `*`). A bare `*` (e.g. `folder:*`, `context.alt:*`, `metadata.key:*`, `tags:*`, `-tags:*`) is a parse error — there is no \"has any value\" / presence probe. Either drop the clause, use a concrete prefix, or filter on a known token.\n\nDates: ISO-8601 in quotes, or relative shorthand `1h`, `1d`, `1w`, `1m`, `1y` (`uploaded_at>1d`, `created_at:[4w TO 1w]`).\n\nSupported fields: `public_id`, `asset_id`, `filename`, `display_name`, `folder` / `asset_folder` (singular, not `folders`), `tags`, `context.<key>`, `metadata.<external_id>`, `resource_type`, `type`, `format`, `bytes`, `width`, `height`, `duration`, `pages`, `aspect_ratio`, `transparent`, `grayscale`, `status`, `moderation_status`, `moderation_kind`, `uploaded_at`, `created_at`, `taken_at`, `updated_at`, `last_updated.<kind>`, `face_count`, `illustration_score`, `quality_score`. Fields under `image_metadata.*`, `image_analysis.*`, `quality_analysis.*`, and `accessibility_analysis.*` also require the matching `with_field` to be returned in the response.\n\nSee the [search expressions guide](https://cloudinary.com/documentation/search_expressions.md) for the full reference.\n"),
|
|
65
66
|
fields: z.string().optional().describe("A comma-separated list of fields to include in the response.\nNotes:\n- This parameter takes precedence over the with_field parameter, so if you want any additional asset attributes returned, make sure to also include them in this list (e.g., tags or context).\n- The following fields are always included in the response: public_id, asset_id, asset_folder, created_at, status, type, and resource_type.\n"),
|
|
66
|
-
max_results: z.int().optional().describe("The maximum number of results to return. Default - 50. Maximum - 500
|
|
67
|
+
max_results: z.int().optional().describe("The maximum number of results to return. Default - 50. Maximum - 500.\nSet to `0` to get only `total_count` and `aggregations` without any resources in the response — useful for counting or aggregation-only queries.\n"),
|
|
67
68
|
next_cursor: z.string().optional().describe("The cursor value to get the next page of results. Available when a previous search returned more results than max_results."),
|
|
68
69
|
sort_by: z.array(z.record(z.string(), DirectionEnum$zodSchema)).optional()
|
|
69
70
|
.describe("An array of single-key objects mapping a field to a sort direction. Each object must contain exactly one field name mapped to 'asc' or 'desc'.\nDefault: [{\"created_at\": \"desc\"}].\n"),
|
|
70
|
-
with_field: z.array(WithField$zodSchema).optional().describe("The additional
|
|
71
|
+
with_field: z.array(WithField$zodSchema).optional().describe("The additional asset attributes to include in each search result. The `fields` parameter takes precedence over this parameter. `image_metadata`, `image_analysis`, and `metadata` require a Tier 2 search plan.\n"),
|
|
71
72
|
}).describe("Common parameters for resource search operations.");
|
|
72
73
|
//# sourceMappingURL=searchparameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchparameters.js","sourceRoot":"","sources":["../../src/models/searchparameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAiB,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,UAAU;CACZ,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,OAAO;IACP,cAAc;IACd,cAAc;IACd,UAAU;CACX,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"searchparameters.js","sourceRoot":"","sources":["../../src/models/searchparameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAiB,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,uBAAuB,CAAC,CAAC,CAAC,QAAQ,EAAE;SACvE,QAAQ,CACP,0LAA0L,CAC3L;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC1D,mNAAmN,CACpN;CACF,CACF,CAAC,QAAQ,CAAC,mDAAmD,CAAC,CAAC"}
|
package/esm/tool-names.js
CHANGED
|
@@ -78,7 +78,7 @@ export const toolNames = [
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"name": "search-assets",
|
|
81
|
-
"description": "Provides a powerful query interface to filter and retrieve assets and their details\n\nReturns a list of resources matching the specified search criteria.\n\nUses Lucene-like query language to
|
|
81
|
+
"description": "Provides a powerful query interface to filter and retrieve assets and their details\n\nReturns a list of resources matching the specified search criteria.\n\nUses a Lucene-like query language to filter assets by descriptive attributes (`public_id`, `asset_id`, `filename`, `display_name`, `folder` / `asset_folder`, `tags`, `context.<key>`), file details (`resource_type`, `type`, `format`, `bytes`, `width`, `height`, `duration`, `pages`, `aspect_ratio`, `transparent`, `grayscale`), lifecycle dates (`uploaded_at`, `created_at`, `taken_at`, `updated_at`, `last_updated.<kind>`), moderation and lifecycle state (`status`, `moderation_status`, `moderation_kind`), embedded data (`image_metadata.*`), structured metadata (`metadata.<external_id>`), and analysis fields (`face_count`, `colors`, `quality_score`, `illustration_score`, `accessibility_analysis.*`). Supports sorting, aggregate counts, and complex boolean expressions. See the `expression` parameter for the full field reference.\n\n## Expression syntax\n\n- **Match**: `field:value` (token match) or `field=value` (exact match). Examples: `tags:shirt`, `tags=cotton`.\n- **Comparisons**: `>`, `<`, `>=`, `<=` for numbers and dates. Example: `bytes>10000000`.\n- **Ranges**: `field:[from TO to]` inclusive, `field:{from TO to}` exclusive. Example: `width:{200 TO 1028}`.\n- **Booleans**: `AND`, `OR`, `NOT` (uppercase), or `+` (must), `-` (must not). `NOT` must appear between clauses — a bare leading `NOT` is a parse error; use `-field:value` to negate the first clause. Group with parentheses: `(shirt OR pants) AND clothes`.\n- **Wildcards**: trailing `*` only, for prefix match (`public_id:shoes_*`, `format:jp*`, `tags:shirt*`). Not supported on `folder`, `asset_folder`, `resource_type`, or `type`. Leading `*`, middle `*`, `?`, and bare `*` (`folder:*`, `context.alt:*`) are all parse errors — wildcards cannot be used as a \"field is present\" probe.\n- **Tokenized vs exact fields**: `tags`, `filename`, `display_name`, `context.<key>`, and `metadata.<id>` match on tokens split by whitespace and punctuation — `tags:analysis` matches the tag `full-analysis`. `public_id`, `folder`, `asset_folder`, and `format` match the whole value — `public_id:dog` will not match `dog_pldcwy`; use `public_id=\"dog_pldcwy\"` (exact) or `public_id:dog*` (prefix). These exact-match fields still accept a trailing `*` for prefix match (except `folder` / `asset_folder`, where wildcards are ignored).\n- **Dates**: ISO-8601 in quotes (`uploaded_at>\"2024-01-15\"`) or relative shorthand `Nh`, `Nd`, `Nw`, `Nm`, `Ny` (`uploaded_at>1d`, `created_at:[4w TO 1w]`). Send raw `<`/`>`, never HTML-escaped.\n- **Quoting**: wrap any value containing a space, colon, or other reserved character (`! ( ) { } [ ] ^ ~ ? \\ = & < > |`) in double quotes, or escape each character with `\\`. Examples: `tags:\"service:mantels\"`, `aspect_ratio:\"16:9\"`, `folder:\"My Folder\"`.\n\n## Common mistakes\n\n- Use `folder:` or `asset_folder:` (singular); `folders:`, `asset_folder_id:`, and other invented variants are not valid fields. Pass the exact folder name — wildcards do not apply here.\n- There is no \"has any value\" / presence probe. `folder:*`, `metadata.alt:*`, `context.key:*`, `tags:*`, and `-tags:*` are all parse errors. See *\"Which assets have any value for `metadata.<id>`?\"* under **Common tasks** for workarounds.\n- `NOT foo AND bar` is a parse error. Write it as `bar AND NOT foo` or `-foo AND bar`, and keep every `NOT` between two clauses (`a AND NOT b AND NOT c` is fine; `NOT b AND NOT c …` is not).\n- `public_id:dog` will not match `dog_pldcwy`. Use `public_id=\"dog_pldcwy\"` (exact) or `public_id:dog*` (prefix).\n- `tags=service:mantels` fails because the unquoted colon is parsed as a field separator. Use `tags=\"service:mantels\"` or `tags=service\\:mantels`.\n- Do not HTML-escape operators. Send `uploaded_at<1h`, not `uploaded_at<1h`.\n- Do not leave an operand empty (e.g. `tags: AND -tags:foo`). Omit the empty clause entirely.\n\n## Tips\n\n- Set `max_results: 0` to return only `total_count` and `aggregations` without any resource payload — useful for counts and aggregation-only queries.\n- `total_count` is always present in the response; prefer it over running an aggregation just to get a count.\n- `aggregate` (both simple and range variants) and the `metadata`, `image_metadata`, `image_analysis` values of `with_field` require a Tier 2 search plan.\n- Range aggregations require each range to include a `key` label (1–20 chars, `[a-zA-Z0-9_-]+`) and at least one of `from` / `to`.\n\n## Common tasks\n\n- **Count matching assets** — put the filter in `expression` with `max_results: 0` and read `total_count` from the response. Works on every tier; no `aggregate` needed.\n- **Preview one matching asset** — set `max_results: 1`; add `with_field: [\"tags\", \"context\"]` (or `metadata`, Tier 2) to inspect values. Prefer this over fetching and scanning a full page.\n- **Distribution of values for a field** — Tier 2: `aggregate: [format|resource_type|type]` for enum counts, or range aggregations on `bytes`, `image_pixels`, `video_pixels`, or `duration`. Tier 1 fallback: run N small queries with `max_results: 0`, one per candidate value, and read `total_count` from each.\n- **\"Which assets have any value for `metadata.<id>`?\"** — not expressible directly (`metadata.X:*` is a parse error; there is no presence probe). Workarounds: (a) if the field has a known value set, enumerate — `metadata.region:(apac OR emea OR amer)`; (b) query broadly with `with_field: [\"metadata\"]` (Tier 2) and filter client-side for entries where the field is set; (c) at ingest time, attach a sentinel tag whenever the field is set, then search by that tag.\n- **Newest / largest N** — keep the filter in `expression` and sort explicitly: `sort_by: [{uploaded_at: \"desc\"}]` with `max_results: 10`.\n- **Filter by folder** — both `asset_folder:\"parent/child\"` and `folder:\"parent/child\"` match an exact folder path; there is no wildcard or \"contains\". To query across multiple folders, enumerate: `asset_folder:(\"campaigns/2024\" OR \"campaigns/2025\")`.\n- **Filter by metadata when you only know the label** — first call `list-metadata-fields` to resolve the label to an `external_id`, then query `metadata.<external_id>:value`.\n- **Multiple independent filters in one turn** — prefer one `expression` with `OR` / parentheses over firing many parallel calls: `metadata.region:apac OR metadata.region:emea` in a single request is faster and more reliable than two parallel requests.\n\n## Examples\n\n- `tags:shirt AND uploaded_at>1d`\n- `resource_type:image AND bytes>1000000 AND (format:png OR format:jpg)`\n- `folder:products AND context.category:electronics`\n- `tags:\"service:mantels\" AND -tags:discontinued`\n"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"name": "visual-search-assets",
|
package/esm/tool-names.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-names.js","sourceRoot":"","sources":["../src/tool-names.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAgD;IACpE;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,y7BAAy7B;KACz8B;IACD;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,6GAA6G;KAC7H;IACD;QACE,MAAM,EAAE,kBAAkB;QAC1B,aAAa,EAAE,6LAA6L;KAC7M;IACD;QACE,MAAM,EAAE,uBAAuB;QAC/B,aAAa,EAAE,oCAAoC;KACpD;IACD;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,8EAA8E;KAC9F;IACD;QACE,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,gJAAgJ;KAChK;IACD;QACE,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,gJAAgJ;KAChK;IACD;QACE,MAAM,EAAE,YAAY;QACpB,aAAa,EAAE,4IAA4I;KAC5J;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,aAAa,EAAE,iGAAiG;KACjH;IACD;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,qbAAqb;KACrc;IACD;QACE,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,kSAAkS;KAClT;IACD;QACE,MAAM,EAAE,uBAAuB;QAC/B,aAAa,EAAE,8EAA8E;KAC9F;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,aAAa,EAAE,wQAAwQ;KACxR;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,aAAa,EAAE,oeAAoe;KACpf;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,aAAa,EAAE,+VAA+V;KAC/W;IACD;QACE,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,0NAA0N;KAC1O;IACD;QACE,MAAM,EAAE,eAAe;QACvB,aAAa,EAAE,2GAA2G;KAC3H;IACD;QACE,MAAM,EAAE,eAAe;QACvB,aAAa,EAAE,kGAAkG;KAClH;IACD;QACE,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,4QAA4Q;KAC5R;IACD;QACE,MAAM,EAAE,eAAe;QACvB,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"tool-names.js","sourceRoot":"","sources":["../src/tool-names.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAgD;IACpE;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,y7BAAy7B;KACz8B;IACD;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,6GAA6G;KAC7H;IACD;QACE,MAAM,EAAE,kBAAkB;QAC1B,aAAa,EAAE,6LAA6L;KAC7M;IACD;QACE,MAAM,EAAE,uBAAuB;QAC/B,aAAa,EAAE,oCAAoC;KACpD;IACD;QACE,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,8EAA8E;KAC9F;IACD;QACE,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,gJAAgJ;KAChK;IACD;QACE,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,gJAAgJ;KAChK;IACD;QACE,MAAM,EAAE,YAAY;QACpB,aAAa,EAAE,4IAA4I;KAC5J;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,aAAa,EAAE,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
|
|
1
|
+
{"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,wBAAgB,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAiBnD;AAED,wBAAgB,cAAc,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAmBvE;AAED,wBAAgB,cAAc,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAkBlE;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAqBpE"}
|
package/esm/types/bigint.js
CHANGED
|
@@ -23,7 +23,8 @@ export function bigint() {
|
|
|
23
23
|
]);
|
|
24
24
|
}
|
|
25
25
|
export function bigintOptional() {
|
|
26
|
-
return z
|
|
26
|
+
return z
|
|
27
|
+
.union([
|
|
27
28
|
z.bigint().transform((v) => String(v)),
|
|
28
29
|
z.string().transform((v, ctx) => {
|
|
29
30
|
try {
|
|
@@ -38,9 +39,9 @@ export function bigintOptional() {
|
|
|
38
39
|
}
|
|
39
40
|
}),
|
|
40
41
|
z.number().transform((v) => BigInt(Math.trunc(v))),
|
|
41
|
-
z.undefined(),
|
|
42
42
|
z.null().transform(() => undefined),
|
|
43
|
-
])
|
|
43
|
+
])
|
|
44
|
+
.optional();
|
|
44
45
|
}
|
|
45
46
|
export function bigintNullable() {
|
|
46
47
|
return z.union([
|
package/esm/types/bigint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigint.js","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,UAAU,M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