@@ -198,6 +198,10 @@ export interface CodeQL {
198198 ) : Promise < void > ;
199199 /** Get the location of an extractor for the specified language. */
200200 resolveExtractor ( language : Language ) : Promise < string > ;
201+ /**
202+ * Run 'codeql resolve queries --format=startingpacks'.
203+ */
204+ resolveQueriesStartingPacks ( queries : string [ ] ) : Promise < string [ ] > ;
201205 /**
202206 * Run 'codeql github merge-results'.
203207 */
@@ -466,6 +470,10 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
466470 ) ,
467471 diagnosticsExport : resolveFunction ( partialCodeql , "diagnosticsExport" ) ,
468472 resolveExtractor : resolveFunction ( partialCodeql , "resolveExtractor" ) ,
473+ resolveQueriesStartingPacks : resolveFunction (
474+ partialCodeql ,
475+ "resolveQueriesStartingPacks" ,
476+ ) ,
469477 mergeResults : resolveFunction ( partialCodeql , "mergeResults" ) ,
470478 } ;
471479 return cachedCodeQL ;
@@ -974,6 +982,24 @@ export async function getCodeQLForCmd(
974982 ) . exec ( ) ;
975983 return JSON . parse ( extractorPath ) as string ;
976984 } ,
985+ async resolveQueriesStartingPacks ( queries : string [ ] ) : Promise < string [ ] > {
986+ const codeqlArgs = [
987+ "resolve" ,
988+ "queries" ,
989+ "--format=startingpacks" ,
990+ ...getExtraOptionsFromEnv ( [ "resolve" , "queries" ] ) ,
991+ ...queries ,
992+ ] ;
993+ const output = await runCli ( cmd , codeqlArgs , { noStreamStdout : true } ) ;
994+
995+ try {
996+ return JSON . parse ( output ) as string [ ] ;
997+ } catch ( e ) {
998+ throw new Error (
999+ `Unexpected output from codeql resolve queries --format=startingpacks: ${ e } ` ,
1000+ ) ;
1001+ }
1002+ } ,
9771003 async mergeResults (
9781004 sarifFiles : string [ ] ,
9791005 outputFile : string ,
0 commit comments