diff --git a/.external-skill-audit-allowlist.json b/.external-skill-audit-allowlist.json new file mode 100644 index 0000000..5ceeb79 --- /dev/null +++ b/.external-skill-audit-allowlist.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "reviewed": [ + { + "plugin": "remotion-best-practices", + "sha": "eed702478ce34eff4eb77230b748375332c536ae", + "rule": "unpinned-package-run", + "file": "remotion-create/REFERENCE.md", + "rationale": "npx create-video@latest scaffolds a new, empty Remotion project in a fresh folder when the user asks for one. @latest runs whatever Remotion publishes next, so this trusts Remotion's own release of its scaffolder rather than one reviewed version; the releases read so far read no existing code and send nothing." + } + ] +} diff --git a/.github/skillspector/requirements.txt b/.github/skillspector/requirements.txt index 25f9688..8b7638d 100644 --- a/.github/skillspector/requirements.txt +++ b/.github/skillspector/requirements.txt @@ -500,130 +500,150 @@ ormsgpack==1.12.2 \ packaging==26.3 \ --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c -pydantic==2.13.5 \ - --hash=sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73 \ - --hash=sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08 -pydantic-core==2.46.5 \ - --hash=sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942 \ - --hash=sha256:03b9666e41e35d8909852ba191a0607520f81b74eaf12ccf8737005dbb313821 \ - --hash=sha256:045ab3b6d308439e32b81cc173bba5b9018bc6ed896afd0c65b3b009b1699af5 \ - --hash=sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c \ - --hash=sha256:0cdbada856a1c69a7624a64d3d9aefe79300bd6ef827b43a4f265010b9b55184 \ - --hash=sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2 \ - --hash=sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc \ - --hash=sha256:15f4a94963c95accac15b7b657bb177d3ad82bb90b0d0526d9a9b85079925db5 \ - --hash=sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0 \ - --hash=sha256:193375f3548919d3f0b60936ca113ada3e38f264f91b9b8e0508efaad57be931 \ - --hash=sha256:1a353f84de772f423b5ffb11d7ae352fbbef0f446f3c0b0af0f8236d7233606e \ - --hash=sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25 \ - --hash=sha256:1e5aad1220a1192c42341c8fd4a8686657e73ab2a920c970bdc4de334fe3193d \ - --hash=sha256:200aa3dc9f8d54f0754f43247c0bad0999fdcfbfd2488384dd44f37279271fe6 \ - --hash=sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47 \ - --hash=sha256:24922243639cbdac66c75fcb6fd6495a9cb52b213d62f9a0d16f0310b1ff8038 \ - --hash=sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8 \ - --hash=sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b \ - --hash=sha256:2cbd9a5eff05e51c447c34dfa4632145b26b09120cf04bd0c871e44c1a5e1c9a \ - --hash=sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e \ - --hash=sha256:2d5d76654becf5efd62c9e51c3756c67b49498b0c9a40884934c40807adbd074 \ - --hash=sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0 \ - --hash=sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433 \ - --hash=sha256:356c8368cbc321050b169595683a2e1d63413b1e0e2868b330af9fc14c616d3f \ - --hash=sha256:37ae34309d7bd8c0d61ab839668058f2a7962ea1fc51d105d2db228fe0618034 \ - --hash=sha256:37ea7b83c935e5b0d68c9449b82651accf78a10828b2c02b2f2d9e9496446c21 \ - --hash=sha256:3a3e26b6a8274211bddee2d0e4d0d42778f17a34510f49d2ec44b58abfc41736 \ - --hash=sha256:3aa166e99c4f2985407fb8714aebede877ecb5455cf321b606adca926d30d5a0 \ - --hash=sha256:3d2652072b2d774947ba5cf78a9e59644ac62ee572daf6dd2e1dfe905e15b2b7 \ - --hash=sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c \ - --hash=sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4 \ - --hash=sha256:46c25dda9d092a06c08db76ffe0a197107904d0dfac653f7d5306bbcd6d6119c \ - --hash=sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c \ - --hash=sha256:4d44cf99ddebf875f9b68cc267aa684c99b7b44fe63ee1cac4ec163807290069 \ - --hash=sha256:4dedce55295becb61921e386b99d4f2706045306e7fa52249a33004c837379fb \ - --hash=sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061 \ - --hash=sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29 \ - --hash=sha256:5086029a57366b8cf81b130a43908738095c270c21a8d7f0e8bdfdb89718e2f3 \ - --hash=sha256:52e24eacdb536cade636aa90fb851835222becff8484b7001fdc78cb0290f2aa \ - --hash=sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e \ - --hash=sha256:545f26c504b27c3758439a5e6d9349931f0a04f855668d5fe323c89e82300a38 \ - --hash=sha256:54d510bac3ee52247af28ed4bb18a1e799f040ac60fd2bf5ccd4c92f1fbe786f \ - --hash=sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b \ - --hash=sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8 \ - --hash=sha256:5ee239d575f80b08eca11f6e20f90c4c695de7825c67eefe6091fbf20dda648e \ - --hash=sha256:5f194189415698233dd1114a093a9b56e61e2c57e11b469be3b0506f46f0771c \ - --hash=sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be \ - --hash=sha256:657b40d6240c0a7b6a64b30f22d1e3aa631c7e846c621b0c0f6d1d75e2e15ea6 \ - --hash=sha256:6d30e1a4f138b8951063e9a394752a9179b51da288ffa507b1e659222f4c1793 \ - --hash=sha256:6f7b393a8b3da82f5c1fc0751e6d01ac6c55b93c18226a60bdfba4a724efafd1 \ - --hash=sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b \ - --hash=sha256:771cf63ae0b1b50dd22e5f3e3549fab5f3f4ff1635d352a9e1a97fe01c7b2e64 \ - --hash=sha256:79bdfa52f843137045b2d081cc05c120ba6665d29b7559c2c47690906f39279f \ - --hash=sha256:7ac031912d54f3d83ef3b3eb98dfabc1608802e2202263d25957eeed40b94761 \ - --hash=sha256:7b0fc826b16c55e561e5d2a0c5c77b051ba1d92808118c4e4b5390f5e0cf191d \ - --hash=sha256:7c6be839a5a8312626b32029a415644a0846b420bc8b52b95b28cd92da162168 \ - --hash=sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869 \ - --hash=sha256:82a36973cf8a2ef5406f4fe2edbf8ed0c99629535d959e0b100c76a32535a111 \ - --hash=sha256:837b396ca3d7b74091ca623f6cbd8351bd42d670a79c2683e79fb089f06a2de5 \ - --hash=sha256:850a08d167dde16db8702c274f320c7be9d7da6f6dff2b58b18f9e815bd94f5b \ - --hash=sha256:8816f3d218beb4b787de5c9759c259b8fa61f9dec42dc7811f320a33771778b7 \ - --hash=sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129 \ - --hash=sha256:895395f8918627b04efb1ad2a4cf605387143300ba03304cd1dfa6d03f5e095e \ - --hash=sha256:8b10e3e8fd7ddc2bd915848a2768e44c15b22936f1cc54c462ad1164deb02655 \ - --hash=sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c \ - --hash=sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec \ - --hash=sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689 \ - --hash=sha256:976e1128455aa595ea04c79ccfedff1aaeab96ee013fcc916bed120c4f0ad94f \ - --hash=sha256:978e7b97d4824b5be09c69fb70507cbde3b0323fc147332ca40a94d9a6a0ebbf \ - --hash=sha256:97bf8de4d541598c94a59344eeb988a94c08ff76b5723c41f6567ec18c7892ea \ - --hash=sha256:97cf3eb53a8cccacf9d46686a0926186c9bfb5574f2ed66d3639d5fe117cd3a9 \ - --hash=sha256:9b68938dd5b0c783d88ff8e2dcc69451b5eb936fe212d516b21b9d5567f6d464 \ - --hash=sha256:9c4b71f10dd532fb7a5cbc8f58707779e64f03a258c2bf8bfbaecfcd9970b519 \ - --hash=sha256:9f47b8a949e60f027f0aa0a6f6c7b7e9c55cbf4380d10b344e282fa4e7ab1e1b \ - --hash=sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f \ - --hash=sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee \ - --hash=sha256:a2a5e1d0ff29adddc9f6d6821a66302e4493f8ca898b715b6b1182c2c201ea0a \ - --hash=sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e \ - --hash=sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6 \ - --hash=sha256:a91c17edf6eea2402cb5457b4c89e99bc5ed1004aa34c4adf1d4258c1a5c22c2 \ - --hash=sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f \ - --hash=sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a \ - --hash=sha256:acf8a67ba51f4ca9ddbd0e6b3000a65ac51ab734661778b3e7ba64d99a710f2f \ - --hash=sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a \ - --hash=sha256:b49924c73a235e969511bf2aabdff3beebf9820931f646c80274d5d780010c47 \ - --hash=sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda \ - --hash=sha256:b7ca9034437b6022f941f4857459562ee00a560b97e7cce8a0ec5a74fc6766e0 \ - --hash=sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4 \ - --hash=sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d \ - --hash=sha256:bce57638e08ac148e5778cce7feb968307a727d66f8e2274a543d0cf0c9ad6a3 \ - --hash=sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2 \ - --hash=sha256:c1c43ad4339643d70ebb8124e1305a7dab423001eff58bb41a0f731adbc98355 \ - --hash=sha256:c3471e5c4a949c26ec00a77f01df59096aa9495877de76fd60a980f8ee6be461 \ - --hash=sha256:c583b927a8838dab890706a6fa7573fbb8b70e24000ef9f7238e2d6f6435a5ed \ - --hash=sha256:c76fe65e607be28c7fd4d56fc3c42b1583aa058ce3408b7ad0fd540171d31f9f \ - --hash=sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5 \ - --hash=sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2 \ - --hash=sha256:cdbb78909f52b981d3b2d56b97328d71eb0b974c36bd77c920123a7ebb192829 \ - --hash=sha256:cdc8b74ecc48c0cb1e9607a05ec4e9e88db60a19ffcc9a1d5f9088ede40c8dc0 \ - --hash=sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266 \ - --hash=sha256:d22a945598fb91236b4dd793a6e42e4f3dd7740bb5aace5ebd7d4c08d13bb575 \ - --hash=sha256:d2f9fc07a8042a8f95925b35c4f04f469707c981fc33245b6ca187cf5d2dd290 \ - --hash=sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f \ - --hash=sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62 \ - --hash=sha256:e64e88d5585bea9ce95861079de72006c7fa6d3df4e3a3b65ba31eb979c15c9f \ - --hash=sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a \ - --hash=sha256:e7b891faeedeafba41b2983e5001a81b6a915b69544c7e7570d1989ce1c36ac7 \ - --hash=sha256:e80675d75ae2cd14372cb65cad5400d9347a3d3f6c13000183f22dfd027283ed \ - --hash=sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f \ - --hash=sha256:eb7d8d0e5886a89a55d2eef490e272fa965a9d57c6b29a5b5088a7997ec2cad1 \ - --hash=sha256:ecb42011e12ee19cafbc312887cbf3546959fe02fbad44f272d4be5baa997615 \ - --hash=sha256:ef3fbbf161dc9351a2fe0422e51b129f9e97e42385bd0320b309c15f7d287dd8 \ - --hash=sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3 \ - --hash=sha256:f077d0b97ab11fa7dcc633fca53515f290bca8a8a633e966d5b6d1879d9ed01a \ - --hash=sha256:f332f0e72a5a0400141f830744e141bf9f97917878dbe968669e8a7fefea78ff \ - --hash=sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084 \ - --hash=sha256:fa10ef4112775900e7a0661068635eb67b2ab824fbde764de6e0e21982a93db0 \ - --hash=sha256:fc5d783bd4a2387e97b8a2d5ec781cfb92b3d893bf82370548e99db5915935d3 \ - --hash=sha256:fc8515076c11f3cfdf4fb142dcca0fe384b1230a3b5415458ac84f3e0903ec13 \ - --hash=sha256:ff218293c9c806138dca139765e3b067621be52bcd93cdc14c7711be7ddc90a9 +pydantic==2.14.4 \ + --hash=sha256:653a2ad9f6d8858529c77c72717d0ea991d6c6837fe683246b2f4b2bbfc3fadc \ + --hash=sha256:7c19f1d46f8accf55a4617a6116e1ade64840870f397b846a2c53fb9019414ba +pydantic-core==2.50.5 \ + --hash=sha256:004c784d4642bd1112a9fa9a022543aa17793fd32004f7e903ee97df2086bad4 \ + --hash=sha256:00598ae680c6e4a17cda01910e49c0da8ce15610505e6c57cec3f15d83daef88 \ + --hash=sha256:008de9d97f2b0c8e596fb5d93d49b63be158e8be5ac35856903b338cbcfd21f3 \ + --hash=sha256:041f4730fa7a8bf975e88436d439bdc72f3f16e584a470ffbe47392628d99de6 \ + --hash=sha256:05815bbe2c7bec58d1ce456cc0a98f368e6ef9345b1d9311f42b814d34ad7086 \ + --hash=sha256:07a62d44515d674d750cfd86b7ce1dd93111be870f378d7c27b37aeb78d0cb4a \ + --hash=sha256:09c732c097816c89d46ddb70f89d72e853e3a1bbac6475961c60a88aad9fe612 \ + --hash=sha256:0a7d599d0c5afbab98c0e4441f5b76163c6fcfd2ecf73dd6418e468a7ac452b8 \ + --hash=sha256:0c9f0002e4ec37db931e4ee8b7dafab2c7288ef66354e74fe16484e60eac6616 \ + --hash=sha256:0d4edc3350e21e0ef773ef9395227ca072832f05e484cadcf4d8663b63a231c0 \ + --hash=sha256:0d6e614776c8c99495dcfc6ce8f826277fb4388a5e5cbee23c199cbe39e6dcb3 \ + --hash=sha256:0dd037d96e98f6db8b69a44ab7d5c20a07fb0a2051775746a9e1b5fc8f52867f \ + --hash=sha256:11806d9b4888f1645d74fc24237f21dad559b42fb8930481b3df414997be6ee5 \ + --hash=sha256:12178e58af383bd4c32b2fe141188bc7e540c5eb33ad550856fa5863b4c31bd5 \ + --hash=sha256:15124b48e0acb6d24664690e052d50be51901286886bc124090960f1df869f30 \ + --hash=sha256:159f6bc1b616e0ca0938eb568d87ca03c633d6f06306ac47b9c3e5dd8c14d39a \ + --hash=sha256:1793ec63c8f247131aa4dfc8c4da645b9c5872cf26b53ce240f143f59ad116e4 \ + --hash=sha256:1d53befcfd415bd9212e685372c825e62f29b83820db78512c9d3659f13d29e9 \ + --hash=sha256:1deb966176b1b66be4281c83f10a0b6b1cecedeb25f53ee894bf27b22376facd \ + --hash=sha256:1e740886083ff95530d694e6a3f09ed914bcf92a496d16acd307c6c3484fc36d \ + --hash=sha256:1f22c36d952f33bac936273ca0be115693a1d7c1c9496ca7d699e6a338656d6e \ + --hash=sha256:20337f547d79911457cd4739bb6699213a53089f946af87633a48fad3f74f5e1 \ + --hash=sha256:22f5f0c37251611191a55e801a5150aa21f348fa10eac8eac9fa43c29937a7b1 \ + --hash=sha256:24d23de96195ff9637e5940a7fbde3bea6a355b26fb5f491737dd803aa5d5a93 \ + --hash=sha256:252ce30d79b47954cc3a49f8a0d812ac24a356627391fcec90a68733c755707e \ + --hash=sha256:27bc22dc8d50335bc62296261a7dc4c2572149910ba7c274ef0f945b5be0d570 \ + --hash=sha256:2cb80e0323b31d4669c4d72a466d99c885e13deb06205aa079ea6594e7ad1ef8 \ + --hash=sha256:2d785ae9ff0ac485567f27f4fc53712268916e04be4a590160e5bf55b096225a \ + --hash=sha256:2f0a86887c644247eff4cc7b9e609042a49833dcd72f84574e7b8beea89729ab \ + --hash=sha256:2f5f29ff80ce0cf93102198cddebdbb3411881de177359c770e5c9c99495a6b3 \ + --hash=sha256:2f6a8c9b8647378c0dc128805e6b98da39d36019a0e7cac134badeaedb14f849 \ + --hash=sha256:302517f9f5589e07ead02d38fbb443947a211461b39b18f46948b20941fa8d98 \ + --hash=sha256:30988977d38909df645183a9869a9d12211485639ac4757de18585f0ccb6f3dc \ + --hash=sha256:3129b52ee2861d0270db8bd140fc9b53ee9821247ca47fda2613a899ce9a1ea3 \ + --hash=sha256:372f4ab3e67b2387871950cfa27d94d644c3475e650836ea52e25c2e4fbd7975 \ + --hash=sha256:3cf575867ecaf89aca440e5a4253d2facf1ca37bab30a4e8c205ec611228126a \ + --hash=sha256:3f800fc0f304f3b0e09d07d4287f9f0bc9bfe5319d1d7cabeaf265737c516083 \ + --hash=sha256:40d5da89a632e6c6c938f93fdf54c534882d258a80f51ccfe1650cdedc12e82c \ + --hash=sha256:43917f090dfda561575a72f75814f76a0680964b70d7b44c84e44d217bdeade7 \ + --hash=sha256:43a6eaee9eeac4a54f2ff6567e1b0ec51651b37a40d862cab2e6fd16109e6528 \ + --hash=sha256:44e6c35bf3a9b6785db0c083df8a6929343f9c8fc27186991d21653242c77c19 \ + --hash=sha256:470bbc2495367f60d3ca849a8039e4c164701d10637e7743f4427d92651bdb6d \ + --hash=sha256:47f4d79fe4876feace216a5b2263c40d792476b4a6508c38d66a2facd3f1f4cc \ + --hash=sha256:488319076ec92908b91fc6265ce761f1d78748f69f85518564fd16bf333e1b70 \ + --hash=sha256:4888829471cd8d85c096ef0e1f41a066c7d76e88309a4fbff4069f70d07673be \ + --hash=sha256:48b5deaaee4f1b99603173cd291127523e43ee9f51db58c7ff98d16dc5c6fc93 \ + --hash=sha256:4ac243e358837f62d085f07b98625fa3831abdb28e8f77196934345bbff0fb0b \ + --hash=sha256:4ae5c9f84dfa43643d10328a212f709c7602c5e70df376d217ae5770d374ccd9 \ + --hash=sha256:4dcf7b2cdfb9c59c1d377de318f3c8462121f32db939299999484ea0b1eadf18 \ + --hash=sha256:5027c263fbceb821cfb4b385d36d485e19efca1d9adcc4e5bec69c04ca3cdc83 \ + --hash=sha256:50d12ba7cab98b355ba65d65655e969f66934ab7a3d2d0c8abd61ae2282efce5 \ + --hash=sha256:5274f8314ce3be1df07ae8ebceeb97a73b8409d842fd7677c5d0a85a68793ec1 \ + --hash=sha256:55e0d60384a9b14641749d2ba6721f82409248288f066b95d555c6dd484273d2 \ + --hash=sha256:568e928322f0b6b94671fc1a4dbc867627af74695b0c060ac6d4f25b6a7425d8 \ + --hash=sha256:57b79401d870c9df395799c596d81875b647ecf3030129d86659a54f6bfcc0db \ + --hash=sha256:57d4350167130c9c136b7efa35e6e7ee9539779698755b01007834d32c7a1f7d \ + --hash=sha256:5da0e7da9d7cdc39df85d1b927b77d40218cf40acbfc523048c95ce44d33abb9 \ + --hash=sha256:5eafde2cd1d97b7f60efc423d8504b22defd9d2fb9c4a358ffd1230e5fe65311 \ + --hash=sha256:5ec2e8caf5eadea7be683fc7025d60563e920f1f52fe18ae46c49558e67b8cd0 \ + --hash=sha256:5f33c92da4aa5714fb6fcb086358274598e8ff62b6607afd132a38657aa64f02 \ + --hash=sha256:639a51931869c0594d8723b2f529c547db1aa33dc9571d001dc205d896170c08 \ + --hash=sha256:63a0ba0d7ccf37c8c724bb7ed13c3aa0aa4c743f4f5f376c92c47e584844c7b1 \ + --hash=sha256:655d0cc2ddbc3fb1f4f8a8e3724552ee2ba6b8561289e9e6e06186982b27bceb \ + --hash=sha256:65b0f52abcd06dbb53961db9cc3610929f4f6518c3726d965a9babdaf7bd79c9 \ + --hash=sha256:679f15dd3bd2a82bde350ec8c94c0f8f05f05dba39fb3464cd4136a724da9844 \ + --hash=sha256:68334f281460fb2a85bbb9e2545438bf2fd2c9a166823a60b84541a3c8f2d2e0 \ + --hash=sha256:6a069ceeca397bd8da2e8ef6383595c63ea17de37d5f2d5cde729bdc0dfe6774 \ + --hash=sha256:6e01a2033691ea2cbd91e499d6b6573f446dc926ccdfc670ed576991cef85cdb \ + --hash=sha256:706c75cd9f8bd1798367f463ea81df52eff5fb2e4c4ef83997dd4ae538adc109 \ + --hash=sha256:71633f82d51d4796a48026bd6eca5ec83e4a0edbe6187d59bbc45ace1111ebae \ + --hash=sha256:736782cfbca37b4d81e6f3c7a3414de25db045dcdb7a05e55b64191a33c5ac45 \ + --hash=sha256:7c3faea08d44b4a7b57b30f1113e6404e6aa62a4f3489a22359fb27d6003d8b1 \ + --hash=sha256:7dfc0431e94659ae8449303ca4fb1588dc1e00282d6636d00d72bb4bd6459b4d \ + --hash=sha256:851a78a30265bb203186fd0e19712c1a4431083eb5a1e1715f758a029cd8aa6e \ + --hash=sha256:86bd5aad5ccbaced98139d08b4314f253c086897830f4bcf9c1d1f02f740683d \ + --hash=sha256:887424ba7c2145e97f131bc2cc73383a8c464d7bcd56eb98bbd941afb6868b95 \ + --hash=sha256:88b543705849d0c59343f97c38296dbf59eb7b3c9565bd4fe1ed638ba38da5ed \ + --hash=sha256:8ba2dcbeea0ab8836e804c54e905075125c702cf78e592d998eecf2764b64144 \ + --hash=sha256:8bbe282e79dc71b24ba7be284eacf27c8ddff8f26911e2030a0dd123c6aed326 \ + --hash=sha256:8c7244134b93ce028e9166c1b5d3e4537349307ccf3e65d746b4c6b1bbed8c89 \ + --hash=sha256:90dabbf4f38f37de1663ce932d37c6f694a005f6470ae2f0d97755d9e3f90ffd \ + --hash=sha256:90ff55049623eccbfa997332e2b91358dc2c4c30ca6e664b45438723cbe181df \ + --hash=sha256:922455cc5baddb0f2c82b7ba649e57e89183442b32fe512670db6ebb9b66b251 \ + --hash=sha256:92c0ebab606f982730aaaa741a30cd5e0f68dc7c005a5baa9b332fc182232c61 \ + --hash=sha256:93a10c0b967c0dc6c2253d3a82b9117d2a841b8e344c637edc0a14220852b115 \ + --hash=sha256:93ee3b4f9c64fb1c39892413c4196d0a84790a7e0e5d72b463882c432c1ffafe \ + --hash=sha256:98b92dad690e6578cc0b504eda53d53adaa4f34bd09c97a547a957e419544eb7 \ + --hash=sha256:9e255e7c32d9c2f396d3daa833e7d8d701eec7bf8e13ca092b4b83ce7d9487fd \ + --hash=sha256:9f2bf218dbc93363fe3e31cc53d36db8d6ff4122179406bec05f33bb79c0e2c1 \ + --hash=sha256:a5f6622451fa3cd71c8ff15df24307cb3f8b5dc35a723de281646c34872d7179 \ + --hash=sha256:a9bcf23628860d5a90cacdc188ee3b7d0547a38eb985214f03e7002a6ca0e558 \ + --hash=sha256:aa69eaeed433cfe5de809fb84c95536a5aed991b28290d0db059fe6766c69274 \ + --hash=sha256:ad0e0221deec2a2385300d76b9259da7036c0ed784502c154ae237dafd67605f \ + --hash=sha256:af453c0c20372ca8acf3c46de2a89b242491853dc61d0171ba24608d33310e09 \ + --hash=sha256:b2910ec0fa5aeb9bef70156f2b79f4783978fdcfaa7b2f1b5d1814458d2e79a1 \ + --hash=sha256:b2b64d3204f9c33f03ed3111eb754902ea76ca5aa61ab4b2bdf9f767a4a1f279 \ + --hash=sha256:b43115385de7db83bd2fe7a08dea8580bce3acc3f54200c4f4fe32a4a49688d4 \ + --hash=sha256:b66f2434c895652ac21c030d5a3a92c7811f0f9b98af41bf35be899c2d34aa4c \ + --hash=sha256:b6f48c4bf1c77ace644b125f168418438fbc9b8e4c3b290915cc7d055d83c8b1 \ + --hash=sha256:b7e6a76b77513cd633a08addfda8409623ad884a4d91ee3664fb05cf094b2c35 \ + --hash=sha256:b9348cfd798b8199d34da5258becf2fc8f5e4e7a3b51da30c34b81b996a07b34 \ + --hash=sha256:ba2b34529984a8e3cb1bc62a7687617722695a2cb4e57958de32a0eba128a07a \ + --hash=sha256:baa107902f8e38011a5f79836d905eb6bfaac1d4b0bd09fc86509b711d0b09c8 \ + --hash=sha256:bb103c150e1a0f1b8b2710a66ce1f741c7922b22ef07a290aea0e6cf702d8bbf \ + --hash=sha256:bcc830e4f48499fd30a870f07c30752273ae2ddccce34d65d51c9fc880c380ab \ + --hash=sha256:bcd9d9b38e61dfd43e00f621ce00da2ffed35047fad532c4afcadf4f9ca0d672 \ + --hash=sha256:bdafd6b05bf012772b7d7325a98d26f19b7918e21dabdd5970c885262245aae3 \ + --hash=sha256:be4615d4b5f90c65dce2295dcf32eff7f05ea5d0d3a82421c03c572785cb9bf8 \ + --hash=sha256:c334b8759496f9e597b68e1309b2fb3d824fd24a29e562afa86b61005eb9d54d \ + --hash=sha256:c415a8da7c89a3dd32d988a9117bf0a52371769b77b0943bcfd50b281ecefb8d \ + --hash=sha256:c4c4313dc66f45822b3d7f39aa74e59e7987cf7572b3309005b26d956a0098a9 \ + --hash=sha256:c69eb2e09d2830949e6e8f395d4eb8c714ba083213ccff64932ded681fe69a4e \ + --hash=sha256:cbec4aad328be58961c738b83fc2c7bd993242d2366f949d914e8c09266dee0e \ + --hash=sha256:cbfde3ad127786f1dea1a6cd89a5eb824a16203f24743ad2b4e07506f43bc844 \ + --hash=sha256:d16cb794449c2bc0e5cb0ab0022813419bf5283266f2a7ff1fc54e5c6e27dcee \ + --hash=sha256:d34c0d4dd4a318f2be788a60a972c3a1ed5da0155a7c06d6dd810dc5d60ad704 \ + --hash=sha256:d3ada66d0601feeeba504a6daac73e47ed164357e46930366f135c4121594d53 \ + --hash=sha256:d4ebf349b1b60049e80df5d9ea6725b1b7e434a7d006474b0f664fa72a6b3c75 \ + --hash=sha256:d7826407ed74ff8e6cc6e6df7ffbf180e9b449ab1516f28eb5f6e2a489bc5129 \ + --hash=sha256:d84b427c6badf48adc2586be1dc5c8677fc2f22a09da50e5d3f342d3daf3b2b4 \ + --hash=sha256:dac78f91e263c4c9a4d587b9d97b3b5b2561293b33247452cc3cfe5b500e8cfb \ + --hash=sha256:dc5717ed8981efdbbafc15a2533a690703cf80e96b886a158c61c9ec9bafcc28 \ + --hash=sha256:e0a7ae307b4e1eff195cd23a757da07f70a115e45175039caf5f3979a20c7edb \ + --hash=sha256:e5d5d77a9446f44688a5ef420d92c9facac0865ef5565215db54be184ab7906f \ + --hash=sha256:e65f78eb3d930ac30ff3557fc74a0771300096fb002f588a6fe8d946e83f14ad \ + --hash=sha256:e7dd59f498ef42077f22db607571249db41997227018cb84644ba0059f8b5719 \ + --hash=sha256:e8faa73de2e9231f604cfa44c471d0986e7e9c45129d7888839a34196e46a7df \ + --hash=sha256:e8fe516a4b3b06e4ff83b9adee4a786d28a617e5fb5fe90bda49fb6f52a5ac19 \ + --hash=sha256:e93587aaa5660536b9188686e8fe0544b577ec57d896d424b5b2118b151a6845 \ + --hash=sha256:ea215f7f5d2df866e3b5448c0bbb4a35285086ac6ab18687796704cbd5f2c5a3 \ + --hash=sha256:ea7429e3adb2f2fd81e2d6e8942e5c1cd760a6e6be5b7574d2ee5499b5e19e67 \ + --hash=sha256:ed4a01922af0d41b2a3b9433818cbb73b6b28e8dea344c90917c1fdcceb9960f \ + --hash=sha256:ef461e9299ae665fab67c6f054847178b8fd510da10b4ef745a074b922efbf0a \ + --hash=sha256:f20c692c599ebac7f04f3a0102b969f3f9d6667ffe1e72629fc7fbf8b6375234 \ + --hash=sha256:f33be114a0ee27870cffd31057ed60bf5a0cd522dcbdc1dda0bdad70f8302cb0 \ + --hash=sha256:f7509c6f8a0f9d9eac58340dd567f0eb71ce2f762df09f0d51280e30da3fe687 \ + --hash=sha256:f8dc2008577c5e02eaa1eb3fbfa8fe0eba9af27ff6a740e9f1dae6661e88efcb \ + --hash=sha256:f8fd7e9c44bb4c9214d41c3bef79cba5a513b29c3bcbfdaaf0440ca6f5fb65ea \ + --hash=sha256:fa66340c6d3e08a276803812e7665312dfc75dd24eedfa8e09f18a0f8e3e0e8f \ + --hash=sha256:feb8c87dbc4684777ddafbf37c922d9e2748272ba61e362ebf85db73ebda6234 pygments==2.21.0 \ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c @@ -915,9 +935,9 @@ tiktoken==0.14.0 \ --hash=sha256:f3d6cf93fbe2e7117eb7bedca684216fbe328a41f0843ce34245451d8eb2df1c \ --hash=sha256:f5e7665f6624e052e5e7f6a36919ab69279decdc976d7b16b4fa15e1897d0513 \ --hash=sha256:f702e0aeeb6506e57687e881c59e844ebe8f0a6a097ddafe20e3ab25f387be4e -truststore==0.10.4 ; sys_platform != 'emscripten' \ - --hash=sha256:9d91bd436463ad5e4ee4aba766628dd6cd7010cf3e2461756b3303710eebc301 \ - --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981 +truststore==0.10.5 ; sys_platform != 'emscripten' \ + --hash=sha256:30d36967ccaded5cbb38d602c433f53600036c79d502f4533a49b60a03bbefcd \ + --hash=sha256:9aaaedaefaf06d8b206278cf8b5012bc897f485a874503501e12d776df78951c typer==0.23.2 \ --hash=sha256:a99706a08e54f1aef8bb6a8611503808188a4092808e86addff1828a208af0de \ --hash=sha256:e9c8dc380f82450b3c851a9b9d5a0edf95d1d6456ae70c517d8b06a50c7a9978 diff --git a/.github/workflows/validate-plugins.yml b/.github/workflows/validate-plugins.yml index 5796d70..ce9399d 100644 --- a/.github/workflows/validate-plugins.yml +++ b/.github/workflows/validate-plugins.yml @@ -96,6 +96,14 @@ jobs: # Passes without network access while the catalog has no external plugins. run: python scripts/validate_external_sources.py --jobs 4 + - name: Audit the instructions this repository's plugins give the agent + # Guardrail evasion, pipe-to-shell and unauditable files fail; the other rules annotate the pull request. + # A pull request audits the plugins it changes, including the runs Sync Codex Plugins + # dispatches for one (which have no GITHUB_BASE_REF); main audits them all. + env: + AUDIT_BASE: ${{ github.base_ref || (inputs.pr_number && 'main') || '' }} + run: python scripts/audit_skill_text.py --catalog . ${AUDIT_BASE:+--base "origin/$AUDIT_BASE"} + - name: Validate shell scripts run: | shellcheck --version diff --git a/CLAUDE.md b/CLAUDE.md index 73ad58f..a3d9ee9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,6 +43,7 @@ python3 -m unittest discover -s tests ruff check scripts/*.py tests/*.py && mypy scripts claude plugin validate --strict . scripts/scan-skills.sh changed origin/main # security scan; needs `skillspector` +python3 scripts/audit_skill_text.py --catalog . --base origin/main # skill text audit ``` The tufte-viz plugin has a self-test that CI does not run. When you touch that plugin, run it: @@ -199,6 +200,44 @@ packaging, add a compact compatibility mapping to `.agents/plugins/source-overri Then run `python3 scripts/validate_external_sources.py`. `docs/creating-plugins.md` has the full procedure. +A pin fixes the text of an upstream skill, not what that text runs or sends, so the validator +also reads every Markdown file a pinned plugin ships, except repository material at its root +such as `README.md`, `docs/` and `tests/` that no manifest or entrypoint mapping declares and no +audited file points at by path (`${CLAUDE_PLUGIN_ROOT}/docs/setup.md`, `../../examples/`, +`${CLAUDE_PLUGIN_ROOT}/AGENTS.md`) +(`scripts/audit_skill_text.py`). It fails on text +that tells the agent to get a command past a safety classifier or permission prompt, a download +piped into a shell or into an interpreter that runs its input +(`| python3`, `| node - arg`, `| source /dev/stdin`), a package run that downloads whatever +version is newest (`npx x@latest`, `npx -y x`, `pnpm dlx x`, `uvx --from x cmd`), a `curl` that +sends data to a remote host (a body or upload, any value the shell fills in such as `$TOKEN` or +`$(cat f)` in a header or the URL, or anything after a proxy or `CURL_HOME` set earlier in the +file), and a file it cannot +read (too large, not UTF-8 text, a manifest that is not valid JSON, a symlinked folder, or a +link out of the plugin). Read the flagged passage, then +either accept it in `.external-skill-audit-allowlist.json` (plugin, pinned `sha`, rule, file +and a rationale) or drop the plugin. Entries are bound to the commit: when you bump a pin, +every finding of that plugin fails again until you have read the new text and renewed or +removed its entries. + +The `validate` check runs the same audit on the plugins in this repository that a pull request +changes, including uncommitted files and plugins whose catalog source is new or points at another folder +(`--catalog . --base origin/main`). Guardrail evasion, a download run by a shell or interpreter (piped, or +through `bash -c "$(curl ...)"`, `eval "$(curl ...)"`, `<(curl ...)` and `bash <<< "$(curl ...)"`) and an unauditable file fail the check; the +other rules are warnings on the pull request, so fix or explain each one. When a blocking finding +in a plugin here is the point of that plugin, accept it under `reviewed_local` in +`.external-skill-audit-allowlist.json` (plugin, rule, file, the whole trimmed source +line and a rationale; a finding that spans several lines, such as a sentence or a command +continued after a trailing `|` or `\`, joins them with spaces, and so does every further line a +trailing `\` continues it onto; a `$(`, `<(` or backtick substitution that does not close on its +own line, or that holds a here-document or `case`, binds every line to the end of its code +block). The entry stops matching when any of those lines changes, and an +entry that no longer matches fails. + +`scripts/audit_skill_text.py` is the canonical copy. Other marketplaces, such as +`StackOneHQ/agent-plugins`, vendor it unchanged at a pinned commit of this repository, so after +changing it here, bump their copies. + ## Naming and versions - Name a plugin after what it does, lowercase with hyphens, no owner or company prefix: diff --git a/scripts/audit_skill_text.py b/scripts/audit_skill_text.py new file mode 100644 index 0000000..961eefd --- /dev/null +++ b/scripts/audit_skill_text.py @@ -0,0 +1,1538 @@ +#!/usr/bin/env python3 +"""Flag risky instructions in the Markdown a plugin gives the agent. + +validate_external_sources.py audits pinned external plugins against +``.external-skill-audit-allowlist.json``; ``--catalog`` audits the repository's own plugins. +Canonical copy: StackOneHQ/powerful-plugins. Other repositories vendor it unchanged. +""" + +from __future__ import annotations + +import json +import os +import re +import shlex +import subprocess +import sys +from bisect import bisect_left, bisect_right +from collections.abc import Callable, Iterator +from dataclasses import dataclass, field +from functools import lru_cache +from pathlib import Path, PurePosixPath +from typing import Any +from urllib.parse import urlsplit + +RULES = ( + "guardrail-evasion", # shape a command so a classifier, prompt or sandbox lets it through + "pipe-to-shell", # curl ... | bash: what runs can change on the server at any time + "unpinned-package-run", # npx x@latest, npx -y x, uvx x: runs whatever the registry serves + "outbound-upload", # curl/wget sending data to a host other than localhost or a trusted domain + "unauditable", # an instruction file too large to read +) + +# Upstream repository material at the plugin root that is not loaded as agent instructions, +# unless audited text points at it (${CLAUDE_PLUGIN_ROOT}/docs/setup.md, ../../examples/, +# ${CLAUDE_PLUGIN_ROOT}/README.md): those files are audited too. Below the root nothing is +# skipped: a skill can tell the agent to read any file it ships. +SKIPPED_DIRECTORIES = frozenset( + { + ".git", + ".github", + "__tests__", + "benchmarks", + "docs", + "examples", + "fixtures", + "node_modules", + "packages", + "test", + "tests", + } +) +SKIPPED_FILES = frozenset( + {"AGENTS.md", "CHANGELOG.md", "CLAUDE.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", + "LICENSE.md", "README.md", "SECURITY.md"} +) +# Larger files are reported as unauditable rather than read, so CI time stays bounded. +MAX_FILE_BYTES = 512 * 1024 +_MARKDOWN = (".md", ".markdown", ".mdx") + +_GUARDRAIL = re.compile( + r"\b(?:safety\s+(?:classifier|check|filter|tooling|prompt)s?|classifiers?|" + r"permission\s+prompts?|approval\s+prompts?|sandbox(?:es|ing)?|guardrails?)\b", + re.IGNORECASE, +) +_EVASION = re.compile( + r"\b(?:avoid(?:s|ing)?\s+(?:\w+\s+){0,3}(?:block|flag|prompt|classifier|detect|trigger)\w*|" + r"bypass(?:es|ing)?|evad(?:e|es|ing)|circumvent(?:s|ing)?|" + r"get(?:s|ting)?\s+(?:\w+\s+){0,2}(?:past|around)|slip(?:s|ping)?\s+(?:\w+\s+){0,2}past|" + r"(?:is|are)\s+the\s+shape|(?:won't|will\s+not|doesn't|does\s+not|don't|do\s+not)\s+" + r"(?:get\s+)?(?:trip|trigger|flag|block)\w*|" + r"(?:not|isn't|aren't|wasn't|won't)\s+(?:be\s+|get\s+)?(?:blocked|flagged|caught|detected)|" + r"(?:reads?|looks?)\s+like\s+(?:an?\s+)?(?:ordinary|normal|harmless|local))\b", + re.IGNORECASE, +) +_FORBIDS = re.compile( + r"\b(?:never|do\s+not|don't|must\s+not|mustn't|should\s+not|shouldn't|not\s+allowed)\b", + re.IGNORECASE, +) +# What may stand between a pipe and the shell it feeds: `| sudo -u root bash`, +# `| env A=1 /bin/sh`, `| timeout 60 bash`, `| { bash; }`, with the options of each that take +# the next word as their value. Read as tokens, not one regex, so the scan stays linear. +_SUDO_VALUE_FLAGS = frozenset( + {"-C", "-D", "-g", "-h", "-p", "-R", "-r", "-T", "-t", "-U", "-u", "--chdir", "--chroot", + "--close-from", "--command-timeout", "--group", "--host", "--other-user", "--prompt", + "--role", "--type", "--user"} +) +_WRAPPER_VALUE_FLAGS: dict[str, frozenset[str]] = { + "busybox": frozenset(), + "command": frozenset(), + "doas": frozenset({"-C", "-u"}), + "env": frozenset({"-C", "-S", "-u", "--chdir", "--split-string", "--unset"}), + "exec": frozenset({"-a"}), + "ionice": frozenset({"-c", "-n", "-p", "--class", "--classdata", "--pid"}), + "nice": frozenset({"-n", "--adjustment"}), + "nohup": frozenset(), + "setsid": frozenset(), + "stdbuf": frozenset({"-e", "-i", "-o", "--error", "--input", "--output"}), + "sudo": _SUDO_VALUE_FLAGS, + "time": frozenset({"-f", "-o", "--format", "--output"}), + "timeout": frozenset({"-k", "-s", "--kill-after", "--signal"}), + "xargs": frozenset( + {"-a", "-d", "-E", "-I", "-L", "-n", "-P", "-s", "--arg-file", "--delimiter", + "--max-args", "--max-chars", "--max-lines", "--max-procs"} + ), + "{": frozenset(), +} +# A word the wrapper reads as a number or a duration: `nice 10`, `timeout 1m`. +_WRAPPER_NUMBER = re.compile(r"\d+(?:\.\d+)?[smhd]?") +# Shell punctuation ends a word: `| bash;` runs bash. +_WORD = re.compile(r"[^\s;&|()<>`]+") +_COMMAND_END = re.compile(r"[|;&]") +_SHELL_NAME = re.compile(r"(?:ba|z|da|k|mk|a|c|tc|y)?sh(?:\.exe)?|fish", re.IGNORECASE) +# `| source /dev/stdin` and `| . -` run what the pipe carries in the current shell. +_SOURCE_NAMES = frozenset({".", "source"}) +_STDIN_PATHS = frozenset({"-", "/dev/stdin", "/dev/fd/0", "/proc/self/fd/0"}) +# PowerShell runs what either kind of downloader fetched: `curl ... | pwsh -`, `irm ... | iex`. +_POWERSHELL_NAME = re.compile(r"iex|Invoke-Expression|(?:powershell|pwsh)(?:\.exe)?", re.IGNORECASE) +# An interpreter runs its standard input when no script, module or code argument comes before +# a `-` or /dev/stdin: `| python3`, `| node - arg`, `| sudo perl`. `| python3 -m json.tool` +# reads it as data. +_INTERPRETER = re.compile( + r"(?:python|pypy)(?:\d+(?:\.\d+)?)?(?:\.exe)?|node(?:js)?(?:\.exe)?|perl|ruby|php", + re.IGNORECASE, +) +_INFO_FLAGS = frozenset({"--help", "--version", "-h", "-V"}) +# Per interpreter: options that take the next word as their value (`python3 -W ignore`), and +# options that run code or a module rather than standard input (`python3 -c`, `node -e`). +# Treating an option as one that takes a value can only add a finding, never hide one. +_INTERPRETER_OPTIONS: dict[str, tuple[frozenset[str], frozenset[str]]] = { + "python": ( + frozenset({"-W", "-X", "-Q", "--check-hash-based-pycs"}), + frozenset({"-c", "-m"}), + ), + "pypy": ( + frozenset({"-W", "-X", "-Q", "--check-hash-based-pycs"}), + frozenset({"-c", "-m"}), + ), + "node": ( + frozenset( + {"-C", "-r", "--conditions", "--env-file", "--experimental-loader", "--import", + "--input-type", "--loader", "--require", "--title"} + ), + frozenset({"-c", "-e", "-p", "--check", "--eval", "--print", "--test"}), + ), + "perl": (frozenset({"-I", "-M", "-m"}), frozenset({"-e", "-E"})), + "ruby": (frozenset({"-C", "-E", "-I", "-r", "--encoding"}), frozenset({"-e"})), + "php": (frozenset({"-c", "-d", "-z"}), frozenset({"-B", "-E", "-F", "-R", "-f", "-r"})), +} +# `|&` pipes stderr too. +_PIPE = re.compile(r"(?@?[A-Za-z0-9][\w.\-]*(?:/[\w.\-]+)?)(?P(?:@|==)[\w.\-^~<>=*]+)?" +) +# A bare `npx tool` is not flagged: it usually names the project's own dev tool, which npx runs +# from node_modules. Where the package is missing, npx without a TTY downloads the newest release. +# `npx -p x cmd` and `npx --package=x cmd` install x explicitly, so x needs an exact version, +# and so does each further -p of the same command. `bun x`, `npm exec` and `npm x` are the same +# runners under another name. +_NPX_START = re.compile(r"\b(?:npx|bunx|bun\s+x|npm\s+(?:exec|x))\s+") +# npm options that take the next word as their value (`npx --prefix /tmp -p x cmd`), and its +# switches. Any other long option may take one too, so the word after it is checked both as the +# package to run and as that option's value. +_NPX_VALUE_OPTIONS = frozenset( + {"-C", "-c", "-w", "--before", "--cache", "--call", "--globalconfig", "--loglevel", + "--node-options", "--otp", "--prefix", "--registry", "--scope", "--script-shell", "--shell", + "--tag", "--userconfig", "--workspace"} +) +_NPX_SWITCHES = frozenset( + {"--", "--dry-run", "--force", "--global", "--ignore-existing", "--ignore-scripts", + "--include-workspace-root", "--legacy-peer-deps", "--no", "--no-install", "--offline", + "--prefer-offline", "--prefer-online", "--quiet", "--silent", "--verbose", "--workspaces"} +) +_SPACE_SEPARATED = re.compile(r"\S+") +# Runners that always download. An option that names the package to fetch (uvx --from, +# pipx run --spec, pnpm dlx --package) makes the next word a command, so the option's value +# needs the exact version instead; uvx --with adds a package that needs one too. The value of +# an option such as --python is skipped. Values cannot start with "-", so the two option forms +# never match the same words and the scan stays linear. +_FETCH_VALUE_OPTIONS = ( + r"(?:--python|--with|--with-editable|--from|--spec|--package|--index-url|--index|" + r"--extra-index-url|--default-index|--pip-args|-p|-w)" +) +_ALWAYS_FETCH = re.compile( + r"\b(?Ppnpm\s+dlx|pnpx|yarn\s+dlx|uvx|uv\s+tool\s+run|pipx\s+run)\s+" + r"(?P(?:" + _FETCH_VALUE_OPTIONS + r"\s+[^\s-]\S*\s+|-[\w-]+(?:=\S*)?\s+)*)" + + _PACKAGE +) +_FETCH_SPEC = re.compile( + r"(?P