MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / promptVisualAssets

Function promptVisualAssets

src/cli/init.ts:445–534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

443}
444
445export async function promptVisualAssets() {
446 const icon = await input({
447 message: "Icon file path (optional, relative to manifest):",
448 validate: (value) => {
449 if (!value.trim()) return true;
450 if (value.includes("..")) return "Relative paths cannot include '..'";
451 return true;
452 },
453 });
454
455 const addIconVariants = await confirm({
456 message: "Add theme/size-specific icons array?",
457 default: false,
458 });
459
460 const icons: Array<{
461 src: string;
462 size: string;
463 theme?: string;
464 }> = [];
465
466 if (addIconVariants) {
467 let addMoreIcons = true;
468 while (addMoreIcons) {
469 const iconSrc = await input({
470 message: "Icon source path (relative to manifest):",
471 validate: (value) => {
472 if (!value.trim()) return "Icon path is required";
473 if (value.includes("..")) return "Relative paths cannot include '..'";
474 return true;
475 },
476 });
477
478 const iconSize = await input({
479 message: "Icon size (e.g., 16x16):",
480 validate: (value) => {
481 if (!value.trim()) return "Icon size is required";
482 if (!/^\d+x\d+$/.test(value)) {
483 return "Icon size must be in WIDTHxHEIGHT format (e.g., 128x128)";
484 }
485 return true;
486 },
487 });
488
489 const iconTheme = await input({
490 message: "Icon theme (light, dark, or custom - optional):",
491 default: "",
492 });
493
494 icons.push({
495 src: iconSrc,
496 size: iconSize,
497 ...(iconTheme.trim() ? { theme: iconTheme.trim() } : {}),
498 });
499
500 addMoreIcons = await confirm({
501 message: "Add another icon entry?",
502 default: false,

Callers 1

initExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…