From e7282946b67ebd8f1ecd0426d49818863d9eb701 Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Wed, 29 Oct 2025 16:51:27 -0700 Subject: [PATCH] fix: lint errors - remove unused import and format files - Remove unused McpbManifestSchema import from types.ts - Run prettier on modified files --- CONTRIBUTING.md | 3 +++ MANIFEST.md | 22 +++++++++++----------- package.json | 2 +- src/schemas/0.1.ts | 2 +- src/types.ts | 7 +++---- test/schemas.test.ts | 1 - test/valid-manifest-0.2.json | 36 +++++++++++++++++------------------- test/valid-manifest.json | 6 ++---- 8 files changed, 38 insertions(+), 41 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cf9d8e8..7b19f2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,7 @@ To set up commit signing, see [GitHub's documentation on commit signature verifi ### Bug Reports When filing a bug report, please include: + - Clear description of the issue - Steps to reproduce - Expected vs actual behavior @@ -55,6 +56,7 @@ When filing a bug report, please include: ### Feature Requests We welcome feature suggestions! Please: + - Clearly describe the feature and use case - Explain why this would be valuable to users - Consider if it aligns with the project's goals @@ -62,6 +64,7 @@ We welcome feature suggestions! Please: ### Code Contributions We especially welcome: + - Bug fixes - Documentation improvements - Test coverage improvements diff --git a/MANIFEST.md b/MANIFEST.md index 837cee8..bedc65e 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -17,7 +17,7 @@ A basic `manifest.json` with just the required fields looks like this: "description": "A simple MCP extension", // Brief description of what the extension does "author": { // Author information (required) - "name": "Extension Author" // Author's name (required field) + "name": "Extension Author", // Author's name (required field) }, "server": { // Server configuration (required) @@ -28,10 +28,10 @@ A basic `manifest.json` with just the required fields looks like this: "command": "node", // Command to run the server "args": [ // Arguments passed to the command - "${__dirname}/server/index.js" // ${__dirname} is replaced with the extension's directory - ] - } - } + "${__dirname}/server/index.js", // ${__dirname} is replaced with the extension's directory + ], + }, + }, } ``` @@ -212,12 +212,12 @@ A full `manifest.json` with most of the optional fields looks like this: "type": "string" } } - }, + } } } ] } - }, + } } } } @@ -254,7 +254,7 @@ A full `manifest.json` with most of the optional fields looks like this: - **privacy_policies**: Array of URLs to privacy policies for external services that handle user data. Required when the extension connects to external services (first- or third-party) that process user data. Each URL should link to the respective service's privacy policy document. - **compatibility**: Compatibility requirements (client app version, platforms, and runtime versions). - **user_config**: User-configurable options for the extension (see User Configuration section). -- **_meta**: Platform-specific client integration metadata (e.g., Windows `package_family_name`, macOS bundle identifiers) enabling tighter OS/app store integration. The keys in the `_meta` object are reverse-DNS namespaced, and the values are a dictionary of platform-specific metadata. +- **\_meta**: Platform-specific client integration metadata (e.g., Windows `package_family_name`, macOS bundle identifiers) enabling tighter OS/app store integration. The keys in the `_meta` object are reverse-DNS namespaced, and the values are a dictionary of platform-specific metadata. - **localization**: Location of translated strings for user-facing fields (`resources` path containing a `${locale}` placeholder and `default_locale`). ### Localization @@ -268,15 +268,16 @@ Provide localized strings without bloating the manifest by pointing to external } ``` -- `resources` must include a `${locale}` placeholder. Clients resolve it relative to the server install directory. +- `resources` must include a `${locale}` placeholder. Clients resolve it relative to the server install directory. - This property is optional, and its default value is **`mcpb-resources/${locale}.json`**. - `default_locale` must be a valid [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) identifier such as `en-US` or `zh-Hans`. - This property is optional, and its default value is `en-US`. - Values for the default locale stay in the main manifest; localized files only need to contain overrides. -For tools and prompts, the descriptions are also localizable. +For tools and prompts, the descriptions are also localizable. #### Client guidelines + - if a client wants to show tool or prompt descriptions in their UI, the client should look for the locale-specific description override in the corresponding per-locale file. - clients should only look for tools/prompts present in the manifest.json, i.e. prompts and tools that only exist in the per-locale file should be ignored. - Clients should apply locale fallbacks if the client/user locale is not represented by the server. For example, if the user is in the `es-UY` locale but the server does not include that per-locale file, the client should look for an approrpiate fallback, e.g. `es-MX` or `es-ES`, or fall back to the values in the manifest. @@ -712,4 +713,3 @@ The `_generated` fields: - **prompts_generated**: Server generates additional prompts beyond those listed (default: false) This helps implementing apps understand that querying the server at runtime will reveal more capabilities than what's declared in the manifest. - diff --git a/package.json b/package.json index 68b3148..051d638 100644 --- a/package.json +++ b/package.json @@ -99,4 +99,4 @@ "@babel/parser": "7.27.3" }, "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f" -} \ No newline at end of file +} diff --git a/src/schemas/0.1.ts b/src/schemas/0.1.ts index 3ff5453..4d77ccc 100644 --- a/src/schemas/0.1.ts +++ b/src/schemas/0.1.ts @@ -98,7 +98,7 @@ export const McpbManifestSchema = z screenshots: z.array(z.string()).optional(), server: McpbManifestServerSchema, tools: z.array(McpbManifestToolSchema).optional(), - tools_generated: z.boolean().optional(), + tools_generated: z.boolean().optional(), prompts: z.array(McpbManifestPromptSchema).optional(), prompts_generated: z.boolean().optional(), keywords: z.array(z.string()).optional(), diff --git a/src/types.ts b/src/types.ts index 23c2061..852d52c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,8 @@ import type * as z from "zod"; +import type { McpbManifestSchema as McpbManifestSchema_v0_1 } from "./schemas/0.1.js"; +import type { McpbManifestSchema as McpbManifestSchema_v0_2 } from "./schemas/0.2.js"; +import type { McpbManifestSchema as McpbManifestSchema_v0_3 } from "./schemas/0.3.js"; import type { McpbManifestAuthorSchema, McpbManifestCompatibilitySchema, @@ -7,7 +10,6 @@ import type { McpbManifestPlatformOverrideSchema, McpbManifestPromptSchema, McpbManifestRepositorySchema, - McpbManifestSchema, McpbManifestServerSchema, McpbManifestToolSchema, McpbSignatureInfoSchema, @@ -15,9 +17,6 @@ import type { McpbUserConfigValuesSchema, McpServerConfigSchema, } from "./schemas/latest.js"; -import type { McpbManifestSchema as McpbManifestSchema_v0_1 } from "./schemas/0.1.js"; -import type { McpbManifestSchema as McpbManifestSchema_v0_2 } from "./schemas/0.2.js"; -import type { McpbManifestSchema as McpbManifestSchema_v0_3 } from "./schemas/0.3.js"; export type McpServerConfig = z.infer; diff --git a/test/schemas.test.ts b/test/schemas.test.ts index 325af17..d05551a 100644 --- a/test/schemas.test.ts +++ b/test/schemas.test.ts @@ -335,5 +335,4 @@ describe("McpbManifestSchema", () => { expect(result.success).toBe(true); }); }); - }); diff --git a/test/valid-manifest-0.2.json b/test/valid-manifest-0.2.json index c6f5fdb..51130df 100644 --- a/test/valid-manifest-0.2.json +++ b/test/valid-manifest-0.2.json @@ -1,21 +1,19 @@ { - "manifest_version": "0.2", - "name": "legacy-extension", - "display_name": "Legacy Extension", - "version": "1.0.0", - "description": "An extension that predates 0.3", - "author": { - "name": "Legacy Author", - "email": "legacy@example.com" - }, - "server": { - "type": "node", - "entry_point": "server/index.js", - "mcp_config": { - "command": "node", - "args": [ - "${__dirname}/server/index.js" - ] - } + "manifest_version": "0.2", + "name": "legacy-extension", + "display_name": "Legacy Extension", + "version": "1.0.0", + "description": "An extension that predates 0.3", + "author": { + "name": "Legacy Author", + "email": "legacy@example.com" + }, + "server": { + "type": "node", + "entry_point": "server/index.js", + "mcp_config": { + "command": "node", + "args": ["${__dirname}/server/index.js"] } -} \ No newline at end of file + } +} diff --git a/test/valid-manifest.json b/test/valid-manifest.json index c833deb..fcc9b9b 100644 --- a/test/valid-manifest.json +++ b/test/valid-manifest.json @@ -13,9 +13,7 @@ "entry_point": "server/index.js", "mcp_config": { "command": "node", - "args": [ - "${__dirname}/server/index.js" - ] + "args": ["${__dirname}/server/index.js"] } } -} \ No newline at end of file +}