@extenshi/mcp
Version:
Extenshi MCP server — bring the extension catalog (search, security, market research) and pre-publish scanning into your AI tools
28 lines • 1.39 kB
TypeScript
/**
* Artifact safety gate — shared by the `scan_extension` and `publish_extension`
* MCP tools.
*
* Before we read an extension package into memory, upload it to the scan
* backend, or push it to a store, we confirm it really is an extension
* archive:
*
* 1. the filename extension is one of .crx / .xpi / .zip, AND
* 2. the file's leading bytes are a ZIP (`PK\x03\x04`, or the empty-archive
* marker `PK\x05\x06`) or a CRX (`Cr24`) container — an .xpi is a ZIP.
*
* Anything else — an ELF/PE/Mach-O executable, a shell script, a gzip stream,
* an HTML error page — is refused outright: we never upload it or hand it on.
* The scan server enforces the same rule at its own boundary; this is a fast,
* local, defence-in-depth check so a non-extension never leaves the machine.
*
* This module is intentionally vendored (copied) into both @extenshi/cli and
* @extenshi/mcp rather than shared — npm rejects `workspace:*`, so each package
* stays independently publishable.
*/
/**
* Throw unless `artifactPath` is a real extension package (.crx/.xpi/.zip whose
* leading bytes are a ZIP or CRX archive). Call this before reading, uploading,
* or publishing the file. Assumes the path already exists and is a regular file.
*/
export declare function assertValidArtifact(artifactPath: string): void;
//# sourceMappingURL=validate-artifact.d.ts.map