@@ -82,8 +82,18 @@ func (api *API) aiTasksPrompts(rw http.ResponseWriter, r *http.Request) {
82
82
})
83
83
}
84
84
85
- // This endpoint is experimental and not guaranteed to be stable, so we're not
86
- // generating public-facing documentation for it.
85
+ // @Summary Create a new AI task
86
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
87
+ // @ID create-task
88
+ // @Security CoderSessionToken
89
+ // @Tags Experimental
90
+ // @Param user path string true "Username, user ID, or 'me' for the authenticated user"
91
+ // @Param request body codersdk.CreateTaskRequest true "Create task request"
92
+ // @Success 201 {object} codersdk.Task
93
+ // @Router /api/experimental/tasks/{user} [post]
94
+ //
95
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
96
+ // This endpoint creates a new task for the given user.
87
97
func (api * API )tasksCreate (rw http.ResponseWriter ,r * http.Request ) {
88
98
var (
89
99
ctx = r .Context ()
@@ -316,6 +326,19 @@ type tasksListResponse struct {
316
326
Count int `json:"count"`
317
327
}
318
328
329
+ // @Summary List AI tasks
330
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
331
+ // @ID list-tasks
332
+ // @Security CoderSessionToken
333
+ // @Tags Experimental
334
+ // @Param q query string false "Search query for filtering tasks"
335
+ // @Param after_id query string false "Return tasks after this ID for pagination"
336
+ // @Param limit query int false "Maximum number of tasks to return" minimum(1) maximum(100) default(25)
337
+ // @Param offset query int false "Offset for pagination" minimum(0) default(0)
338
+ // @Success 200 {object} coderd.tasksListResponse
339
+ // @Router /api/experimental/tasks [get]
340
+ //
341
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
319
342
// tasksList is an experimental endpoint to list AI tasks by mapping
320
343
// workspaces to a task-shaped response.
321
344
func (api * API )tasksList (rw http.ResponseWriter ,r * http.Request ) {
@@ -419,6 +442,17 @@ func (api *API) tasksList(rw http.ResponseWriter, r *http.Request) {
419
442
})
420
443
}
421
444
445
+ // @Summary Get AI task by ID
446
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
447
+ // @ID get-task
448
+ // @Security CoderSessionToken
449
+ // @Tags Experimental
450
+ // @Param user path string true "Username, user ID, or 'me' for the authenticated user"
451
+ // @Param id path string true "Task ID" format(uuid)
452
+ // @Success 200 {object} codersdk.Task
453
+ // @Router /api/experimental/tasks/{user}/{id} [get]
454
+ //
455
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
422
456
// taskGet is an experimental endpoint to fetch a single AI task by ID
423
457
// (workspace ID). It returns a synthesized task response including
424
458
// prompt and status.
@@ -525,6 +559,17 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) {
525
559
httpapi .Write (ctx ,rw ,http .StatusOK ,tasks [0 ])
526
560
}
527
561
562
+ // @Summary Delete AI task by ID
563
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
564
+ // @ID delete-task
565
+ // @Security CoderSessionToken
566
+ // @Tags Experimental
567
+ // @Param user path string true "Username, user ID, or 'me' for the authenticated user"
568
+ // @Param id path string true "Task ID" format(uuid)
569
+ // @Success 202 "Task deletion initiated"
570
+ // @Router /api/experimental/tasks/{user}/{id} [delete]
571
+ //
572
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
528
573
// taskDelete is an experimental endpoint to delete a task by ID (workspace ID).
529
574
// It creates a delete workspace build and returns 202 Accepted if the build was
530
575
// created.
@@ -600,6 +645,18 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
600
645
rw .WriteHeader (http .StatusAccepted )
601
646
}
602
647
648
+ // @Summary Send input to AI task
649
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
650
+ // @ID send-task-input
651
+ // @Security CoderSessionToken
652
+ // @Tags Experimental
653
+ // @Param user path string true "Username, user ID, or 'me' for the authenticated user"
654
+ // @Param id path string true "Task ID" format(uuid)
655
+ // @Param request body codersdk.TaskSendRequest true "Task input request"
656
+ // @Success 204 "Input sent successfully"
657
+ // @Router /api/experimental/tasks/{user}/{id}/send [post]
658
+ //
659
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
603
660
// taskSend submits task input to the tasks sidebar app by dialing the agent
604
661
// directly over the tailnet. We enforce ApplicationConnect RBAC on the
605
662
// workspace and validate the sidebar app health.
@@ -670,6 +727,19 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
670
727
rw .WriteHeader (http .StatusNoContent )
671
728
}
672
729
730
+ // @Summary Get AI task logs
731
+ // @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
732
+ // @ID get-task-logs
733
+ // @Security CoderSessionToken
734
+ // @Tags Experimental
735
+ // @Param user path string true "Username, user ID, or 'me' for the authenticated user"
736
+ // @Param id path string true "Task ID" format(uuid)
737
+ // @Success 200 {object} codersdk.TaskLogsResponse
738
+ // @Router /api/experimental/tasks/{user}/{id}/logs [get]
739
+ //
740
+ // EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
741
+ // taskLogs reads task output by dialing the agent directly over the tailnet.
742
+ // We enforce ApplicationConnect RBAC on the workspace and validate the sidebar app health.
673
743
func (api * API )taskLogs (rw http.ResponseWriter ,r * http.Request ) {
674
744
ctx := r .Context ()
675
745