Skip to content

Commit 8c543a3

Browse files
Merge pull request #141 from asklar/user/asklar/single-size-per-icon
fix: update icon size property from 'sizes' to 'size'
2 parents 406e7bb + bc2d083 commit 8c543a3

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

MANIFEST.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ A full `manifest.json` with most of the optional fields looks like this:
9393
"icons": [
9494
{
9595
"src": "assets/icons/icon-16-light.png",
96-
"sizes": "16x16",
96+
"size": "16x16",
9797
"theme": "light"
9898
},
9999
{
100100
"src": "assets/icons/icon-16-dark.png",
101-
"sizes": "16x16",
101+
"size": "16x16",
102102
"theme": "dark"
103103
}
104104
],
@@ -237,7 +237,7 @@ A full `manifest.json` with most of the optional fields looks like this:
237237
### Optional Fields
238238

239239
- **icon**: Path to a png icon file, either relative in the package or a `https://` url.
240-
- **icons**: Array of icon descriptors (`src`, `sizes`, optional `theme`) for light/dark or size-specific assets.
240+
- **icons**: Array of icon descriptors (`src`, `size`, optional `theme`) for light/dark or size-specific assets.
241241
- 🌎 **display_name**: Human-friendly name for UI display. This field is localizable.
242242
- 🌎 **long_description**: Detailed description for extension stores, markdown. This field is localizable.
243243
- **repository**: Source code repository information (type and url).
@@ -288,12 +288,12 @@ Use the `icons` array when you need multiple icon variants (different sizes or t
288288

289289
```json
290290
"icons": [
291-
{ "src": "assets/icons/icon-16-light.png", "sizes": "16x16", "theme": "light" },
292-
{ "src": "assets/icons/icon-16-dark.png", "sizes": "16x16", "theme": "dark" }
291+
{ "src": "assets/icons/icon-16-light.png", "size": "16x16", "theme": "light" },
292+
{ "src": "assets/icons/icon-16-dark.png", "size": "16x16", "theme": "dark" }
293293
]
294294
```
295295

296-
- `sizes` must be in `WIDTHxHEIGHT` form (e.g., `128x128`).
296+
- `size` must be in `WIDTHxHEIGHT` form (e.g., `128x128`).
297297
- `theme` is optional; use values like `light`, `dark`, or platform-specific labels (e.g., `high-contrast`).
298298
- The legacy `icon` field remains supported for single assets—clients use it when `icons` is omitted.
299299

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@anthropic-ai/mcpb",
33
"description": "Tools for building MCP Bundles",
4-
"version": "1.1.4",
4+
"version": "1.1.5",
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.js",
@@ -99,4 +99,4 @@
9999
"@babel/parser": "7.27.3"
100100
},
101101
"packageManager": "[email protected]+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
102-
}
102+
}

schemas/mcpb-manifest-latest.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"src": {
8989
"type": "string"
9090
},
91-
"sizes": {
91+
"size": {
9292
"type": "string",
9393
"pattern": "^\\d+x\\d+$"
9494
},
@@ -99,7 +99,7 @@
9999
},
100100
"required": [
101101
"src",
102-
"sizes"
102+
"size"
103103
],
104104
"additionalProperties": false
105105
}

schemas/mcpb-manifest-v0.3.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"src": {
8989
"type": "string"
9090
},
91-
"sizes": {
91+
"size": {
9292
"type": "string",
9393
"pattern": "^\\d+x\\d+$"
9494
},
@@ -99,7 +99,7 @@
9999
},
100100
"required": [
101101
"src",
102-
"sizes"
102+
"size"
103103
],
104104
"additionalProperties": false
105105
}

src/cli/init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ export async function promptVisualAssets() {
456456

457457
const icons: Array<{
458458
src: string;
459-
sizes: string;
459+
size: string;
460460
theme?: string;
461461
}> = [];
462462

@@ -472,7 +472,7 @@ export async function promptVisualAssets() {
472472
},
473473
});
474474

