Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63631b5

Browse files
authored
chore(coderd): aitasks: add internal-only api doc comments (#20020)
Adds api doc comments calling out experimental status.Should be merged alongside#20019
1 parentd0f434b commit63631b5

File tree

5 files changed

+1421
-2
lines changed

5 files changed

+1421
-2
lines changed

‎coderd/aitasks.go‎

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,18 @@ func (api *API) aiTasksPrompts(rw http.ResponseWriter, r *http.Request) {
8282
})
8383
}
8484

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.
8797
func (api*API)tasksCreate(rw http.ResponseWriter,r*http.Request) {
8898
var (
8999
ctx=r.Context()
@@ -316,6 +326,19 @@ type tasksListResponse struct {
316326
Countint`json:"count"`
317327
}
318328

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.
319342
// tasksList is an experimental endpoint to list AI tasks by mapping
320343
// workspaces to a task-shaped response.
321344
func (api*API)tasksList(rw http.ResponseWriter,r*http.Request) {
@@ -419,6 +442,17 @@ func (api *API) tasksList(rw http.ResponseWriter, r *http.Request) {
419442
})
420443
}
421444

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.
422456
// taskGet is an experimental endpoint to fetch a single AI task by ID
423457
// (workspace ID). It returns a synthesized task response including
424458
// prompt and status.
@@ -525,6 +559,17 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) {
525559
httpapi.Write(ctx,rw,http.StatusOK,tasks[0])
526560
}
527561

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.
528573
// taskDelete is an experimental endpoint to delete a task by ID (workspace ID).
529574
// It creates a delete workspace build and returns 202 Accepted if the build was
530575
// created.
@@ -600,6 +645,18 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
600645
rw.WriteHeader(http.StatusAccepted)
601646
}
602647

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.
603660
// taskSend submits task input to the tasks sidebar app by dialing the agent
604661
// directly over the tailnet. We enforce ApplicationConnect RBAC on the
605662
// workspace and validate the sidebar app health.
@@ -670,6 +727,19 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
670727
rw.WriteHeader(http.StatusNoContent)
671728
}
672729

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.
673743
func (api*API)taskLogs(rw http.ResponseWriter,r*http.Request) {
674744
ctx:=r.Context()
675745

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp