media-analysis-mcp 2.0.0
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/LICENSE +21 -0
- package/README.md +191 -0
- package/dist/bailian.js +320 -0
- package/dist/bailian.js.map +1 -0
- package/dist/bytes.js +20 -0
- package/dist/bytes.js.map +1 -0
- package/dist/cli.js +56 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-lookup.js +271 -0
- package/dist/config-lookup.js.map +1 -0
- package/dist/config.js +212 -0
- package/dist/config.js.map +1 -0
- package/dist/doctor.js +206 -0
- package/dist/doctor.js.map +1 -0
- package/dist/errors.js +387 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/media.js +585 -0
- package/dist/media.js.map +1 -0
- package/dist/mpeg-audio.js +226 -0
- package/dist/mpeg-audio.js.map +1 -0
- package/dist/provider-error.js +73 -0
- package/dist/provider-error.js.map +1 -0
- package/dist/sanitize.js +103 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/server.js +290 -0
- package/dist/server.js.map +1 -0
- package/dist/sse.js +327 -0
- package/dist/sse.js.map +1 -0
- package/dist/upload-cache.js +146 -0
- package/dist/upload-cache.js.map +1 -0
- package/dist/upload.js +368 -0
- package/dist/upload.js.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/package.json +73 -0
- package/scripts/prepare.mjs +43 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const distJs = join(repoRoot, "dist/index.js");
|
|
8
|
+
const huskyBin = join(repoRoot, "node_modules/husky/bin.js");
|
|
9
|
+
const tscBin = join(repoRoot, "node_modules/typescript/bin/tsc");
|
|
10
|
+
|
|
11
|
+
/** @param {string} bin @param {string[]} args */
|
|
12
|
+
function runNode(bin, args) {
|
|
13
|
+
const result = spawnSync(process.execPath, [bin, ...args], {
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
cwd: repoRoot,
|
|
16
|
+
});
|
|
17
|
+
if (result.error) {
|
|
18
|
+
console.error(result.error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
if (result.status !== 0) {
|
|
22
|
+
process.exit(result.status ?? 1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const isGitCheckout = existsSync(join(repoRoot, ".git"));
|
|
27
|
+
const hasDist = existsSync(distJs);
|
|
28
|
+
|
|
29
|
+
if (isGitCheckout && process.env.HUSKY !== "0" && existsSync(huskyBin)) {
|
|
30
|
+
runNode(huskyBin, []);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Tarball installs already ship dist/. GitHub/npx clones do not, even if
|
|
34
|
+
// npm stripped .git before running prepare.
|
|
35
|
+
if (hasDist && !isGitCheckout) {
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!existsSync(tscBin)) {
|
|
40
|
+
console.error("prepare: typescript is required to build dist/");
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
runNode(tscBin, ["-p", "tsconfig.build.json"]);
|