475-
const iconSizes = await input({
475+
const iconSize = await input({
476476
message: "Icon size (e.g., 16x16):",
477477
validate: (value) => {
478478
if (!value.trim()) return "Icon size is required";
@@ -490,7 +490,7 @@ export async function promptVisualAssets() {
490490

491491
icons.push({
492492
src: iconSrc,
493-
sizes: iconSizes,
493+
size: iconSize,
494494
...(iconTheme.trim() ? { theme: iconTheme.trim() } : {}),
495495
});
496496

@@ -825,7 +825,7 @@ export function buildManifest(
825825
icon: string;
826826
icons: Array<{
827827
src: string;
828-
sizes: string;
828+
size: string;
829829
theme?: string;
830830
}>;
831831
screenshots: string[];

src/schemas/0.3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ export const McpbManifestLocalizationSchema = z.strictObject({
9898

9999
export const McpbManifestIconSchema = z.strictObject({
100100
src: z.string(),
101-
sizes: z
101+
size: z
102102
.string()
103103
.regex(
104104
ICON_SIZE_REGEX,
105-
'sizes must be in the format "WIDTHxHEIGHT" (e.g., "16x16")',
105+
'size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")',
106106
),
107107
theme: z.string().min(1, "theme cannot be empty when provided").optional(),
108108
});

src/schemas_loose/0.3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export const McpbManifestLocalizationSchema = z
102102
export const McpbManifestIconSchema = z
103103
.object({
104104
src: z.string(),
105-
sizes: z
105+
size: z
106106
.string()
107107
.regex(
108108
ICON_SIZE_REGEX,
109-
'sizes must be in the format "WIDTHxHEIGHT" (e.g., "16x16")',
109+
'size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")',
110110
),
111111
theme: z.string().min(1).optional(),
112112
})

test/init.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ describe("init functions", () => {
263263
icons: [
264264
{
265265
src: "assets/icons/icon-16-light.png",
266-
sizes: "16x16",
266+
size: "16x16",
267267
theme: "light",
268268
},
269269
{
270270
src: "assets/icons/icon-16-dark.png",
271-
sizes: "16x16",
271+
size: "16x16",
272272
theme: "dark",
273273
},
274274
],
@@ -341,12 +341,12 @@ describe("init functions", () => {
341341
icons: [
342342
{
343343
src: "assets/icons/icon-16-light.png",
344-
sizes: "16x16",
344+
size: "16x16",
345345
theme: "light",
346346
},
347347
{
348348
src: "assets/icons/icon-16-dark.png",
349-
sizes: "16x16",
349+
size: "16x16",
350350
theme: "dark",
351351
},
352352
],

test/schemas.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ describe("McpbManifestSchema", () => {
7676
icons: [
7777
{
7878
src: "assets/icons/icon-16-light.png",
79-
sizes: "16x16",
79+
size: "16x16",
8080
theme: "light",
8181
},
8282
{
8383
src: "assets/icons/icon-16-dark.png",
84-
sizes: "16x16",
84+
size: "16x16",
8585
theme: "dark",
8686
},
8787
],
@@ -320,7 +320,7 @@ describe("McpbManifestSchema", () => {
320320
it("rejects icons with invalid size format", () => {
321321
const manifest = {
322322
...base,
323-
icons: [{ src: "assets/icon.png", sizes: "16", theme: "light" }],
323+
icons: [{ src: "assets/icon.png", size: "16", theme: "light" }],
324324
};
325325
const result = McpbManifestSchema.safeParse(manifest);
326326
expect(result.success).toBe(false);
@@ -329,7 +329,7 @@ describe("McpbManifestSchema", () => {
329329
it("allows icons without theme", () => {
330330
const manifest = {
331331
...base,
332-
icons: [{ src: "assets/icon.png", sizes: "128x128" }],
332+
icons: [{ src: "assets/icon.png", size: "128x128" }],
333333
};
334334
const result = McpbManifestSchema.safeParse(manifest);
335335
expect(result.success).toBe(true);

0 commit comments

Comments
 (0)