Files
byre/internal/api/api.gen.go
T
2026-10-16 08:37:24 -07:00

3163 lines
113 KiB
Go

//go:build go1.22
// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
package api
import (
"bytes"
"compress/flate"
"encoding/base64"
"errors"
"fmt"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/getkin/kin-openapi/openapi3"
"github.com/oapi-codegen/runtime"
)
// Defines values for AgentProcessHealth.
const (
HealthExited AgentProcessHealth = "exited"
HealthOk AgentProcessHealth = "ok"
HealthStuck AgentProcessHealth = "stuck"
)
// Valid indicates whether the value is a known member of the AgentProcessHealth enum.
func (e AgentProcessHealth) Valid() bool {
switch e {
case HealthExited:
return true
case HealthOk:
return true
case HealthStuck:
return true
default:
return false
}
}
// Defines values for AgentSessionRole.
const (
Implementer AgentSessionRole = "implementer"
Lead AgentSessionRole = "lead"
Reviewer AgentSessionRole = "reviewer"
)
// Valid indicates whether the value is a known member of the AgentSessionRole enum.
func (e AgentSessionRole) Valid() bool {
switch e {
case Implementer:
return true
case Lead:
return true
case Reviewer:
return true
default:
return false
}
}
// Defines values for AgentSessionState.
const (
AgentSessionStateCompleted AgentSessionState = "completed"
AgentSessionStateIdle AgentSessionState = "idle"
AgentSessionStateRunning AgentSessionState = "running"
)
// Valid indicates whether the value is a known member of the AgentSessionState enum.
func (e AgentSessionState) Valid() bool {
switch e {
case AgentSessionStateCompleted:
return true
case AgentSessionStateIdle:
return true
case AgentSessionStateRunning:
return true
default:
return false
}
}
// Defines values for AgentSessionVendor.
const (
Claude AgentSessionVendor = "claude"
Codex AgentSessionVendor = "codex"
)
// Valid indicates whether the value is a known member of the AgentSessionVendor enum.
func (e AgentSessionVendor) Valid() bool {
switch e {
case Claude:
return true
case Codex:
return true
default:
return false
}
}
// Defines values for AttachmentKind.
const (
AttachmentKindDiagram AttachmentKind = "diagram"
AttachmentKindDiff AttachmentKind = "diff"
AttachmentKindFile AttachmentKind = "file"
AttachmentKindImage AttachmentKind = "image"
AttachmentKindSnapshot AttachmentKind = "snapshot"
AttachmentKindTask AttachmentKind = "task"
AttachmentKindUrl AttachmentKind = "url"
)
// Valid indicates whether the value is a known member of the AttachmentKind enum.
func (e AttachmentKind) Valid() bool {
switch e {
case AttachmentKindDiagram:
return true
case AttachmentKindDiff:
return true
case AttachmentKindFile:
return true
case AttachmentKindImage:
return true
case AttachmentKindSnapshot:
return true
case AttachmentKindTask:
return true
case AttachmentKindUrl:
return true
default:
return false
}
}
// Defines values for DirEntryType.
const (
DirEntryTypeDir DirEntryType = "dir"
DirEntryTypeFile DirEntryType = "file"
DirEntryTypeOther DirEntryType = "other"
)
// Valid indicates whether the value is a known member of the DirEntryType enum.
func (e DirEntryType) Valid() bool {
switch e {
case DirEntryTypeDir:
return true
case DirEntryTypeFile:
return true
case DirEntryTypeOther:
return true
default:
return false
}
}
// Defines values for FileChangeStatus.
const (
Added FileChangeStatus = "added"
Deleted FileChangeStatus = "deleted"
Modified FileChangeStatus = "modified"
Renamed FileChangeStatus = "renamed"
TypeChanged FileChangeStatus = "type_changed"
)
// Valid indicates whether the value is a known member of the FileChangeStatus enum.
func (e FileChangeStatus) Valid() bool {
switch e {
case Added:
return true
case Deleted:
return true
case Modified:
return true
case Renamed:
return true
case TypeChanged:
return true
default:
return false
}
}
// Defines values for InboxItemKind.
const (
Question InboxItemKind = "question"
RateLimited InboxItemKind = "rate_limited"
SessionError InboxItemKind = "session_error"
)
// Valid indicates whether the value is a known member of the InboxItemKind enum.
func (e InboxItemKind) Valid() bool {
switch e {
case Question:
return true
case RateLimited:
return true
case SessionError:
return true
default:
return false
}
}
// Defines values for InboxResponseType.
const (
Dismiss InboxResponseType = "dismiss"
Option InboxResponseType = "option"
Other InboxResponseType = "other"
)
// Valid indicates whether the value is a known member of the InboxResponseType enum.
func (e InboxResponseType) Valid() bool {
switch e {
case Dismiss:
return true
case Option:
return true
case Other:
return true
default:
return false
}
}
// Defines values for InboxState.
const (
Answered InboxState = "answered"
Dismissed InboxState = "dismissed"
Open InboxState = "open"
Superseded InboxState = "superseded"
)
// Valid indicates whether the value is a known member of the InboxState enum.
func (e InboxState) Valid() bool {
switch e {
case Answered:
return true
case Dismissed:
return true
case Open:
return true
case Superseded:
return true
default:
return false
}
}
// Defines values for ReviewState.
const (
ReviewStateDone ReviewState = "done"
ReviewStateFailed ReviewState = "failed"
ReviewStateRunning ReviewState = "running"
ReviewStateSkipped ReviewState = "skipped"
)
// Valid indicates whether the value is a known member of the ReviewState enum.
func (e ReviewState) Valid() bool {
switch e {
case ReviewStateDone:
return true
case ReviewStateFailed:
return true
case ReviewStateRunning:
return true
case ReviewStateSkipped:
return true
default:
return false
}
}
// Defines values for SnapshotTrigger.
const (
SnapshotTriggerAskHuman SnapshotTrigger = "ask_human"
SnapshotTriggerMessage SnapshotTrigger = "message"
SnapshotTriggerTimer SnapshotTrigger = "timer"
SnapshotTriggerToolCall SnapshotTrigger = "tool_call"
SnapshotTriggerTurnEnd SnapshotTrigger = "turn_end"
)
// Valid indicates whether the value is a known member of the SnapshotTrigger enum.
func (e SnapshotTrigger) Valid() bool {
switch e {
case SnapshotTriggerAskHuman:
return true
case SnapshotTriggerMessage:
return true
case SnapshotTriggerTimer:
return true
case SnapshotTriggerToolCall:
return true
case SnapshotTriggerTurnEnd:
return true
default:
return false
}
}
// Defines values for StageBase.
const (
StageBaseMain StageBase = "main"
StageBaseParent StageBase = "parent"
)
// Valid indicates whether the value is a known member of the StageBase enum.
func (e StageBase) Valid() bool {
switch e {
case StageBaseMain:
return true
case StageBaseParent:
return true
default:
return false
}
}
// Defines values for TaskStatus.
const (
TaskStatusActive TaskStatus = "active"
TaskStatusDiscarded TaskStatus = "discarded"
TaskStatusMerged TaskStatus = "merged"
)
// Valid indicates whether the value is a known member of the TaskStatus enum.
func (e TaskStatus) Valid() bool {
switch e {
case TaskStatusActive:
return true
case TaskStatusDiscarded:
return true
case TaskStatusMerged:
return true
default:
return false
}
}
// Defines values for TaskTab.
const (
TabChanges TaskTab = "changes"
TabFiles TaskTab = "files"
TabInbox TaskTab = "inbox"
TabProject TaskTab = "project"
TabReviews TaskTab = "reviews"
TabTerminal TaskTab = "terminal"
TabTranscript TaskTab = "transcript"
)
// Valid indicates whether the value is a known member of the TaskTab enum.
func (e TaskTab) Valid() bool {
switch e {
case TabChanges:
return true
case TabFiles:
return true
case TabInbox:
return true
case TabProject:
return true
case TabReviews:
return true
case TabTerminal:
return true
case TabTranscript:
return true
default:
return false
}
}
// Defines values for ZombieKind.
const (
ProcessWithoutSession ZombieKind = "process_without_session"
RunningWithoutProcess ZombieKind = "running_without_process"
)
// Valid indicates whether the value is a known member of the ZombieKind enum.
func (e ZombieKind) Valid() bool {
switch e {
case ProcessWithoutSession:
return true
case RunningWithoutProcess:
return true
default:
return false
}
}
// AgentProcess defines model for AgentProcess.
type AgentProcess struct {
// Health stuck means a turn is running and no stream event has arrived for stuck_after_seconds; exited means the process is gone.
Health AgentProcessHealth `json:"health"`
// LastEventAt When the process last wrote a line to its stream
LastEventAt time.Time `json:"last_event_at"`
Pid int `json:"pid"`
SessionId string `json:"session_id"`
// State The session's state
State string `json:"state"`
TaskId string `json:"task_id"`
Vendor string `json:"vendor"`
}
// AgentProcessHealth stuck means a turn is running and no stream event has arrived for stuck_after_seconds; exited means the process is gone.
type AgentProcessHealth string
// AgentSession defines model for AgentSession.
type AgentSession struct {
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
// ForkedAt With forked_from: the vendor's id of the last thing the fork keeps, a message for Claude Code, a turn for Codex.
ForkedAt *string `json:"forked_at,omitempty"`
// ForkedFrom A fork's first start resumes this vendor session, cut at forked_at, under a new vendor_session_id; absent for other sessions.
ForkedFrom *string `json:"forked_from,omitempty"`
Id string `json:"id"`
// Model Requested model; empty means the vendor's default. A session only switches between its own vendor's models.
Model string `json:"model"`
// Owner The login whose lead agent this is; empty for a task's session.
Owner string `json:"owner"`
// Role reviewer: a review's session (see Review); a task's sessions list leaves these out.
Role AgentSessionRole `json:"role"`
State AgentSessionState `json:"state"`
// TaskId Empty for a lead session.
TaskId string `json:"task_id"`
// Vendor Follows from the model the session was created with: gpt-* models run on Codex, every other model on Claude Code.
Vendor AgentSessionVendor `json:"vendor"`
// VendorSessionId Claude Code's session id, chosen by byre; or the Codex thread id, empty until the session's first turn starts its thread.
VendorSessionId string `json:"vendor_session_id"`
}
// AgentSessionRole reviewer: a review's session (see Review); a task's sessions list leaves these out.
type AgentSessionRole string
// AgentSessionState defines model for AgentSession.State.
type AgentSessionState string
// AgentSessionVendor Follows from the model the session was created with: gpt-* models run on Codex, every other model on Claude Code.
type AgentSessionVendor string
// Attachment defines model for Attachment.
type Attachment struct {
Caption *string `json:"caption,omitempty"`
EndLine *int `json:"end_line,omitempty"`
// Image image: data URL.
Image *string `json:"image,omitempty"`
Kind AttachmentKind `json:"kind"`
// Mermaid diagram: Mermaid source.
Mermaid *string `json:"mermaid,omitempty"`
// Path file: repo-relative path. image: an image file in the task's worktree, absolute or relative to it.
Path *string `json:"path,omitempty"`
// Ref diff: git revision range.
Ref *string `json:"ref,omitempty"`
SnapshotId *string `json:"snapshot_id,omitempty"`
StartLine *int `json:"start_line,omitempty"`
TaskId *string `json:"task_id,omitempty"`
Url *string `json:"url,omitempty"`
}
// AttachmentKind defines model for Attachment.Kind.
type AttachmentKind string
// Blob defines model for Blob.
type Blob struct {
ContentType string `json:"content_type"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
Id string `json:"id"`
}
// DirEntry defines model for DirEntry.
type DirEntry struct {
// Ignored git ignores the entry: .gitignore and the other exclude files match it or a directory above it.
Ignored bool `json:"ignored"`
Name string `json:"name"`
// Size file: its size in bytes.
Size int64 `json:"size"`
Symlink bool `json:"symlink"`
// Type What the entry is, following a symlink that stays in the worktree. other: a symlink that leaves the worktree or points nowhere, or a device, socket or pipe.
Type DirEntryType `json:"type"`
}
// DirEntryType What the entry is, following a symlink that stays in the worktree. other: a symlink that leaves the worktree or points nowhere, or a device, socket or pipe.
type DirEntryType string
// DirListing defines model for DirListing.
type DirListing struct {
Entries []DirEntry `json:"entries"`
// Path The directory, relative to the worktree root; empty for the root.
Path string `json:"path"`
// Truncated The directory has more entries than were returned.
Truncated bool `json:"truncated"`
}
// Error defines model for Error.
type Error struct {
Message string `json:"message"`
}
// Event defines model for Event.
type Event struct {
Actor string `json:"actor"`
AgentSessionId *string `json:"agent_session_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
Kind string `json:"kind"`
// Owner Set on a lead agent's events and a user's focus.updated: the login they belong to. Only that user is sent them.
Owner *string `json:"owner,omitempty"`
Payload map[string]interface{} `json:"payload"`
ProjectId *string `json:"project_id,omitempty"`
Seq int64 `json:"seq"`
TaskId *string `json:"task_id,omitempty"`
}
// FileChange defines model for FileChange.
type FileChange struct {
Additions int `json:"additions"`
Binary bool `json:"binary"`
Deletions int `json:"deletions"`
// OldPath renamed: the path before the rename.
OldPath *string `json:"old_path,omitempty"`
Path string `json:"path"`
Status FileChangeStatus `json:"status"`
}
// FileChangeStatus defines model for FileChange.Status.
type FileChangeStatus string
// FileContent defines model for FileContent.
type FileContent struct {
// Binary The file isn't UTF-8 text; text is empty.
Binary bool `json:"binary"`
Path string `json:"path"`
Size int64 `json:"size"`
Text string `json:"text"`
// Truncated text holds only the start of the file.
Truncated bool `json:"truncated"`
}
// FileDiff defines model for FileDiff.
type FileDiff struct {
Patch string `json:"patch"`
Path string `json:"path"`
}
// Focus defines model for Focus.
type Focus struct {
// ProjectId The project the right pane shows; the task's project when task_id is set
ProjectId *string `json:"project_id,omitempty"`
Tab TaskTab `json:"tab"`
// Tabs The tabs the lead put first, in order. The other task tabs follow them.
Tabs []TaskTab `json:"tabs"`
// TaskId The task the right pane shows; absent for none.
TaskId *string `json:"task_id,omitempty"`
}
// InboxItem defines model for InboxItem.
type InboxItem struct {
AgentSessionId string `json:"agent_session_id"`
CreatedAt time.Time `json:"created_at"`
Id string `json:"id"`
Kind InboxItemKind `json:"kind"`
// Payload question: context (Markdown with the choices inline as `- ( ) text` / `- (*) text` pick-one or `- [ ] text` / `- [x] text` pick-any list items), question, why_blocked, options (each choice's text, in order), multiple (true for pick-any), recommended (the marked choices' text), attachments. session_error: error. rate_limited: vendor, rate_limit (the vendor's rate-limit status), error.
Payload map[string]interface{} `json:"payload"`
ProjectId string `json:"project_id"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
ResolvedBy *string `json:"resolved_by,omitempty"`
Responses []InboxResponse `json:"responses"`
// Reviews question: the review of the first snapshot the task took after the question was asked (the snapshot at the end of the turn that asked it), once that snapshot exists; empty for other items.
Reviews []Review `json:"reviews"`
State InboxState `json:"state"`
TaskId string `json:"task_id"`
ThreadId string `json:"thread_id"`
}
// InboxItemKind defines model for InboxItem.Kind.
type InboxItemKind string
// InboxRespond defines model for InboxRespond.
type InboxRespond struct {
Responses []InboxResponseCreate `json:"responses"`
}
// InboxResponse defines model for InboxResponse.
type InboxResponse struct {
Attachments []Attachment `json:"attachments"`
CreatedAt time.Time `json:"created_at"`
DeliveredAt *time.Time `json:"delivered_at,omitempty"`
Id string `json:"id"`
ItemId string `json:"item_id"`
Options *[]string `json:"options,omitempty"`
Text *string `json:"text,omitempty"`
Type InboxResponseType `json:"type"`
User string `json:"user"`
}
// InboxResponseCreate defines model for InboxResponseCreate.
type InboxResponseCreate struct {
Attachments *[]Attachment `json:"attachments,omitempty"`
ItemId string `json:"item_id"`
// Options option: the chosen options; exactly one for a pick-one question, one or more for a pick-any question.
Options *[]string `json:"options,omitempty"`
// Text other: the text sent to the agent. option on a pick-any question: optional text sent along with the checked options.
Text *string `json:"text,omitempty"`
Type InboxResponseType `json:"type"`
}
// InboxResponseType defines model for InboxResponseType.
type InboxResponseType string
// InboxState defines model for InboxState.
type InboxState string
// MessageCreate defines model for MessageCreate.
type MessageCreate struct {
// Images Blob ids from uploadBlob, sent to the agent as images alongside the text.
Images *[]string `json:"images,omitempty"`
// Model Model for this turn and later ones. When it differs from the session's model, the session switches before the message is sent.
Model *string `json:"model,omitempty"`
// Text May be empty when images are given.
Text string `json:"text"`
}
// NotificationPrefs Which new inbox items and finished turns notify this user in their open byre pages.
type NotificationPrefs struct {
// Errors session_error items.
Errors bool `json:"errors"`
// Questions Questions. On by default.
Questions bool `json:"questions"`
// RateLimits rate_limited items.
RateLimits bool `json:"rate_limits"`
// Reports Task turns that end with a summary (turn.ended with summary: true).
Reports bool `json:"reports"`
}
// PaneFocus defines model for PaneFocus.
type PaneFocus struct {
// Focused True while the browser window has focus and the focused element is inside the right pane.
Focused bool `json:"focused"`
}
// Participant defines model for Participant.
type Participant struct {
DisplayName string `json:"display_name"`
GitEmail string `json:"git_email"`
// GitName Empty when the user hasn't set a git identity; they then get no trailer.
GitName string `json:"git_name"`
Login string `json:"login"`
}
// Preview defines model for Preview.
type Preview struct {
CreatedAt time.Time `json:"created_at"`
Name string `json:"name"`
// Port A port in the task's block, served at https://<byre's host>:<port>/.
Port int `json:"port"`
TaskId string `json:"task_id"`
}
// Project defines model for Project.
type Project struct {
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
DefaultBranch string `json:"default_branch"`
Id string `json:"id"`
Name string `json:"name"`
Remote string `json:"remote"`
RepoPath string `json:"repo_path"`
}
// ProjectCreate defines model for ProjectCreate.
type ProjectCreate struct {
Name string `json:"name"`
RepoPath string `json:"repo_path"`
}
// ProtocolError defines model for ProtocolError.
type ProtocolError struct {
At time.Time `json:"at"`
// Raw The line as received
Raw string `json:"raw"`
Reason string `json:"reason"`
SessionId string `json:"session_id"`
// Size The line's full length in bytes.
Size int `json:"size"`
Vendor string `json:"vendor"`
}
// ProtocolErrors defines model for ProtocolErrors.
type ProtocolErrors struct {
// Counts Stream lines the adapter couldn't parse or didn't recognise since byre started, keyed by vendor.
Counts map[string]int `json:"counts"`
// Recent The most recent ones, newest first.
Recent []ProtocolError `json:"recent"`
}
// Review An agent session on the vendor the task's agent doesn't use, reviewing one snapshot's change.
type Review struct {
// AgentSessionId The reviewer's session; empty when skipped.
AgentSessionId string `json:"agent_session_id"`
CreatedAt time.Time `json:"created_at"`
// Error failed: why.
Error string `json:"error"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Id string `json:"id"`
// Model Empty when skipped.
Model string `json:"model"`
// Result done: the reviewer's submit_review arguments: summary (Markdown) and findings, each with severity, category, title, detail, path and line.
Result *map[string]interface{} `json:"result,omitempty"`
SnapshotN int `json:"snapshot_n"`
// State skipped: the snapshot's step changed no files, so no reviewer ran.
State ReviewState `json:"state"`
TaskId string `json:"task_id"`
// Vendor Empty when skipped.
Vendor string `json:"vendor"`
}
// ReviewState skipped: the snapshot's step changed no files, so no reviewer ran.
type ReviewState string
// SessionCreate defines model for SessionCreate.
type SessionCreate struct {
// Images Blob ids from uploadBlob, sent to the agent as images alongside the prompt.
Images *[]string `json:"images,omitempty"`
Model *string `json:"model,omitempty"`
Prompt string `json:"prompt"`
}
// Snapshot defines model for Snapshot.
type Snapshot struct {
AgentSessionId string `json:"agent_session_id"`
// CommitSha A commit of tree_sha whose parent is the worktree's HEAD when it was taken.
CommitSha string `json:"commit_sha"`
CreatedAt time.Time `json:"created_at"`
// EventSeq The task's latest event when the snapshot was started: the tree holds at least the work up to it.
EventSeq int64 `json:"event_seq"`
Id string `json:"id"`
// N Position in the task's snapshots, from 1; the ref is refs/byre/tasks/{task_id}/snap/{n}.
N int `json:"n"`
TaskId string `json:"task_id"`
TreeSha string `json:"tree_sha"`
// Trigger turn_end: after byre's end-of-turn commit. message (the agent wrote text after one or more tool calls), tool_call, ask_human and timer appear only on snapshots taken by earlier builds.
Trigger SnapshotTrigger `json:"trigger"`
}
// SnapshotTrigger turn_end: after byre's end-of-turn commit. message (the agent wrote text after one or more tool calls), tool_call, ask_human and timer appear only on snapshots taken by earlier builds.
type SnapshotTrigger string
// Stage defines model for Stage.
type Stage struct {
// After The stages whose outputs this stage gets, by name; it starts once all of them have finished. Absent means the previous stage in the list (for the first stage, none); empty means it starts from the brief.
After *[]string `json:"after,omitempty"`
// Base Where the stage's task branches from. parent (the default): the commit its one after stage finished at, or for a stage with none, where the workflow was started from. main: the project's default branch. Refused on a stage with more than one after stage, which always branches from the default branch.
Base *StageBase `json:"base,omitempty"`
// Model The stage agent's model, which also picks its vendor: gpt-* models run on Codex, every other model on Claude Code.
Model string `json:"model"`
// Name One line of 1 to 100 characters, unique within the workflow.
Name string `json:"name"`
// Prompt The stage agent's instructions.
Prompt string `json:"prompt"`
}
// StageBase Where the stage's task branches from. parent (the default): the commit its one after stage finished at, or for a stage with none, where the workflow was started from. main: the project's default branch. Refused on a stage with more than one after stage, which always branches from the default branch.
type StageBase string
// Status defines model for Status.
type Status struct {
ActiveTasks int `json:"active_tasks"`
// AgentProcesses Every agent process byre is tracking, idle sessions included.
AgentProcesses []AgentProcess `json:"agent_processes"`
DbBytes int64 `json:"db_bytes"`
LastEventSeq int64 `json:"last_event_seq"`
// LiveAgents Agent processes currently running.
LiveAgents int `json:"live_agents"`
Projects int `json:"projects"`
ProtocolErrors ProtocolErrors `json:"protocol_errors"`
// RateLimits The latest rate-limit status each vendor reported, keyed by vendor.
RateLimits map[string]map[string]interface{} `json:"rate_limits"`
// RunningTurns Turns running now, oldest session first.
RunningTurns []TurnRef `json:"running_turns"`
SseClients int `json:"sse_clients"`
StartedAt time.Time `json:"started_at"`
// StuckAfterSeconds How long a running turn may go without a stream event before it counts as stuck.
StuckAfterSeconds int `json:"stuck_after_seconds"`
// Zombies Sessions marked running with no live process, and agent processes byre has no session for.
Zombies []Zombie `json:"zombies"`
}
// Task defines model for Task.
type Task struct {
BaseRef string `json:"base_ref"`
Branch string `json:"branch"`
// ClosedAt When the task was merged or discarded.
ClosedAt *time.Time `json:"closed_at,omitempty"`
// Color Index into the UI's task palette, assigned at creation: a colour no active task holds, the one given out longest ago.
Color int `json:"color"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
// ForkedAt With forked_from: the n of the snapshot it was forked at.
ForkedAt *int `json:"forked_at,omitempty"`
// ForkedFrom The task this one was forked from; absent for other tasks.
ForkedFrom *string `json:"forked_from,omitempty"`
Id string `json:"id"`
// MergeCommit merged: the squash commit on the default branch; empty when there was nothing to merge.
MergeCommit *string `json:"merge_commit,omitempty"`
// MergeQueuedAt When Merge was requested while another task in the project was merging; absent once the merge starts or when none is held.
MergeQueuedAt *time.Time `json:"merge_queued_at,omitempty"`
// MergeTitle The title of the squash commit Merge makes: the task title until the agent sets another with set_merge_title.
MergeTitle string `json:"merge_title"`
// PortBase The first of the task's block of ports (port_base to port_base+9), passed to its agent and terminal as PORT.
PortBase int `json:"port_base"`
ProjectId string `json:"project_id"`
// Reviewing Whether a review of one of the task's snapshots is running.
Reviewing bool `json:"reviewing"`
Status TaskStatus `json:"status"`
Title string `json:"title"`
// TodoItem The title of the TODO.md item the task was started from; absent for other tasks.
TodoItem *string `json:"todo_item,omitempty"`
// Workflow The name of the workflow the task froze at creation (getTaskWorkflow has its copy); absent for a task without one.
Workflow *string `json:"workflow,omitempty"`
// WorkflowRun With workflow: the id every task of one run of the workflow shares.
WorkflowRun *string `json:"workflow_run,omitempty"`
// WorkflowStage With workflow: the name of the stage this task runs.
WorkflowStage *string `json:"workflow_stage,omitempty"`
WorktreePath string `json:"worktree_path"`
}
// TaskStatus defines model for Task.Status.
type TaskStatus string
// TaskChanges defines model for TaskChanges.
type TaskChanges struct {
// Base The commit or tree compared with: the merge-base of the task branch and the default branch, since, or the previous snapshot's tree.
Base string `json:"base"`
Files []FileChange `json:"files"`
// Tree Tree of the worktree as if everything were staged, or the snapshot's tree.
Tree string `json:"tree"`
}
// TaskCreate defines model for TaskCreate.
type TaskCreate struct {
Title string `json:"title"`
}
// TaskTab defines model for TaskTab.
type TaskTab string
// TaskWorkflow The workflow a task froze when it was created, as it was then.
type TaskWorkflow struct {
// Definition The WorkflowDefinition as YAML.
Definition string `json:"definition"`
Name string `json:"name"`
}
// TerminalSize defines model for TerminalSize.
type TerminalSize struct {
Cols int `json:"cols"`
Rows int `json:"rows"`
}
// Todo defines model for Todo.
type Todo struct {
// Exists Whether the default branch has a TODO.md at its root.
Exists bool `json:"exists"`
Items []TodoItem `json:"items"`
}
// TodoItem defines model for TodoItem.
type TodoItem struct {
// Body The item's further lines
Body string `json:"body"`
// Section The text of the nearest heading above the item; empty when there is none.
Section string `json:"section"`
// Title The item's first line, without its list marker: the item's identity.
Title string `json:"title"`
}
// TodoStart defines model for TodoStart.
type TodoStart struct {
Model *string `json:"model,omitempty"`
// Title The title of the item to start.
Title string `json:"title"`
}
// TurnRef defines model for TurnRef.
type TurnRef struct {
SessionId string `json:"session_id"`
TaskId string `json:"task_id"`
Vendor string `json:"vendor"`
}
// Unmerged defines model for Unmerged.
type Unmerged struct {
// Commits Commits on the task branch that aren't on the default branch.
Commits int `json:"commits"`
Deletions int `json:"deletions"`
// Files Files that differ from the merge base
Files int `json:"files"`
Insertions int `json:"insertions"`
// Uncommitted Paths with uncommitted changes in the worktree.
Uncommitted int `json:"uncommitted"`
}
// User defines model for User.
type User struct {
DisplayName string `json:"display_name"`
GitEmail string `json:"git_email"`
GitName string `json:"git_name"`
Login string `json:"login"`
// NotificationPrefs Which new inbox items and finished turns notify this user in their open byre pages.
NotificationPrefs NotificationPrefs `json:"notification_prefs"`
}
// UserUpdate defines model for UserUpdate.
type UserUpdate struct {
GitEmail string `json:"git_email"`
GitName string `json:"git_name"`
}
// WorkflowDefinition A workflow's file, which holds everything but its name: its stages, each run as its own task once the stages it comes after have finished. Sent and returned as YAML.
type WorkflowDefinition struct {
Description string `json:"description,omitempty"`
Stages []Stage `json:"stages"`
}
// WorkflowSummary defines model for WorkflowSummary.
type WorkflowSummary struct {
Description string `json:"description"`
Name string `json:"name"`
}
// Zombie defines model for Zombie.
type Zombie struct {
Detail string `json:"detail"`
Kind ZombieKind `json:"kind"`
Pid *int `json:"pid,omitempty"`
SessionId *string `json:"session_id,omitempty"`
TaskId *string `json:"task_id,omitempty"`
}
// ZombieKind defines model for Zombie.Kind.
type ZombieKind string
// StreamEventsParams defines parameters for StreamEvents.
type StreamEventsParams struct {
After *int64 `form:"after,omitempty" json:"after,omitempty"`
TaskId *string `form:"task_id,omitempty" json:"task_id,omitempty"`
Lead *bool `form:"lead,omitempty" json:"lead,omitempty"`
LastEventID *int64 `json:"Last-Event-ID,omitempty"`
}
// ListInboxParams defines parameters for ListInbox.
type ListInboxParams struct {
ProjectId *string `form:"project_id,omitempty" json:"project_id,omitempty"`
TaskId *string `form:"task_id,omitempty" json:"task_id,omitempty"`
State *InboxState `form:"state,omitempty" json:"state,omitempty"`
}
// GetTaskChangesParams defines parameters for GetTaskChanges.
type GetTaskChangesParams struct {
// Since A commit to compare with instead of the merge-base, such as a user.message event's head. Not allowed with snapshot.
Since *string `form:"since,omitempty" json:"since,omitempty"`
// Snapshot A snapshot's n: show the task as it was in that snapshot rather than the live worktree.
Snapshot *int `form:"snapshot,omitempty" json:"snapshot,omitempty"`
// Step With snapshot: compare with the previous snapshot (the snapshot commit's parent for the first one).
Step *bool `form:"step,omitempty" json:"step,omitempty"`
}
// GetTaskDiffParams defines parameters for GetTaskDiff.
type GetTaskDiffParams struct {
Base string `form:"base" json:"base"`
Tree string `form:"tree" json:"tree"`
Path string `form:"path" json:"path"`
OldPath *string `form:"old_path,omitempty" json:"old_path,omitempty"`
}
// GetTaskDirParams defines parameters for GetTaskDir.
type GetTaskDirParams struct {
// Path Slash-separated, relative to the worktree root; empty or absent for the root.
Path *string `form:"path,omitempty" json:"path,omitempty"`
}
// ListTaskEventsParams defines parameters for ListTaskEvents.
type ListTaskEventsParams struct {
After *int64 `form:"after,omitempty" json:"after,omitempty"`
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// GetTaskFileParams defines parameters for GetTaskFile.
type GetTaskFileParams struct {
// Path Slash-separated, relative to the worktree root.
Path string `form:"path" json:"path"`
}
// GetTaskImageParams defines parameters for GetTaskImage.
type GetTaskImageParams struct {
Path string `form:"path" json:"path"`
}
// MergeTaskJSONBody defines parameters for MergeTask.
type MergeTaskJSONBody struct {
// MergeTitle The squash commit's title: one line, at most 72 characters.
MergeTitle string `json:"merge_title"`
}
// GetTaskTerminalParams defines parameters for GetTaskTerminal.
type GetTaskTerminalParams struct {
Cols int `form:"cols" json:"cols"`
Rows int `form:"rows" json:"rows"`
}
// RespondInboxJSONRequestBody defines body for RespondInbox for application/json ContentType.
type RespondInboxJSONRequestBody = InboxRespond
// UpdateMeJSONRequestBody defines body for UpdateMe for application/json ContentType.
type UpdateMeJSONRequestBody = UserUpdate
// SetFocusJSONRequestBody defines body for SetFocus for application/json ContentType.
type SetFocusJSONRequestBody = Focus
// MessageLeadJSONRequestBody defines body for MessageLead for application/json ContentType.
type MessageLeadJSONRequestBody = MessageCreate
// UpdateNotificationPrefsJSONRequestBody defines body for UpdateNotificationPrefs for application/json ContentType.
type UpdateNotificationPrefsJSONRequestBody = NotificationPrefs
// SetPaneFocusJSONRequestBody defines body for SetPaneFocus for application/json ContentType.
type SetPaneFocusJSONRequestBody = PaneFocus
// CreateProjectJSONRequestBody defines body for CreateProject for application/json ContentType.
type CreateProjectJSONRequestBody = ProjectCreate
// CreateTaskJSONRequestBody defines body for CreateTask for application/json ContentType.
type CreateTaskJSONRequestBody = TaskCreate
// StartTodoItemJSONRequestBody defines body for StartTodoItem for application/json ContentType.
type StartTodoItemJSONRequestBody = TodoStart
// SendMessageJSONRequestBody defines body for SendMessage for application/json ContentType.
type SendMessageJSONRequestBody = MessageCreate
// MergeTaskJSONRequestBody defines body for MergeTask for application/json ContentType.
type MergeTaskJSONRequestBody MergeTaskJSONBody
// CreateSessionJSONRequestBody defines body for CreateSession for application/json ContentType.
type CreateSessionJSONRequestBody = SessionCreate
// ServerInterface represents all server handlers.
type ServerInterface interface {
// (GET /api/admin/status)
GetStatus(w http.ResponseWriter, r *http.Request)
// (POST /api/blobs)
UploadBlob(w http.ResponseWriter, r *http.Request)
// (GET /api/blobs/{blobId})
GetBlob(w http.ResponseWriter, r *http.Request, blobId string)
// (GET /api/events)
StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
// (GET /api/inbox)
ListInbox(w http.ResponseWriter, r *http.Request, params ListInboxParams)
// (POST /api/inbox/responses)
RespondInbox(w http.ResponseWriter, r *http.Request)
// (GET /api/inbox/{itemId})
GetInboxItem(w http.ResponseWriter, r *http.Request, itemId string)
// (GET /api/me)
GetMe(w http.ResponseWriter, r *http.Request)
// (PUT /api/me)
UpdateMe(w http.ResponseWriter, r *http.Request)
// (GET /api/me/focus)
GetFocus(w http.ResponseWriter, r *http.Request)
// (PUT /api/me/focus)
SetFocus(w http.ResponseWriter, r *http.Request)
// (POST /api/me/lead/messages)
MessageLead(w http.ResponseWriter, r *http.Request)
// (GET /api/me/lead/sessions)
ListLeadSessions(w http.ResponseWriter, r *http.Request)
// (PUT /api/me/notifications)
UpdateNotificationPrefs(w http.ResponseWriter, r *http.Request)
// (PUT /api/me/pane-focus)
SetPaneFocus(w http.ResponseWriter, r *http.Request)
// (GET /api/projects)
ListProjects(w http.ResponseWriter, r *http.Request)
// (POST /api/projects)
CreateProject(w http.ResponseWriter, r *http.Request)
// (GET /api/projects/{projectId})
GetProject(w http.ResponseWriter, r *http.Request, projectId string)
// (GET /api/projects/{projectId}/tasks)
ListTasks(w http.ResponseWriter, r *http.Request, projectId string)
// (POST /api/projects/{projectId}/tasks)
CreateTask(w http.ResponseWriter, r *http.Request, projectId string)
// (GET /api/projects/{projectId}/todo)
GetTodo(w http.ResponseWriter, r *http.Request, projectId string)
// (POST /api/projects/{projectId}/todo/tasks)
StartTodoItem(w http.ResponseWriter, r *http.Request, projectId string)
// (GET /api/sessions/{sessionId})
GetSession(w http.ResponseWriter, r *http.Request, sessionId string)
// (POST /api/sessions/{sessionId}/compact)
CompactSession(w http.ResponseWriter, r *http.Request, sessionId string)
// (POST /api/sessions/{sessionId}/interrupt)
InterruptSession(w http.ResponseWriter, r *http.Request, sessionId string)
// (POST /api/sessions/{sessionId}/messages)
SendMessage(w http.ResponseWriter, r *http.Request, sessionId string)
// (GET /api/tasks/{taskId})
GetTask(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/changes)
GetTaskChanges(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskChangesParams)
// (GET /api/tasks/{taskId}/co-authors)
GetCoAuthors(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/diff)
GetTaskDiff(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskDiffParams)
// (GET /api/tasks/{taskId}/dir)
GetTaskDir(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskDirParams)
// (POST /api/tasks/{taskId}/discard)
DiscardTask(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/events)
ListTaskEvents(w http.ResponseWriter, r *http.Request, taskId string, params ListTaskEventsParams)
// (GET /api/tasks/{taskId}/file)
GetTaskFile(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskFileParams)
// (GET /api/tasks/{taskId}/image)
GetTaskImage(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskImageParams)
// (POST /api/tasks/{taskId}/merge)
MergeTask(w http.ResponseWriter, r *http.Request, taskId string)
// (POST /api/tasks/{taskId}/merge-in)
MergeIn(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/previews)
ListPreviews(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/reviews)
ListReviews(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/sessions)
ListSessions(w http.ResponseWriter, r *http.Request, taskId string)
// (POST /api/tasks/{taskId}/sessions)
CreateSession(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/snapshots)
ListSnapshots(w http.ResponseWriter, r *http.Request, taskId string)
// (POST /api/tasks/{taskId}/snapshots/{n}/fork)
ForkSnapshot(w http.ResponseWriter, r *http.Request, taskId string, n int)
// (GET /api/tasks/{taskId}/terminal)
GetTaskTerminal(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskTerminalParams)
// (GET /api/tasks/{taskId}/unmerged)
GetUnmerged(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/tasks/{taskId}/workflow)
GetTaskWorkflow(w http.ResponseWriter, r *http.Request, taskId string)
// (GET /api/workflows)
ListWorkflows(w http.ResponseWriter, r *http.Request)
// (DELETE /api/workflows/{name})
DeleteWorkflow(w http.ResponseWriter, r *http.Request, name string)
// (GET /api/workflows/{name})
GetWorkflow(w http.ResponseWriter, r *http.Request, name string)
// (PUT /api/workflows/{name})
PutWorkflow(w http.ResponseWriter, r *http.Request, name string)
}
// ServerInterfaceWrapper converts contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type MiddlewareFunc func(http.Handler) http.Handler
// GetStatus operation middleware
func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetStatus(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// UploadBlob operation middleware
func (siw *ServerInterfaceWrapper) UploadBlob(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.UploadBlob(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetBlob operation middleware
func (siw *ServerInterfaceWrapper) GetBlob(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "blobId" -------------
var blobId string
err = runtime.BindStyledParameterWithOptions("simple", "blobId", r.PathValue("blobId"), &blobId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "blobId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetBlob(w, r, blobId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// StreamEvents operation middleware
func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// Parameter object where we will unmarshal all parameters from the context
var params StreamEventsParams
// ------------- Optional query parameter "after" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "after", r.URL.Query(), &params.After, runtime.BindQueryParameterOptions{Type: "integer", Format: "int64"})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "after"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "after", Err: err})
}
return
}
// ------------- Optional query parameter "task_id" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "task_id", r.URL.Query(), &params.TaskId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "task_id"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "task_id", Err: err})
}
return
}
// ------------- Optional query parameter "lead" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "lead", r.URL.Query(), &params.Lead, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "lead"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "lead", Err: err})
}
return
}
headers := r.Header
// ------------- Optional header parameter "Last-Event-ID" -------------
if valueList, found := headers[http.CanonicalHeaderKey("Last-Event-ID")]; found {
var LastEventID int64
n := len(valueList)
if n != 1 {
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Last-Event-ID", Count: n})
return
}
err = runtime.BindStyledParameterWithOptions("simple", "Last-Event-ID", valueList[0], &LastEventID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: "int64"})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Last-Event-ID", Err: err})
return
}
params.LastEventID = &LastEventID
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.StreamEvents(w, r, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListInbox operation middleware
func (siw *ServerInterfaceWrapper) ListInbox(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// Parameter object where we will unmarshal all parameters from the context
var params ListInboxParams
// ------------- Optional query parameter "project_id" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "project_id", r.URL.Query(), &params.ProjectId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "project_id"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "project_id", Err: err})
}
return
}
// ------------- Optional query parameter "task_id" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "task_id", r.URL.Query(), &params.TaskId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "task_id"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "task_id", Err: err})
}
return
}
// ------------- Optional query parameter "state" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "state", r.URL.Query(), &params.State, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "state"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListInbox(w, r, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// RespondInbox operation middleware
func (siw *ServerInterfaceWrapper) RespondInbox(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.RespondInbox(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetInboxItem operation middleware
func (siw *ServerInterfaceWrapper) GetInboxItem(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "itemId" -------------
var itemId string
err = runtime.BindStyledParameterWithOptions("simple", "itemId", r.PathValue("itemId"), &itemId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetInboxItem(w, r, itemId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetMe operation middleware
func (siw *ServerInterfaceWrapper) GetMe(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetMe(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// UpdateMe operation middleware
func (siw *ServerInterfaceWrapper) UpdateMe(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.UpdateMe(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetFocus operation middleware
func (siw *ServerInterfaceWrapper) GetFocus(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetFocus(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// SetFocus operation middleware
func (siw *ServerInterfaceWrapper) SetFocus(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.SetFocus(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// MessageLead operation middleware
func (siw *ServerInterfaceWrapper) MessageLead(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MessageLead(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListLeadSessions operation middleware
func (siw *ServerInterfaceWrapper) ListLeadSessions(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListLeadSessions(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// UpdateNotificationPrefs operation middleware
func (siw *ServerInterfaceWrapper) UpdateNotificationPrefs(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.UpdateNotificationPrefs(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// SetPaneFocus operation middleware
func (siw *ServerInterfaceWrapper) SetPaneFocus(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.SetPaneFocus(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListProjects operation middleware
func (siw *ServerInterfaceWrapper) ListProjects(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListProjects(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// CreateProject operation middleware
func (siw *ServerInterfaceWrapper) CreateProject(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.CreateProject(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetProject operation middleware
func (siw *ServerInterfaceWrapper) GetProject(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "projectId" -------------
var projectId string
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetProject(w, r, projectId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListTasks operation middleware
func (siw *ServerInterfaceWrapper) ListTasks(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "projectId" -------------
var projectId string
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListTasks(w, r, projectId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// CreateTask operation middleware
func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "projectId" -------------
var projectId string
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.CreateTask(w, r, projectId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTodo operation middleware
func (siw *ServerInterfaceWrapper) GetTodo(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "projectId" -------------
var projectId string
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTodo(w, r, projectId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// StartTodoItem operation middleware
func (siw *ServerInterfaceWrapper) StartTodoItem(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "projectId" -------------
var projectId string
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.StartTodoItem(w, r, projectId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetSession operation middleware
func (siw *ServerInterfaceWrapper) GetSession(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "sessionId" -------------
var sessionId string
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetSession(w, r, sessionId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// CompactSession operation middleware
func (siw *ServerInterfaceWrapper) CompactSession(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "sessionId" -------------
var sessionId string
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.CompactSession(w, r, sessionId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// InterruptSession operation middleware
func (siw *ServerInterfaceWrapper) InterruptSession(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "sessionId" -------------
var sessionId string
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.InterruptSession(w, r, sessionId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// SendMessage operation middleware
func (siw *ServerInterfaceWrapper) SendMessage(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "sessionId" -------------
var sessionId string
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.SendMessage(w, r, sessionId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTask operation middleware
func (siw *ServerInterfaceWrapper) GetTask(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTask(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskChanges operation middleware
func (siw *ServerInterfaceWrapper) GetTaskChanges(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskChangesParams
// ------------- Optional query parameter "since" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "since", r.URL.Query(), &params.Since, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "since"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "since", Err: err})
}
return
}
// ------------- Optional query parameter "snapshot" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "snapshot", r.URL.Query(), &params.Snapshot, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "snapshot"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "snapshot", Err: err})
}
return
}
// ------------- Optional query parameter "step" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "step", r.URL.Query(), &params.Step, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "step"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "step", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskChanges(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetCoAuthors operation middleware
func (siw *ServerInterfaceWrapper) GetCoAuthors(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetCoAuthors(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskDiff operation middleware
func (siw *ServerInterfaceWrapper) GetTaskDiff(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskDiffParams
// ------------- Required query parameter "base" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "base", r.URL.Query(), &params.Base, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "base"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "base", Err: err})
}
return
}
// ------------- Required query parameter "tree" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "tree", r.URL.Query(), &params.Tree, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "tree"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "tree", Err: err})
}
return
}
// ------------- Required query parameter "path" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), &params.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
}
return
}
// ------------- Optional query parameter "old_path" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "old_path", r.URL.Query(), &params.OldPath, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "old_path"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "old_path", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskDiff(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskDir operation middleware
func (siw *ServerInterfaceWrapper) GetTaskDir(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskDirParams
// ------------- Optional query parameter "path" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "path", r.URL.Query(), &params.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskDir(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// DiscardTask operation middleware
func (siw *ServerInterfaceWrapper) DiscardTask(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.DiscardTask(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListTaskEvents operation middleware
func (siw *ServerInterfaceWrapper) ListTaskEvents(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params ListTaskEventsParams
// ------------- Optional query parameter "after" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "after", r.URL.Query(), &params.After, runtime.BindQueryParameterOptions{Type: "integer", Format: "int64"})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "after"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "after", Err: err})
}
return
}
// ------------- Optional query parameter "limit" -------------
err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", r.URL.Query(), &params.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "limit"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListTaskEvents(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskFile operation middleware
func (siw *ServerInterfaceWrapper) GetTaskFile(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskFileParams
// ------------- Required query parameter "path" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), &params.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskFile(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskImage operation middleware
func (siw *ServerInterfaceWrapper) GetTaskImage(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskImageParams
// ------------- Required query parameter "path" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), &params.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskImage(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// MergeTask operation middleware
func (siw *ServerInterfaceWrapper) MergeTask(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MergeTask(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// MergeIn operation middleware
func (siw *ServerInterfaceWrapper) MergeIn(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MergeIn(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListPreviews operation middleware
func (siw *ServerInterfaceWrapper) ListPreviews(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListPreviews(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListReviews operation middleware
func (siw *ServerInterfaceWrapper) ListReviews(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListReviews(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListSessions operation middleware
func (siw *ServerInterfaceWrapper) ListSessions(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListSessions(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// CreateSession operation middleware
func (siw *ServerInterfaceWrapper) CreateSession(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.CreateSession(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListSnapshots operation middleware
func (siw *ServerInterfaceWrapper) ListSnapshots(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListSnapshots(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ForkSnapshot operation middleware
func (siw *ServerInterfaceWrapper) ForkSnapshot(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// ------------- Path parameter "n" -------------
var n int
err = runtime.BindStyledParameterWithOptions("simple", "n", r.PathValue("n"), &n, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "n", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ForkSnapshot(w, r, taskId, n)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskTerminal operation middleware
func (siw *ServerInterfaceWrapper) GetTaskTerminal(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
// Parameter object where we will unmarshal all parameters from the context
var params GetTaskTerminalParams
// ------------- Required query parameter "cols" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "cols", r.URL.Query(), &params.Cols, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "cols"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cols", Err: err})
}
return
}
// ------------- Required query parameter "rows" -------------
err = runtime.BindQueryParameterWithOptions("form", true, true, "rows", r.URL.Query(), &params.Rows, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
if err != nil {
var requiredError *runtime.RequiredParameterError
if errors.As(err, &requiredError) {
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "rows"})
} else {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rows", Err: err})
}
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskTerminal(w, r, taskId, params)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetUnmerged operation middleware
func (siw *ServerInterfaceWrapper) GetUnmerged(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetUnmerged(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetTaskWorkflow operation middleware
func (siw *ServerInterfaceWrapper) GetTaskWorkflow(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "taskId" -------------
var taskId string
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetTaskWorkflow(w, r, taskId)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// ListWorkflows operation middleware
func (siw *ServerInterfaceWrapper) ListWorkflows(w http.ResponseWriter, r *http.Request) {
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.ListWorkflows(w, r)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// DeleteWorkflow operation middleware
func (siw *ServerInterfaceWrapper) DeleteWorkflow(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "name" -------------
var name string
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.DeleteWorkflow(w, r, name)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// GetWorkflow operation middleware
func (siw *ServerInterfaceWrapper) GetWorkflow(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "name" -------------
var name string
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.GetWorkflow(w, r, name)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
// PutWorkflow operation middleware
func (siw *ServerInterfaceWrapper) PutWorkflow(w http.ResponseWriter, r *http.Request) {
var err error
_ = err
// ------------- Path parameter "name" -------------
var name string
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
if err != nil {
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
return
}
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
siw.Handler.PutWorkflow(w, r, name)
}))
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler.ServeHTTP(w, r)
}
type UnescapedCookieParamError struct {
ParamName string
Err error
}
func (e *UnescapedCookieParamError) Error() string {
return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName)
}
func (e *UnescapedCookieParamError) Unwrap() error {
return e.Err
}
type UnmarshalingParamError struct {
ParamName string
Err error
}
func (e *UnmarshalingParamError) Error() string {
return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error())
}
func (e *UnmarshalingParamError) Unwrap() error {
return e.Err
}
type RequiredParamError struct {
ParamName string
}
func (e *RequiredParamError) Error() string {
return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName)
}
type RequiredHeaderError struct {
ParamName string
Err error
}
func (e *RequiredHeaderError) Error() string {
return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName)
}
func (e *RequiredHeaderError) Unwrap() error {
return e.Err
}
type InvalidParamFormatError struct {
ParamName string
Err error
}
func (e *InvalidParamFormatError) Error() string {
return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error())
}
func (e *InvalidParamFormatError) Unwrap() error {
return e.Err
}
type TooManyValuesForParamError struct {
ParamName string
Count int
}
func (e *TooManyValuesForParamError) Error() string {
return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count)
}
// Handler creates http.Handler with routing matching OpenAPI spec.
func Handler(si ServerInterface) http.Handler {
return HandlerWithOptions(si, StdHTTPServerOptions{})
}
// ServeMux is an abstraction of [http.ServeMux].
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
http.Handler
}
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler {
return HandlerWithOptions(si, StdHTTPServerOptions{
BaseRouter: m,
})
}
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler {
return HandlerWithOptions(si, StdHTTPServerOptions{
BaseURL: baseURL,
BaseRouter: m,
})
}
// HandlerWithOptions creates http.Handler with additional options
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler {
m := options.BaseRouter
if m == nil {
m = http.NewServeMux()
}
if options.ErrorHandlerFunc == nil {
options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) {
http.Error(w, err.Error(), http.StatusBadRequest)
}
}
wrapper := ServerInterfaceWrapper{
Handler: si,
HandlerMiddlewares: options.Middlewares,
ErrorHandlerFunc: options.ErrorHandlerFunc,
}
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me", wrapper.GetMe)
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me", wrapper.UpdateMe)
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/notifications", wrapper.UpdateNotificationPrefs)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me/lead/sessions", wrapper.ListLeadSessions)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/me/lead/messages", wrapper.MessageLead)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me/focus", wrapper.GetFocus)
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/focus", wrapper.SetFocus)
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/pane-focus", wrapper.SetPaneFocus)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects", wrapper.ListProjects)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects", wrapper.CreateProject)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}", wrapper.GetProject)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}/tasks", wrapper.ListTasks)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects/{projectId}/tasks", wrapper.CreateTask)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}/todo", wrapper.GetTodo)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects/{projectId}/todo/tasks", wrapper.StartTodoItem)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}", wrapper.GetTask)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/workflow", wrapper.GetTaskWorkflow)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/unmerged", wrapper.GetUnmerged)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/co-authors", wrapper.GetCoAuthors)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/merge", wrapper.MergeTask)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/merge-in", wrapper.MergeIn)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/discard", wrapper.DiscardTask)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/events", wrapper.ListTaskEvents)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/changes", wrapper.GetTaskChanges)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/image", wrapper.GetTaskImage)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/diff", wrapper.GetTaskDiff)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/dir", wrapper.GetTaskDir)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/file", wrapper.GetTaskFile)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/terminal", wrapper.GetTaskTerminal)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/previews", wrapper.ListPreviews)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/snapshots", wrapper.ListSnapshots)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/reviews", wrapper.ListReviews)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/snapshots/{n}/fork", wrapper.ForkSnapshot)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/sessions", wrapper.ListSessions)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/sessions", wrapper.CreateSession)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/sessions/{sessionId}", wrapper.GetSession)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/messages", wrapper.SendMessage)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/compact", wrapper.CompactSession)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/interrupt", wrapper.InterruptSession)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/blobs", wrapper.UploadBlob)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/blobs/{blobId}", wrapper.GetBlob)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/inbox", wrapper.ListInbox)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/inbox/{itemId}", wrapper.GetInboxItem)
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/inbox/responses", wrapper.RespondInbox)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/events", wrapper.StreamEvents)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/admin/status", wrapper.GetStatus)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/workflows", wrapper.ListWorkflows)
m.HandleFunc(http.MethodDelete+" "+options.BaseURL+"/api/workflows/{name}", wrapper.DeleteWorkflow)
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/workflows/{name}", wrapper.GetWorkflow)
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/workflows/{name}", wrapper.PutWorkflow)
return m
}
// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec.
// Stored as a slice of fixed-width chunks rather than one concatenated
// const string: with thousands of chunks the chained `+` fold is several
// times slower for the Go compiler than parsing a slice literal.
var swaggerSpec = []string{
"7L1tcxs5kiD8VxB8nghZuyVKnum9u5XjPrhtd4/n2mOfpb6Ou9kODchKkhgVgTKAEsV2+L9fIBNAoYoo",
"siRbsnv7vnTLrCq8JDIT+Z4fJ3O1rpUEac3k/ONEg6mVNID/eKW10u6PuZIWpHV/8rquxJxboeTpP42S",
"7jczX8Gau7/+fw2Lyfnk/zttRz2lp+aURvv06VMxKcHMtajdIJNzmmY6cQ/8u26o50uQ9p1WczD471qr",
"GrQVtLQV8Mqu3F/dsYxt5tdsDVwaxplttGTCMN1IKeSScVkyqZixGviawQ1Iy1bcMK61uIGSLZRmOMIV",
"X1jQVwbmSpbmGYNbYaH049oVsJoW5gZfKgnTSTEB2awn53+fqOtJQetwP+KHk1+Lid3WgAvUQi4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xUvLLDi9Gu5RBM",
"yMZbbJIBfAUUJW9AGx6aXWGfa6Vi/nM3dpVaxvgw66T98fUx2UUSNnWUcvVQGbkTQkhVrNC21FeaUkKk",
"Tr+UFkv5b3FNoW2z9iVQ/J7C+Bzb4sXe0TkS/UHp64s2/Pf/pZ0eZOyxsdywX/UXmF2o+TVY7xiirqhp",
"1Kofo2CcYV8WZlZQVU54cNJA63YKxhTE48o4tQvZr1jEBrVBq2aUa4qNDQjNSN7YhBJ/sQ/rCpvnzqlZ",
"fa0dyZbeuIntTBpbN14yof4lBeMVtm/1bt6QskVzUo/tIN1I/23vVW99MOI3wObl2LQrPlypitp1sbQN",
"XLROgwcP3Ipg/6Z9knmRyGCuSmDfnZ2dRXOmez00rfeZUxq42esJSxr4jXCGhe5xg1xxfye6/KDYi+7e",
"g/bdbU+JiHvCKxZobNGyRdjQyPyP7TNukvZfWRqPdTP7cj61EcKLx+HqoOmuVGDkkc1GCsfmYw9Z2CzM",
"MVTczD8Pvbmm/8lOOO1cPCidDzUtHtN7k/3EnWgMpfCmV+xFBmank3Cp5JH1YB64pH/s9kV+6EC7OM+Q",
"v9kBQcYdfIOic1jafkvJL/Gtx1BN+t2vRmgomLaYNizDPtGETPG91kabCi0RAqcf3bNPhOAOA3dh8RJ/",
"H8auTM09+qScMqzDRfyOaENYdg1Q+5SZuaq398KPoVzY+9HAlvfDNEYFVvRaxVEXuOEeucgDuEyigXx8",
"e8jpfiBK8Q3P7mbUavZoZhiwVFd8nri5kVehHkb2qgqc8DoMDGzt8teLt38LmhFW3DHRI+r44FMnfzw9",
"O0s9oilGBScwYVZnJX0cy3DNd00XW8ZYzUYhyuOVH93hGXurR/cY8p2KG3769H8DAAD//w==",
}
// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes,
// after base64-decoding and flate-decompressing the embedded blob.
func decodeSpec() ([]byte, error) {
encoded := strings.Join(swaggerSpec, "")
compressed, err := base64.StdEncoding.DecodeString(encoded)
if err != nil {
return nil, fmt.Errorf("error base64 decoding spec: %w", err)
}
zr := flate.NewReader(bytes.NewReader(compressed))
var buf bytes.Buffer
if _, err := buf.ReadFrom(zr); err != nil {
return nil, fmt.Errorf("read flate: %w", err)
}
if err := zr.Close(); err != nil {
return nil, fmt.Errorf("close flate reader: %w", err)
}
return buf.Bytes(), nil
}
var rawSpec = decodeSpecCached()
// a naive cache of the decoded OpenAPI spec
func decodeSpecCached() func() ([]byte, error) {
data, err := decodeSpec()
return func() ([]byte, error) {
return data, err
}
}
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
res := make(map[string]func() ([]byte, error))
if len(pathToFile) > 0 {
res[pathToFile] = rawSpec
}
return res
}
// GetSpec returns the OpenAPI specification corresponding to the generated
// code in this file. External references in the spec are resolved through
// PathToRawSpec; externally-referenced files must be embedded in their
// corresponding Go packages (via the import-mapping feature). URL-based
// external refs are not supported.
func GetSpec() (swagger *openapi3.T, err error) {
resolvePath := PathToRawSpec("")
loader := openapi3.NewLoader()
loader.IsExternalRefsAllowed = true
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
pathToFile := url.String()
pathToFile = path.Clean(pathToFile)
getSpec, ok := resolvePath[pathToFile]
if !ok {
err1 := fmt.Errorf("path not found: %s", pathToFile)
return nil, err1
}
return getSpec()
}
var specData []byte
specData, err = rawSpec()
if err != nil {
return
}
swagger, err = loader.LoadFromData(specData)
if err != nil {
return
}
return
}
// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI
// specification: decompressed but not unmarshaled. External references
// are not resolved here; the bytes are the spec exactly as embedded by
// codegen. The result is cached at package init time, so repeated calls
// are cheap.
func GetSpecJSON() ([]byte, error) {
return rawSpec()
}
// GetSwagger returns the OpenAPI specification corresponding to the
// generated code in this file.
//
// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger
// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for
// backwards compatibility.
func GetSwagger() (*openapi3.T, error) {
return GetSpec()
}