@@ -411,7 +411,11 @@ export type GetProvisionerDaemonsParams = {
411
411
* lexical scope.
412
412
*/
413
413
class ApiMethods {
414
- constructor ( protected readonly axios :AxiosInstance ) { }
414
+ experimental :ExperimentalApiMethods ;
415
+
416
+ constructor ( protected readonly axios :AxiosInstance ) {
417
+ this . experimental = new ExperimentalApiMethods ( this . axios ) ;
418
+ }
415
419
416
420
login = async (
417
421
email :string ,
@@ -2599,6 +2603,36 @@ class ApiMethods {
2599
2603
} ;
2600
2604
}
2601
2605
2606
+ // Experimental API methods call endpoints under the /api/experimental/ prefix.
2607
+ // These endpoints are not stable and may change or be removed at any time.
2608
+ //
2609
+ // All methods must be defined with arrow function syntax. See the docstring
2610
+ // above the ApiMethods class for a full explanation.
2611
+ class ExperimentalApiMethods {
2612
+ constructor ( protected readonly axios :AxiosInstance ) { }
2613
+
2614
+ getAITasksPrompts = async (
2615
+ buildIds :TypesGen . WorkspaceBuild [ "id" ] [ ] ,
2616
+ ) :Promise < TypesGen . AITasksPromptsResponse > => {
2617
+ if ( buildIds . length === 0 ) {
2618
+ return {
2619
+ prompts :{ } ,
2620
+ } ;
2621
+ }
2622
+
2623
+ const response = await this . axios . get < TypesGen . AITasksPromptsResponse > (
2624
+ "/api/experimental/aitasks/prompts" ,
2625
+ {
2626
+ params :{
2627
+ build_ids :buildIds . join ( "," ) ,
2628
+ } ,
2629
+ } ,
2630
+ ) ;
2631
+
2632
+ return response . data ;
2633
+ } ;
2634
+ }
2635
+
2602
2636
// This is a hard coded CSRF token/cookie pair for local development. In prod,
2603
2637
// the GoLang webserver generates a random cookie with a new token for each
2604
2638
// document request. For local development, we don't use the Go webserver for