// Package protocol provides primitives to interact with the openapi HTTP API. // // Code generated by albedo/apigen version v2.8.0 DO NOT EDIT. package protocol import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "github.com/oapi-codegen/runtime" ) // ACPActiveTurn defines model for ACPActiveTurn. type ACPActiveTurn struct { // AcpInputID The exclusive acp_prompt input of this turn, which session/cancel targets. Null for a turn started by system work (mail, schedule), which stays observable and busy but is never interrupted by the adapter. AcpInputID *ID `json:"acp_input_id" nullable:"true"` // TurnID Opaque identity. Never infer a resource type or route from its contents. TurnID ID `json:"turn_id"` } // ACPAttachRequest defines model for ACPAttachRequest. type ACPAttachRequest struct { MCPServers []ACPMCPServer `json:"mcp_servers"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // ACPAttachment defines model for ACPAttachment. type ACPAttachment struct { ActiveTurn *ACPActiveTurn `json:"active_turn" nullable:"true"` Cursor Cursor `json:"cursor"` // HistoryCutoff Position of the newest durable history entry at the same capture as cursor and output_boundaries (0 when there is none). Entries at or before it are history; everything later arrives on the stream after cursor. HistoryCutoff Counter `json:"history_cutoff"` Lease ACPLease `json:"lease"` // OutputBoundaries For every unfinished live text or thinking message at the cursor, how much had streamed before it. Reconciliation only; the client never emits this content. Installing this capture stands in for the initial snapshot reset of a fresh stream. OutputBoundaries []ACPOutputBoundary `json:"output_boundaries"` // PendingInputIDs Accepted ACP inputs not yet consumed, in acceptance order. PendingInputIDs []ID `json:"pending_input_ids"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // ACPEnvVariable defines model for ACPEnvVariable. type ACPEnvVariable struct { Name string `json:"name"` Value string `json:"value"` } // ACPLease defines model for ACPLease. type ACPLease struct { HeartbeatMs int64 `json:"heartbeat_ms"` LeaseMs int64 `json:"lease_ms"` } // ACPMCPServer Editor-supplied stdio MCP server. command is an absolute executable run without a shell in the session workspace; env values are literal secrets held only in daemon memory. type ACPMCPServer struct { Args []string `json:"args"` Command string `json:"command"` // Env Names must be unique; duplicates are rejected. Env []ACPEnvVariable `json:"env"` Name string `json:"name"` } // ACPMCPServerIdentity Durable stand-in for an overlay server. The fingerprint is a keyed digest of command, args and env; literal values are never stored. type ACPMCPServerIdentity struct { Fingerprint string `json:"fingerprint"` Name string `json:"name"` } // ACPOutputBoundary defines model for ACPOutputBoundary. type ACPOutputBoundary struct { // LiveID Opaque identity. Never infer a resource type or route from its contents. LiveID ID `json:"live_id"` UTF8Bytes int64 `json:"utf8_bytes"` } // ACPPromptBlock defines model for ACPPromptBlock. type ACPPromptBlock = json.RawMessage // ACPPromptInputRequest Only for ACP sessions, with the attachment token. Forms its own logical turn; no other input joins it and it joins no other turn. Blocks keep their order, metadata and original URIs. type ACPPromptInputRequest struct { Blocks []ACPPromptBlock `json:"blocks"` Kind string `json:"kind"` } // ACPResourceLinkBlock defines model for ACPResourceLinkBlock. type ACPResourceLinkBlock struct { // Annotations Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Annotations *DynamicJSON `json:"annotations,omitempty"` Description *string `json:"description,omitempty" nullable:"true"` // Meta Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Meta *DynamicJSON `json:"meta,omitempty"` MimeType *string `json:"mime_type,omitempty" nullable:"true"` Name string `json:"name"` Size *int64 `json:"size,omitempty" nullable:"true"` Title *string `json:"title,omitempty" nullable:"true"` Type string `json:"type"` URI string `json:"uri"` } // ACPSessionIntent defines model for ACPSessionIntent. type ACPSessionIntent struct { Kind string `json:"kind"` MCPServers []ACPMCPServerIdentity `json:"mcp_servers"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // ACPSessionRequest Creates an ACP-owned session. The overlay is prepared strictly before the creation decision commits (any server failure rejects the creation with 409 mcp_overlay_failed); the durable ACP marker, the initial attachment for the Albedo-Attachment-Token header and the overlay are installed before the first session preparation. Resending the identical request under the same session ID is the recovery path; see robot-docs/acp.md. type ACPSessionRequest struct { Kind string `json:"kind"` MCPServers []ACPMCPServer `json:"mcp_servers"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // ACPState Present on ACP-owned sessions. Other clients may read, stop and delete them but not submit input or change execution. type ACPState struct { Attachment string `json:"attachment"` } // ACPTextBlock defines model for ACPTextBlock. type ACPTextBlock struct { // Annotations Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Annotations *DynamicJSON `json:"annotations,omitempty"` // Meta Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Meta *DynamicJSON `json:"meta,omitempty"` Text string `json:"text"` Type string `json:"type"` } // Account defines model for Account. type Account struct { Detail string `json:"detail"` // Endpoint The base url a key account sends to; null for sign-in accounts. Endpoint *string `json:"endpoint" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Kind `key` is an API key: saved in creds.json, or read from the daemon environment on every request when `source` is `env`. Kind string `json:"kind"` Label string `json:"label"` // LimitedUntil When a rate or usage limit recorded against this account ends; null when it has room. LimitedUntil *string `json:"limited_until" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` // RotatedByProfiles Profiles that list this account in `account_ids`. RotatedByProfiles []ID `json:"rotated_by_profiles"` // SelectedByProfiles Profiles pinned to this account by `account_id`. SelectedByProfiles []ID `json:"selected_by_profiles"` // Source `env` accounts are never stored and cannot be removed or renamed; their label names the variable, as `$OPENROUTER_API_KEY`. Source string `json:"source"` } // AccountPatch defines model for AccountPatch. type AccountPatch struct { Label string `json:"label"` } // ActionOperation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. type ActionOperation struct { Body map[string]Binding `json:"body"` Headers map[string]Binding `json:"headers"` Method string `json:"method"` OperationID string `json:"operation_id"` Path map[string]Binding `json:"path"` // PathTemplate Daemon-relative URL, including any representation query. No foreign origin or fragment. PathTemplate ResourceURL `json:"path_template"` Query map[string]Binding `json:"query"` // ResultSchema Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. ResultSchema DynamicJSON `json:"result_schema"` // SuccessStatus Expected synchronous JSON success status. Omitted operations accept 200 or 201 for mutations and 200 for reads. SuccessStatus *int64 `json:"success_status,omitempty"` } // ActiveOutput Ordered unfinished output captured with the session cursor. Exactly one of text or reference is non-null. References retain a fixed byte cutoff through their short snapshot lease. A run retains at most 64 MiB of unfinished output across at most 256 descriptors. Inline output is limited to 64 KiB encoded; larger content uses references. type ActiveOutput struct { Bytes Counter `json:"bytes"` ElapsedMs *int64 `json:"elapsed_ms" nullable:"true"` Kind string `json:"kind"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` Reference *ContentReference `json:"reference" nullable:"true"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text *string `json:"text" nullable:"true"` } // Activity defines model for Activity. type Activity struct { CurrentRequest *AgentRequest `json:"current_request,omitempty" nullable:"true"` LatestAnswer *struct { Bytes Counter `json:"bytes"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` } `json:"latest_answer" nullable:"true"` LatestInput *struct { Bytes Counter `json:"bytes"` // InputID Opaque identity. Never infer a resource type or route from its contents. InputID ID `json:"input_id"` Source string `json:"source"` } `json:"latest_input" nullable:"true"` LatestProgress *string `json:"latest_progress,omitempty" nullable:"true"` Lines []struct { Kind string `json:"kind"` Text string `json:"text"` } `json:"lines"` // ObservedAt UTC RFC 3339. ObservedAt Timestamp `json:"observed_at"` OutputScalars Counter `json:"output_scalars"` OutputUTF8Bytes Counter `json:"output_utf8_bytes"` } // ActivityEvent defines model for ActivityEvent. type ActivityEvent struct { Data struct { Activity Activity `json:"activity"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor Cursor `json:"cursor"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` Status SessionStatus `json:"status"` } `json:"data"` Type string `json:"type"` } // AdmissionProblem defines model for AdmissionProblem. type AdmissionProblem struct { Code string `json:"code"` Detail string `json:"detail"` Fields []struct { Detail string `json:"detail"` Pointer string `json:"pointer"` } `json:"fields,omitempty"` Status int64 `json:"status"` Title string `json:"title"` Type string `json:"type"` } // AgentRequest defines model for AgentRequest. type AgentRequest struct { // InputID Opaque identity. Never infer a resource type or route from its contents. InputID ID `json:"input_id"` Text string `json:"text"` } // Artifact defines model for Artifact. type Artifact struct { Bytes Counter `json:"bytes"` CreatedAt Counter `json:"created_at"` Entry string `json:"entry"` ID ArtifactID `json:"id"` // Key The capability that serves its pages, `/frame/{id}.{key}/{version}/{path}`. Key string `json:"key"` SessionDeleted bool `json:"session_deleted"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SessionName *string `json:"session_name" nullable:"true"` Title string `json:"title"` UpdatedAt Counter `json:"updated_at"` Version int64 `json:"version"` Versions int64 `json:"versions"` Workspace string `json:"workspace"` } // ArtifactDetail defines model for ArtifactDetail. type ArtifactDetail struct { Bytes Counter `json:"bytes"` CreatedAt Counter `json:"created_at"` Entry string `json:"entry"` // History Every version, newest first. History []ArtifactVersion `json:"history"` ID ArtifactID `json:"id"` // Key The capability that serves its pages, `/frame/{id}.{key}/{version}/{path}`. Key string `json:"key"` SessionDeleted bool `json:"session_deleted"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SessionName *string `json:"session_name" nullable:"true"` Title string `json:"title"` UpdatedAt Counter `json:"updated_at"` Version int64 `json:"version"` Versions int64 `json:"versions"` Workspace string `json:"workspace"` } // ArtifactError defines model for ArtifactError. type ArtifactError struct { Column *int64 `json:"column,omitempty"` Line *int64 `json:"line,omitempty"` Message string `json:"message"` Source *string `json:"source,omitempty"` Stack *string `json:"stack,omitempty"` } // ArtifactFile defines model for ArtifactFile. type ArtifactFile struct { Path string `json:"path"` Size Counter `json:"size"` } // ArtifactID defines model for ArtifactID. type ArtifactID = string // ArtifactPage defines model for ArtifactPage. type ArtifactPage struct { Items []Artifact `json:"items"` Next *string `json:"next" nullable:"true"` } // ArtifactState The page's localStorage. type ArtifactState map[string]string // ArtifactVersion defines model for ArtifactVersion. type ArtifactVersion struct { Bytes Counter `json:"bytes"` CellID *string `json:"cell_id" nullable:"true"` CreatedAt Counter `json:"created_at"` Entry string `json:"entry"` Files []ArtifactFile `json:"files"` Version int64 `json:"version"` } // AttachmentToken 32 random bytes, canonical unpadded base64url (the last character carries no stray bits). type AttachmentToken = string // Auth defines model for Auth. type Auth struct { Accounts []Account `json:"accounts"` Providers []LoginProvider `json:"providers"` } // Binding JSON pointer resolves against the selected row, submitted form, or installed session snapshot. No expression language. type Binding = json.RawMessage // CachePolicyEntry defines model for CachePolicyEntry. type CachePolicyEntry struct { Checked string `json:"checked"` Clock string `json:"clock"` Evidence string `json:"evidence"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Layer string `json:"layer"` Match struct { Extension []string `json:"extension" nullable:"true"` Host []string `json:"host" nullable:"true"` Model []string `json:"model" nullable:"true"` } `json:"match"` Note string `json:"note"` Policy string `json:"policy"` Read *float64 `json:"read" nullable:"true"` Source string `json:"source"` Survival *struct { Max *Counter `json:"max" nullable:"true"` Typical Counter `json:"typical"` } `json:"survival" nullable:"true"` Tiers []struct { Seconds Counter `json:"seconds"` Write *float64 `json:"write" nullable:"true"` } `json:"tiers" nullable:"true"` } // CachePolicyLayer defines model for CachePolicyLayer. type CachePolicyLayer struct { Error *SafeReason `json:"error" nullable:"true"` Loaded bool `json:"loaded"` Name string `json:"name"` Path string `json:"path"` } // CachePolicyPage defines model for CachePolicyPage. type CachePolicyPage struct { Entries []CachePolicyEntry `json:"entries"` Layers []CachePolicyLayer `json:"layers"` Matched *CachePolicyEntry `json:"matched" nullable:"true"` Next *PageToken `json:"next" nullable:"true"` } // CachePolicyReloadOutcome defines model for CachePolicyReloadOutcome. type CachePolicyReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` State string `json:"state"` } // CachePrior defines model for CachePrior. type CachePrior struct { Model *ID `json:"model" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` Source string `json:"source"` TTLSeconds *int64 `json:"ttl_seconds" nullable:"true"` } // CapabilitySettings defines model for CapabilitySettings. type CapabilitySettings struct { Preferences map[string]bool `json:"preferences"` } // CapabilitySettingsChange defines model for CapabilitySettingsChange. type CapabilitySettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource CapabilitySettingsResource `json:"resource"` } // CapabilitySettingsPatch Resolve candidate IDs to stable preference keys under the observed catalog revision. type CapabilitySettingsPatch struct { // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision ID `json:"catalog_revision"` // CatalogSessionID Opaque identity. Never infer a resource type or route from its contents. CatalogSessionID ID `json:"catalog_session_id"` Choices map[string]*bool `json:"choices"` } // CapabilitySettingsResource defines model for CapabilitySettingsResource. type CapabilitySettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value CapabilitySettings `json:"value"` } // Catalog Pagination is independent for discovered candidates and loaded commands; next tokens identify their section. type Catalog struct { Discovery *struct { Candidates []CatalogCandidate `json:"candidates"` Diagnostics []SafeReason `json:"diagnostics"` Next *PageToken `json:"next" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"discovery" nullable:"true"` DiscoveryFailure *SafeReason `json:"discovery_failure" nullable:"true"` Loaded struct { Commands []json.RawMessage `json:"commands"` Next *PageToken `json:"next" nullable:"true"` Revision *ID `json:"revision" nullable:"true"` } `json:"loaded"` // NativeCommands Static HTTP declarations for selected extensions when no composition has been loaded. Reading these declarations does not prepare extensions or start a kernel. NativeCommands []HTTPCommand `json:"native_commands,omitempty"` Pages []PageDescriptor `json:"pages,omitempty"` } // CatalogCandidate defines model for CatalogCandidate. type CatalogCandidate struct { Dependencies []ID `json:"dependencies"` Description string `json:"description"` Diagnostic *SafeReason `json:"diagnostic" nullable:"true"` EffectiveEnabled bool `json:"effective_enabled"` Eligible bool `json:"eligible"` // Extension Installed extension metadata for the inspector. Null for other candidate kinds. Extension *ExtensionMetadata `json:"extension" nullable:"true"` GlobalPreference *bool `json:"global_preference" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` PreferenceKey *ID `json:"preference_key" nullable:"true"` Quarantined bool `json:"quarantined"` ResolvedSource *string `json:"resolved_source" nullable:"true"` SessionOverride *bool `json:"session_override" nullable:"true"` ShadowedBy *ID `json:"shadowed_by" nullable:"true"` Source string `json:"source"` Title string `json:"title"` Valid bool `json:"valid"` } // Checkpoint defines model for Checkpoint. type Checkpoint struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Position Counter `json:"position"` Preview Preview `json:"preview"` Title string `json:"title"` TurnType string `json:"turn_type"` } // CheckpointPage defines model for CheckpointPage. type CheckpointPage struct { HighWater Counter `json:"high_water"` Items []Checkpoint `json:"items"` Newer *PageToken `json:"newer" nullable:"true"` Older *PageToken `json:"older" nullable:"true"` } // ChildSessionIntent defines model for ChildSessionIntent. type ChildSessionIntent struct { Address string `json:"address"` Effort *string `json:"effort" nullable:"true"` // InitialInputID Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. InitialInputID UUIDv7 `json:"initial_input_id"` Kind string `json:"kind"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` // ParentID Opaque identity. Never infer a resource type or route from its contents. ParentID ID `json:"parent_id"` Task string `json:"task"` } // ChildSessionRequest defines model for ChildSessionRequest. type ChildSessionRequest struct { Address string `json:"address"` Effort *string `json:"effort,omitempty" nullable:"true"` // InitialInputID Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. InitialInputID UUIDv7 `json:"initial_input_id"` Kind string `json:"kind"` Model *ID `json:"model,omitempty" nullable:"true"` Name string `json:"name"` // ParentID Opaque identity. Never infer a resource type or route from its contents. ParentID ID `json:"parent_id"` Task string `json:"task"` } // CollectionBatch Examples: {"events":[{"data":{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"session_id":"01a0fcea-2b00-7000-8000-000000000001","status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null}},"type":"activity"}]} type CollectionBatch = json.RawMessage // CollectionInvalidateEvent defines model for CollectionInvalidateEvent. type CollectionInvalidateEvent struct { Data struct { ScopeDirty bool `json:"scope_dirty"` SessionIDs []ID `json:"session_ids"` Urls []ResourceURL `json:"urls"` } `json:"data"` Type string `json:"type"` } // CollectionMailEvent defines model for CollectionMailEvent. type CollectionMailEvent struct { Data MailMetadata `json:"data"` Type string `json:"type"` } // CollectionOverflowEvent defines model for CollectionOverflowEvent. type CollectionOverflowEvent struct { Data EmptyRequest `json:"data"` Type string `json:"type"` } // CollectionReadyBatch Examples: {"events":[{"data":{},"type":"ready"},{"data":{"reason":"initial"},"type":"reset"}]} type CollectionReadyBatch struct { Events []interface{} `json:"events"` } // CollectionReadyEvent defines model for CollectionReadyEvent. type CollectionReadyEvent struct { Data EmptyRequest `json:"data"` Type string `json:"type"` } // CollectionResetEvent defines model for CollectionResetEvent. type CollectionResetEvent struct { Data struct { Reason string `json:"reason"` } `json:"data"` Type string `json:"type"` } // CollectionSSE One parsed SSE event. Decode data as JSON and validate CollectionBatch separately; contentSchema is not asserted by ordinary JSON Schema validation. No event, id or retry fields are emitted. // // Examples: {"data":"{\"events\":[{\"type\":\"ready\",\"data\":{}},{\"type\":\"reset\",\"data\":{\"reason\":\"initial\"}}]}"}, {"data":"{\"events\":[{\"type\":\"activity\",\"data\":{\"session_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"cursor\":{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"sequence\":0},\"status\":{\"phase\":\"idle\",\"run_id\":null,\"interrupt_requested\":false,\"blocking_reason\":null},\"current_progress\":[],\"activity\":{\"lines\":[],\"output_scalars\":0,\"output_utf8_bytes\":0,\"observed_at\":\"2026-10-02T14:00:00Z\",\"latest_input\":null,\"latest_answer\":null}}}]}"} type CollectionSSE struct { Data string `json:"data"` } // CommandInputRequest defines model for CommandInputRequest. type CommandInputRequest struct { // Arguments Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Arguments DynamicJSON `json:"arguments"` ClientID *string `json:"client_id,omitempty"` // CommandID Opaque identity. Never infer a resource type or route from its contents. CommandID ID `json:"command_id"` Kind string `json:"kind"` } // CompactionObservation defines model for CompactionObservation. type CompactionObservation struct { AfterTokens *Counter `json:"after_tokens" nullable:"true"` BeforeTokens *Counter `json:"before_tokens" nullable:"true"` EvictedEntries Counter `json:"evicted_entries"` Strategy *ID `json:"strategy" nullable:"true"` Summary string `json:"summary"` } // CompactionRequest defines model for CompactionRequest. type CompactionRequest struct { // Strategy Opaque identity. Never infer a resource type or route from its contents. Strategy *ID `json:"strategy,omitempty"` } // CompactionResult defines model for CompactionResult. type CompactionResult struct { EffectiveStrategy *ID `json:"effective_strategy" nullable:"true"` Failure *SafeReason `json:"failure" nullable:"true"` Observation *CompactionObservation `json:"observation" nullable:"true"` SelectionApplied bool `json:"selection_applied"` State string `json:"state"` } // Composition defines model for Composition. type Composition struct { Availability map[string]bool `json:"availability"` Dependencies map[string][]ID `json:"dependencies"` // DesiredRevision Opaque identity. Never infer a resource type or route from its contents. DesiredRevision ID `json:"desired_revision"` LoadedRevision *ID `json:"loaded_revision" nullable:"true"` NeedsReload bool `json:"needs_reload"` Quarantine []QuarantineDiagnostic `json:"quarantine"` } // ContentPart Offsets count exact stored UTF-8 bytes. type ContentPart struct { Complete bool `json:"complete"` Encoding string `json:"encoding"` Field string `json:"field"` OffsetBytes Counter `json:"offset_bytes"` Text string `json:"text"` } // ContentReference defines model for ContentReference. type ContentReference struct { Bytes Counter `json:"bytes"` Field string `json:"field"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // ContextCompaction defines model for ContextCompaction. type ContextCompaction struct { AfterItems *Counter `json:"after_items" nullable:"true"` BeforeItems *Counter `json:"before_items" nullable:"true"` EstimateMethod *string `json:"estimate_method" nullable:"true"` EstimatedInputTokens *Counter `json:"estimated_input_tokens" nullable:"true"` InputLimitTokens *Counter `json:"input_limit_tokens" nullable:"true"` ProviderCachedInputTokens *Counter `json:"provider_cached_input_tokens" nullable:"true"` ProviderInputTokens *Counter `json:"provider_input_tokens" nullable:"true"` Source *string `json:"source" nullable:"true"` Status string `json:"status"` Strategy *ID `json:"strategy" nullable:"true"` TriggerFreePercent *float64 `json:"trigger_free_percent" nullable:"true"` } // ContextRead defines model for ContextRead. type ContextRead = json.RawMessage // ContextSection defines model for ContextSection. type ContextSection struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` ItemCount Counter `json:"item_count"` Kind string `json:"kind"` Label string `json:"label"` PageCount Counter `json:"page_count"` Preview Preview `json:"preview"` Source *string `json:"source" nullable:"true"` UTF8Bytes Counter `json:"utf8_bytes"` } // ContextSectionPage defines model for ContextSectionPage. type ContextSectionPage struct { Omitted *string `json:"omitted" nullable:"true"` Page Counter `json:"page"` PageCount Counter `json:"page_count"` // SectionID Opaque identity. Never infer a resource type or route from its contents. SectionID ID `json:"section_id"` // SnapshotID Opaque identity. Never infer a resource type or route from its contents. SnapshotID ID `json:"snapshot_id"` Text string `json:"text"` } // ContextSummary defines model for ContextSummary. type ContextSummary struct { CapturedAt *Timestamp `json:"captured_at" nullable:"true"` Compaction ContextCompaction `json:"compaction"` ContextWindowTokens *Counter `json:"context_window_tokens" nullable:"true"` Model *ID `json:"model" nullable:"true"` Protocol *string `json:"protocol" nullable:"true"` Provider *ID `json:"provider" nullable:"true"` Reason *SafeReason `json:"reason" nullable:"true"` Sections []ContextSection `json:"sections"` SnapshotID *ID `json:"snapshot_id" nullable:"true"` State string `json:"state"` } // ContextWindow defines model for ContextWindow. type ContextWindow struct { // ContextWindow The window set for this session. Null when it uses the model's. ContextWindow *Counter `json:"context_window" nullable:"true"` // EffectiveContextTokens The window compaction measures against. EffectiveContextTokens *Counter `json:"effective_context_tokens" nullable:"true"` // Message One sentence a client can show as it is. Message string `json:"message"` // ModelContextTokens The model's own window, with any raised cap or context limit applied. Null when the catalog does not know the model. ModelContextTokens *Counter `json:"model_context_tokens" nullable:"true"` Source string `json:"source"` } // ContinueInputRequest defines model for ContinueInputRequest. type ContinueInputRequest struct { ClientID *string `json:"client_id,omitempty"` Kind string `json:"kind"` } // Counter defines model for Counter. type Counter = int64 // Creation defines model for Creation. type Creation struct { Resolved struct { Effort *string `json:"effort" nullable:"true"` Model *ID `json:"model" nullable:"true"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"resolved"` Submitted json.RawMessage `json:"submitted"` } // CreationDecision defines model for CreationDecision. type CreationDecision struct { Admission string `json:"admission"` Creation *Creation `json:"creation" nullable:"true"` DecidedAt *Timestamp `json:"decided_at" nullable:"true"` DeletedAt *Timestamp `json:"deleted_at" nullable:"true"` HTTPStatus int64 `json:"http_status"` Kind string `json:"kind"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // Cursor defines model for Cursor. type Cursor struct { // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` Sequence Counter `json:"sequence"` } // DeclaredSetting defines model for DeclaredSetting. type DeclaredSetting struct { // Default What the section's owner uses while nothing is saved. Null when leaving the setting unset has a meaning of its own, which the description gives. Default json.RawMessage `json:"default" nullable:"true"` Description string `json:"description"` // Key The key in the section of extensions.json. Key string `json:"key"` // Kind integer takes a whole number from minimum to maximum; text takes a non-empty string of at most 4096 bytes; limit takes a whole number from minimum to maximum, or -1 for no limit. Kind string `json:"kind"` Label string `json:"label"` // Maximum The largest integer accepted; null for text. Maximum *int64 `json:"maximum" nullable:"true"` // Minimum The smallest integer accepted; null for text. Minimum *int64 `json:"minimum" nullable:"true"` // Value The saved value, or null when nothing is saved and the default applies. A saved value of the wrong kind reads as null, and the section's problem names it. Value json.RawMessage `json:"value" nullable:"true"` } // DeclaredSettings defines model for DeclaredSettings. type DeclaredSettings struct { // Sections The daemon's own sections, then the sections installed extensions declare, in registry order. Sections []DeclaredSettingsSection `json:"sections"` } // DeclaredSettingsChange defines model for DeclaredSettingsChange. type DeclaredSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource DeclaredSettingsResource `json:"resource"` } // DeclaredSettingsPatch defines model for DeclaredSettingsPatch. type DeclaredSettingsPatch struct { // Values Section name to declared key to value. A value replaces the saved one; null removes it so the default applies. Unknown sections, undeclared keys, values outside the declaration, and a section its owner's own check rejects are refused, and nothing is saved. Values map[string]map[string]json.RawMessage `json:"values"` } // DeclaredSettingsResource defines model for DeclaredSettingsResource. type DeclaredSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value DeclaredSettings `json:"value"` } // DeclaredSettingsSection defines model for DeclaredSettingsSection. type DeclaredSettingsSection struct { // Category The part of /config the section belongs to. web_search is what web_search asks and where; context is how a session's context is kept within its window; agents is how many agents a session may spawn and how deep; models_and_caching is the model catalog and prompt cache warming; tools is what the agent drives or reaches, such as MCP servers, remote kernels and the desktop. Category string `json:"category"` Description string `json:"description"` Fields []DeclaredSetting `json:"fields"` // Label What the section configures, for a reader who does not know who declares it. Label string `json:"label"` // Name The section's key in extensions.json. The daemon's own sections take names no extension may have; every other section is named after the extension that declares it. Name ID `json:"name"` // Problem Why the section's owner cannot use its saved section, when it cannot. Problem *string `json:"problem" nullable:"true"` } // Delivery defines model for Delivery. type Delivery struct { Attempts Counter `json:"attempts"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` DeliveredAt *Timestamp `json:"delivered_at" nullable:"true"` // HookID Opaque identity. Never infer a resource type or route from its contents. HookID ID `json:"hook_id"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // ReceivedAt UTC RFC 3339. ReceivedAt Timestamp `json:"received_at"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // DeliveryDetail defines model for DeliveryDetail. type DeliveryDetail struct { Attempts Counter `json:"attempts"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` DeliveredAt *Timestamp `json:"delivered_at" nullable:"true"` // HookID Opaque identity. Never infer a resource type or route from its contents. HookID ID `json:"hook_id"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Payload struct { Data string `json:"data"` Encoding string `json:"encoding"` } `json:"payload"` // ReceivedAt UTC RFC 3339. ReceivedAt Timestamp `json:"received_at"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // DeliveryPage defines model for DeliveryPage. type DeliveryPage struct { Items []Delivery `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // DiscordAllow defines model for DiscordAllow. type DiscordAllow struct { Name *string `json:"name" nullable:"true"` } // DiscordAllowed defines model for DiscordAllowed. type DiscordAllowed struct { // AddedAt Unix milliseconds. AddedAt int64 `json:"added_at"` Name *string `json:"name" nullable:"true"` // UserID Discord snowflake as decimal text. UserID DiscordID `json:"user_id"` } // DiscordBot A session's Discord bot. The token never leaves the daemon. type DiscordBot struct { Allowed Counter `json:"allowed"` ApplicationID *DiscordID `json:"application_id" nullable:"true"` Channels Counter `json:"channels"` Detail *string `json:"detail" nullable:"true"` Enabled bool `json:"enabled"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` InviteURL *string `json:"invite_url" nullable:"true"` Name string `json:"name"` // OwnerID Discord snowflake as decimal text. OwnerID DiscordID `json:"owner_id"` Requests Counter `json:"requests"` Revision int64 `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` State string `json:"state"` User *DiscordBotUser `json:"user" nullable:"true"` } // DiscordBotCreate defines model for DiscordBotCreate. type DiscordBotCreate struct { Name string `json:"name"` OwnerID string `json:"owner_id"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` Token string `json:"token"` } // DiscordBotPage defines model for DiscordBotPage. type DiscordBotPage struct { Items []DiscordBot `json:"items"` } // DiscordBotPatch defines model for DiscordBotPatch. type DiscordBotPatch struct { Enabled *bool `json:"enabled,omitempty"` Name *string `json:"name,omitempty"` OwnerID *string `json:"owner_id,omitempty"` Revision int64 `json:"revision"` Token *string `json:"token,omitempty"` } // DiscordBotUser defines model for DiscordBotUser. type DiscordBotUser struct { // ID Discord snowflake as decimal text. ID DiscordID `json:"id"` Username string `json:"username"` } // DiscordChannel defines model for DiscordChannel. type DiscordChannel struct { // Delivery off ignores the channel; turn queues messages until the running turn ends; tool steers the running turn after its current tool call. Delivery DiscordDelivery `json:"delivery"` // ID Discord snowflake as decimal text. ID DiscordID `json:"id"` MentionsOnly bool `json:"mentions_only"` Name string `json:"name"` ParentID *DiscordID `json:"parent_id" nullable:"true"` Position int64 `json:"position"` // Type Discord channel type; 0 text, 2 voice, 4 category, 5 announcement, 15 forum. Type int64 `json:"type"` } // DiscordChannelSetting defines model for DiscordChannelSetting. type DiscordChannelSetting struct { ChannelName *string `json:"channel_name,omitempty"` // Delivery off ignores the channel; turn queues messages until the running turn ends; tool steers the running turn after its current tool call. Delivery DiscordDelivery `json:"delivery"` // GuildID Discord snowflake as decimal text. GuildID *DiscordID `json:"guild_id,omitempty"` GuildName *string `json:"guild_name,omitempty"` MentionsOnly bool `json:"mentions_only"` } // DiscordChannelState defines model for DiscordChannelState. type DiscordChannelState struct { // ChannelID Discord snowflake as decimal text. ChannelID DiscordID `json:"channel_id"` // Delivery off ignores the channel; turn queues messages until the running turn ends; tool steers the running turn after its current tool call. Delivery DiscordDelivery `json:"delivery"` MentionsOnly bool `json:"mentions_only"` } // DiscordDMs defines model for DiscordDMs. type DiscordDMs struct { Allowed []DiscordAllowed `json:"allowed"` Owner DiscordOwner `json:"owner"` Requests []DiscordRequest `json:"requests"` } // DiscordDeletion defines model for DiscordDeletion. type DiscordDeletion struct { // Deleted Opaque identity. Never infer a resource type or route from its contents. Deleted ID `json:"deleted"` } // DiscordDelivery off ignores the channel; turn queues messages until the running turn ends; tool steers the running turn after its current tool call. type DiscordDelivery = string // DiscordGuild defines model for DiscordGuild. type DiscordGuild struct { Channels []DiscordChannel `json:"channels"` // ID Discord snowflake as decimal text. ID DiscordID `json:"id"` Name string `json:"name"` } // DiscordGuildList defines model for DiscordGuildList. type DiscordGuildList struct { Guilds []DiscordGuild `json:"guilds"` } // DiscordID Discord snowflake as decimal text. type DiscordID = string // DiscordOwner defines model for DiscordOwner. type DiscordOwner struct { Name *string `json:"name" nullable:"true"` // UserID Discord snowflake as decimal text. UserID DiscordID `json:"user_id"` } // DiscordRequest Someone whose DMs were refused because they are not on the allow list. type DiscordRequest struct { Count int64 `json:"count"` // LastAt Unix milliseconds. LastAt int64 `json:"last_at"` Preview string `json:"preview"` // UserID Discord snowflake as decimal text. UserID DiscordID `json:"user_id"` Username string `json:"username"` } // DiscordUserDeletion defines model for DiscordUserDeletion. type DiscordUserDeletion struct { // Deleted Discord snowflake as decimal text. Deleted DiscordID `json:"deleted"` } // DynamicJSON Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. type DynamicJSON = json.RawMessage // ETag Strong opaque validator for the complete canonical representation. type ETag = string // EmptyRequest defines model for EmptyRequest. type EmptyRequest = map[string]interface{} // EntryContentBatch defines model for EntryContentBatch. type EntryContentBatch struct { Next *PageToken `json:"next" nullable:"true"` Parts []EntryContentBatchPart `json:"parts"` } // EntryContentBatchPart One field piece of one named entry; offsets count exact stored UTF-8 bytes. type EntryContentBatchPart struct { Complete bool `json:"complete"` Encoding string `json:"encoding"` // EntryID Opaque identity. Never infer a resource type or route from its contents. EntryID ID `json:"entry_id"` Field string `json:"field"` OffsetBytes Counter `json:"offset_bytes"` Text string `json:"text"` } // EntryContentPage defines model for EntryContentPage. type EntryContentPage struct { // EntryID Opaque identity. Never infer a resource type or route from its contents. EntryID ID `json:"entry_id"` Next *PageToken `json:"next" nullable:"true"` Parts []ContentPart `json:"parts"` } // ExtensionDeletion defines model for ExtensionDeletion. type ExtensionDeletion struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Notification Notification `json:"notification"` } // ExtensionMetadata defines model for ExtensionMetadata. type ExtensionMetadata struct { Context bool `json:"context"` Plugins []ID `json:"plugins"` PythonModules []ID `json:"python_modules"` Tools []ID `json:"tools"` } // ExtensionSettings defines model for ExtensionSettings. type ExtensionSettings struct { Defaults map[string]bool `json:"defaults"` } // ExtensionSettingsChange defines model for ExtensionSettingsChange. type ExtensionSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ExtensionSettingsResource `json:"resource"` } // ExtensionSettingsPatch defines model for ExtensionSettingsPatch. type ExtensionSettingsPatch struct { Defaults map[string]*bool `json:"defaults,omitempty"` } // ExtensionSettingsResource defines model for ExtensionSettingsResource. type ExtensionSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ExtensionSettings `json:"value"` } // FailureBatch Terminal failure, alone with no snapshot. It does not commit a replacement cursor. // // Examples: {"cursor":0,"events":[{"data":{"code":"history_unavailable","detail":"Durable history could not be loaded."},"type":"failure"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A"} type FailureBatch struct { Cursor Counter `json:"cursor"` Events []FailureEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` } // FailureEvent defines model for FailureEvent. type FailureEvent struct { Data SafeReason `json:"data"` Type string `json:"type"` } // FastMode defines model for FastMode. type FastMode struct { Fast bool `json:"fast"` Message string `json:"message"` Support struct { Detail *string `json:"detail,omitempty" nullable:"true"` Mode *string `json:"mode,omitempty" nullable:"true"` Source *string `json:"source,omitempty" nullable:"true"` Status string `json:"status"` } `json:"support"` } // FileDiff defines model for FileDiff. type FileDiff struct { Added Counter `json:"added"` Diff string `json:"diff"` Kind string `json:"kind"` // NewText The whole file after the change. NewText *string `json:"new_text,omitempty"` // OldText The whole file before the change, null when the change created it. Present together with new_text only when both fit the trace's snapshot budget. OldText *string `json:"old_text,omitempty" nullable:"true"` Path string `json:"path"` Removed Counter `json:"removed"` } // FileUnavailable defines model for FileUnavailable. type FileUnavailable struct { Kind string `json:"kind"` Path string `json:"path"` Reason string `json:"reason"` } // ForkSessionIntent defines model for ForkSessionIntent. type ForkSessionIntent struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Kind string `json:"kind"` Name *string `json:"name" nullable:"true"` // SourceSessionID Opaque identity. Never infer a resource type or route from its contents. SourceSessionID ID `json:"source_session_id"` } // ForkSessionRequest defines model for ForkSessionRequest. type ForkSessionRequest struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Kind string `json:"kind"` Name *string `json:"name,omitempty" nullable:"true"` // SourceSessionID Opaque identity. Never infer a resource type or route from its contents. SourceSessionID ID `json:"source_session_id"` } // FormField defines model for FormField. type FormField struct { Choices []struct { Label string `json:"label"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } `json:"choices"` // Default Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Default DynamicJSON `json:"default"` // DefaultBinding Prefill from the selected row or installed session, before showing the form. DefaultBinding *struct { Pointer string `json:"pointer"` Source string `json:"source"` } `json:"default_binding,omitempty"` Description string `json:"description"` Label string `json:"label"` Maximum *float64 `json:"maximum" nullable:"true"` Minimum *float64 `json:"minimum" nullable:"true"` Name string `json:"name"` Required bool `json:"required"` Type string `json:"type"` } // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. type Generation = string // GitFacts defines model for GitFacts. type GitFacts struct { Added *Counter `json:"added" nullable:"true"` Branch *string `json:"branch" nullable:"true"` Changed *Counter `json:"changed" nullable:"true"` Dirty *bool `json:"dirty" nullable:"true"` Kind string `json:"kind"` Modified *Counter `json:"modified" nullable:"true"` Removed *Counter `json:"removed" nullable:"true"` Revision *string `json:"revision" nullable:"true"` // Root Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Root Workspace `json:"root"` TouchedAt *Timestamp `json:"touched_at" nullable:"true"` } // Glance defines model for Glance. type Glance struct { // Data Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Data *DynamicJSON `json:"data,omitempty"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension ID `json:"extension"` Rows []PageRow `json:"rows"` Title string `json:"title"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // HTTPCommand defines model for HTTPCommand. type HTTPCommand struct { Arguments []FormField `json:"arguments"` CallerPermissions []string `json:"caller_permissions"` Delivery string `json:"delivery"` Description string `json:"description"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Operation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. Operation ActionOperation `json:"operation"` SlashName string `json:"slash_name"` } // HistoryEntry defines model for HistoryEntry. type HistoryEntry struct { CheckpointID *ID `json:"checkpoint_id" nullable:"true"` Content []json.RawMessage `json:"content"` ContentComplete bool `json:"content_complete"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` InputID *ID `json:"input_id" nullable:"true"` Kind string `json:"kind"` Mail *HistoryMail `json:"mail,omitempty" nullable:"true"` Position Counter `json:"position"` // ThinkingDurationMs Observed thinking duration, when recorded. ThinkingDurationMs *Counter `json:"thinking_duration_ms,omitempty" nullable:"true"` Tool *struct { Name string `json:"name"` ProgressCallID *ID `json:"progress_call_id" nullable:"true"` // Status Outcome of the whole call, derived from the stored result exactly as the live tool event's status, so rows recorded before this field have it too. Status string `json:"status"` Title *string `json:"title,omitempty" nullable:"true"` // ToolCallID Opaque identity. Never infer a resource type or route from its contents. ToolCallID ID `json:"tool_call_id"` } `json:"tool" nullable:"true"` TurnID *ID `json:"turn_id" nullable:"true"` TurnType *string `json:"turn_type,omitempty"` } // HistoryMail defines model for HistoryMail. type HistoryMail struct { Kind string `json:"kind"` // MailID Opaque identity. Never infer a resource type or route from its contents. MailID ID `json:"mail_id"` SenderLabel string `json:"sender_label"` SenderSessionID *ID `json:"sender_session_id" nullable:"true"` } // HistoryPage Examples: {"high_water":0,"items":[],"newer":null,"older":null} type HistoryPage struct { HighWater Counter `json:"high_water"` Items []HistoryEntry `json:"items"` Newer *PageToken `json:"newer" nullable:"true"` Older *PageToken `json:"older" nullable:"true"` } // HistoryRead The requested view determines the item type. Empty pages are valid for either view. type HistoryRead = json.RawMessage // Hook defines model for Hook. type Hook struct { ConfigurationResource HookConfigurationResource `json:"configuration_resource"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` // DeliveryURL Where a sender posts this hook's deliveries; null while no webhook intake listener runs. DeliveryURL *string `json:"delivery_url" nullable:"true"` PendingCount Counter `json:"pending_count"` } // HookChange Secret appears only on creation and explicit rotation, including a generated secret. Never present on PATCH or reads. // // Examples: {"notification":{"code":null,"detail":null,"state":"not_requested"},"resource":{"etag":"\"hook-revision-1\"","url":"/extensions/webhooks/hooks/hook-1?view=configuration","value":{"enabled":true,"id":"hook-1","name":"ci","revision":"hook-revision-1","session_id":"01a0fcea-2b00-7000-8000-000000000001","signature_header":"X-Albedo-Signature","signature_prefix":"sha256="}},"secret":"synthetic-example-hook-secret"} type HookChange struct { Notification Notification `json:"notification"` Resource HookConfigurationResource `json:"resource"` Secret *string `json:"secret,omitempty"` } // HookConfiguration defines model for HookConfiguration. type HookConfiguration struct { Enabled bool `json:"enabled"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Name string `json:"name"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SignatureHeader string `json:"signature_header"` SignaturePrefix string `json:"signature_prefix"` } // HookConfigurationResource defines model for HookConfigurationResource. type HookConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value HookConfiguration `json:"value"` } // HookCreate Examples: {"name":"ci","session_id":"01a0fcea-2b00-7000-8000-000000000001"} type HookCreate struct { Enabled *bool `json:"enabled,omitempty"` Name string `json:"name"` Secret *string `json:"secret,omitempty"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SignatureHeader *string `json:"signature_header,omitempty"` SignaturePrefix *string `json:"signature_prefix,omitempty"` } // HookPage defines model for HookPage. type HookPage struct { Items []Hook `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // HookPatch defines model for HookPatch. type HookPatch struct { Enabled *bool `json:"enabled,omitempty"` Name *string `json:"name,omitempty"` SignatureHeader *string `json:"signature_header,omitempty"` SignaturePrefix *string `json:"signature_prefix,omitempty"` } // HookPermission defines model for HookPermission. type HookPermission struct { AgentManage bool `json:"agent_manage"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // HookPermissionChange defines model for HookPermissionChange. type HookPermissionChange struct { Notification Notification `json:"notification"` Resource HookPermissionResource `json:"resource"` } // HookPermissionPatch defines model for HookPermissionPatch. type HookPermissionPatch struct { AgentManage *bool `json:"agent_manage,omitempty"` } // HookPermissionResource defines model for HookPermissionResource. type HookPermissionResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value HookPermission `json:"value"` } // HookSecretRequest defines model for HookSecretRequest. type HookSecretRequest struct { Secret *string `json:"secret,omitempty"` } // Host defines model for Host. type Host struct { Architecture *string `json:"architecture" nullable:"true"` Authentication *struct { ControlPath *string `json:"control_path" nullable:"true"` Instructions string `json:"instructions"` SSHTarget string `json:"ssh_target"` } `json:"authentication" nullable:"true"` Detail *SafeReason `json:"detail" nullable:"true"` Home *Workspace `json:"home" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` Os *string `json:"os" nullable:"true"` State string `json:"state"` // Step Current probe progress. Null when connecting or when no probe is running. Step *string `json:"step,omitempty" nullable:"true"` // Target Opaque identity. Never infer a resource type or route from its contents. Target ID `json:"target"` } // HostPage defines model for HostPage. type HostPage struct { Items []Host `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ID Opaque identity. Never infer a resource type or route from its contents. type ID = string // ImageContent defines model for ImageContent. type ImageContent struct { Image ImageMetadata `json:"image"` Kind string `json:"kind"` } // ImageMetadata defines model for ImageMetadata. type ImageMetadata struct { Height int64 `json:"height"` MimeType string `json:"mime_type"` OriginalBytes Counter `json:"original_bytes"` // Reference Its url is the image resource, which serves the decoded bytes. Reference ContentReference `json:"reference"` Width int64 `json:"width"` } // ImageUpload Strict base64; decoded dimensions and provider constraints are validated before admission. type ImageUpload struct { Data string `json:"data"` MimeType string `json:"mime_type"` } // Input defines model for Input. type Input struct { AcceptanceOrder *Counter `json:"acceptance_order" nullable:"true"` AcceptedAt *Timestamp `json:"accepted_at" nullable:"true"` Admission string `json:"admission"` BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` ClientID *string `json:"client_id" nullable:"true"` Delivery *string `json:"delivery" nullable:"true"` HTTPStatus int64 `json:"http_status"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Problem *AdmissionProblem `json:"problem" nullable:"true"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` TranscriptPosition *Counter `json:"transcript_position" nullable:"true"` Turn *Turn `json:"turn" nullable:"true"` } // InputCancellation defines model for InputCancellation. type InputCancellation struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` Result string `json:"result"` } // InputCommand defines model for InputCommand. type InputCommand struct { Arguments []FormField `json:"arguments"` CallerPermissions []string `json:"caller_permissions"` // CommandID Opaque identity. Never infer a resource type or route from its contents. CommandID ID `json:"command_id"` Delivery string `json:"delivery"` Description string `json:"description"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` SlashName string `json:"slash_name"` } // InputDecision defines model for InputDecision. type InputDecision struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` Kind string `json:"kind"` } // InputRequest defines model for InputRequest. type InputRequest = json.RawMessage // InterruptRequest defines model for InterruptRequest. type InterruptRequest struct { RunID *ID `json:"run_id" nullable:"true"` ThroughInputOrder Counter `json:"through_input_order"` } // Interruption defines model for Interruption. type Interruption struct { CancelledInputIDs []ID `json:"cancelled_input_ids"` RunID *ID `json:"run_id" nullable:"true"` State string `json:"state"` Warnings Warnings `json:"warnings"` } // JJFacts defines model for JJFacts. type JJFacts struct { Bookmark *struct { Ahead Counter `json:"ahead"` Name string `json:"name"` } `json:"bookmark" nullable:"true"` ChangeID *string `json:"change_id" nullable:"true"` Changed *Counter `json:"changed" nullable:"true"` Conflicts *bool `json:"conflicts" nullable:"true"` Description *string `json:"description" nullable:"true"` Dirty *bool `json:"dirty" nullable:"true"` Kind string `json:"kind"` Revision *string `json:"revision" nullable:"true"` // Root Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Root Workspace `json:"root"` TouchedAt *Timestamp `json:"touched_at" nullable:"true"` } // JSONContent defines model for JSONContent. type JSONContent struct { // Field What the value is. A user entry's `skill` value is the SkillLoad its slash activation loaded. Field string `json:"field"` Kind string `json:"kind"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } // JobCollection Examples: {"items":[],"live_job_count":0,"page":{"actions":[],"empty_state":"no background jobs running","glance":null,"rows":[],"summary":"0 background jobs running","title":"jobs"}} type JobCollection struct { Items []KernelJob `json:"items"` LiveJobCount Counter `json:"live_job_count"` Page PageDescriptor `json:"page"` } // JobOutputPage defines model for JobOutputPage. type JobOutputPage struct { Job JobRecord `json:"job"` // NextOffset Byte to continue from; equal to `offset` when there is nothing more yet. NextOffset Counter `json:"next_offset"` // Offset Byte the page starts at. Offset Counter `json:"offset"` Text string `json:"text"` } // JobRecord defines model for JobRecord. type JobRecord struct { // Bytes Everything the job has written, kept or not. Bytes Counter `json:"bytes"` Command string `json:"command"` EndedAt *Counter `json:"ended_at" nullable:"true"` ExitCode *int64 `json:"exit_code" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Service Started to keep running, so nothing waits on its end. Service bool `json:"service"` // StartedAt Wall-clock milliseconds since the epoch. StartedAt Counter `json:"started_at"` State string `json:"state"` TimedOut bool `json:"timed_out"` } // JobRecordCollection defines model for JobRecordCollection. type JobRecordCollection struct { Items []JobRecord `json:"items"` } // JobStop Examples: {"stopped":"job-1"} type JobStop struct { // Stopped Opaque identity. Never infer a resource type or route from its contents. Stopped ID `json:"stopped"` } // Kernel defines model for Kernel. type Kernel struct { Build *string `json:"build" nullable:"true"` InstanceID *ID `json:"instance_id" nullable:"true"` // LiveJobCount Observed owned jobs. Null while booting or when the kernel owner is lost. LiveJobCount *Counter `json:"live_job_count" nullable:"true"` // RunningJobs Up to 100 observed live jobs, ordered by ID. Null when the kernel owner is unavailable. The count may exceed this list. RunningJobs []KernelJob `json:"running_jobs" nullable:"true"` Stage *string `json:"stage" nullable:"true"` Stale bool `json:"stale"` StalenessReasons []SafeReason `json:"staleness_reasons"` State string `json:"state"` } // KernelJob defines model for KernelJob. type KernelJob struct { Command string `json:"command"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Pid *Counter `json:"pid" nullable:"true"` // StartedAt Wall-clock milliseconds since the epoch when the owner recorded the job. Zero when unknown, which clients treat as settled work. StartedAt Counter `json:"started_at"` } // KernelUpgradeResult defines model for KernelUpgradeResult. type KernelUpgradeResult struct { Failure *SafeReason `json:"failure" nullable:"true"` NewBuild *string `json:"new_build" nullable:"true"` NewKernelID *ID `json:"new_kernel_id" nullable:"true"` OldBuild *string `json:"old_build" nullable:"true"` OldKernelID *ID `json:"old_kernel_id" nullable:"true"` State string `json:"state"` StoppedJobs []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } `json:"stopped_jobs"` Warnings Warnings `json:"warnings"` } // KeyAccountRequest Saves an API key as an account. A key already saved for the same endpoint is refused with `key_exists`; its account id is in the problem detail. type KeyAccountRequest struct { APIKey *string `json:"api_key,omitempty"` Endpoint string `json:"endpoint"` Label *string `json:"label,omitempty"` // Provider The profile extension the key serves, such as `openai` or `opencode-go`. Provider ID `json:"provider"` } // LinkChange defines model for LinkChange. type LinkChange struct { NotificationCount Counter `json:"notification_count"` Notifications []TargetNotification `json:"notifications"` Resource LinkConfigurationResource `json:"resource"` Truncated bool `json:"truncated"` } // LinkConfiguration defines model for LinkConfiguration. type LinkConfiguration struct { // GroupID Opaque identity. Never infer a resource type or route from its contents. GroupID ID `json:"group_id"` Members []Workspace `json:"members"` Next *PageToken `json:"next" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // LinkConfigurationResource defines model for LinkConfigurationResource. type LinkConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value LinkConfiguration `json:"value"` } // LinkGroup defines model for LinkGroup. type LinkGroup struct { ConfigurationResource LinkConfigurationResource `json:"configuration_resource"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` Presence []struct { // Exists Observed directory presence. Null for an uninspected or unreachable location. Exists *bool `json:"exists" nullable:"true"` Host *Host `json:"host" nullable:"true"` SessionCount Counter `json:"session_count"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"presence"` } // LinkMerge defines model for LinkMerge. type LinkMerge struct { // OtherEtag Strong opaque validator for the complete canonical representation. OtherEtag ETag `json:"other_etag"` // OtherWorkspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. OtherWorkspace Workspace `json:"other_workspace"` } // Login Examples: {"accounts":[],"expires_at":"2026-10-02T14:15:00Z","failure":null,"id":"01a0fcea-2b00-7000-8000-000000000003","instructions":"Paste the callback URL if the browser cannot reach the daemon.","progress":"Waiting for authorization.","provider":"example-provider","state":"waiting","url":"https://provider.example/authorize?state=synthetic-state"} type Login struct { Accounts []Account `json:"accounts"` // ExpiresAt UTC RFC 3339. ExpiresAt Timestamp `json:"expires_at"` Failure *SafeReason `json:"failure" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Instructions *string `json:"instructions" nullable:"true"` Progress string `json:"progress"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` State string `json:"state"` URL *string `json:"url" nullable:"true"` } // LoginPatch defines model for LoginPatch. type LoginPatch struct { Response *string `json:"response,omitempty"` } // LoginProvider defines model for LoginProvider. type LoginProvider struct { Detail string `json:"detail"` Fields []FormField `json:"fields"` Flows []string `json:"flows"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Label string `json:"label"` } // LoginRequest Flow defaults to the provider preferred flow. Form names, types and required values are checked against that provider declaration. Values are write-only. type LoginRequest struct { Flow *string `json:"flow,omitempty"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` Values map[string]json.RawMessage `json:"values"` } // MCPAuth A server's OAuth sign-in. none until the server asks for one; needs_sign_in when it asked and albedo has no usable token, signed_in, or signed_out after the user signed out. Start a sign-in with PUT /auth/logins/{login_id} and provider mcp:. Tokens and client secrets never appear. type MCPAuth struct { Account *string `json:"account" nullable:"true"` // Client configured when the user set a client id, registered when albedo registered itself. Client *string `json:"client" nullable:"true"` ExpiresAt *string `json:"expires_at" nullable:"true"` Reason *string `json:"reason" nullable:"true"` Scope *string `json:"scope" nullable:"true"` State string `json:"state"` // StepUp The wider scope a signed-in server asked for; signing in again grants it. StepUp *string `json:"step_up" nullable:"true"` } // MCPDefinition defines model for MCPDefinition. type MCPDefinition struct { Arguments []string `json:"arguments"` // Auth A server's OAuth sign-in. none until the server asks for one; needs_sign_in when it asked and albedo has no usable token, signed_in, or signed_out after the user signed out. Start a sign-in with PUT /auth/logins/{login_id} and provider mcp:. Tokens and client secrets never appear. Auth MCPAuth `json:"auth"` BearerTokenEnvVar *string `json:"bearer_token_env_var" nullable:"true"` CallTimeoutMs int64 `json:"call_timeout_ms"` Command *string `json:"command" nullable:"true"` Cwd *Workspace `json:"cwd" nullable:"true"` DisabledTools []string `json:"disabled_tools"` Enabled bool `json:"enabled"` EnabledTools []string `json:"enabled_tools" nullable:"true"` Environment map[string]ValueSource `json:"environment"` Headers map[string]ValueSource `json:"headers"` SecretPresence SecretPresence `json:"secret_presence"` StartupTimeoutMs int64 `json:"startup_timeout_ms"` Transport string `json:"transport"` URL *string `json:"url" nullable:"true"` } // MCPDefinitionPatch Partial merge patch. Public and secret sources cannot overlap. HTTP and stdio fields are validated against transport on the complete candidate. Public environment/header entries accept null removal; a null whole map clears it. Switching credential sources removes the former source in the same patch. type MCPDefinitionPatch struct { Arguments []string `json:"arguments,omitempty"` BearerTokenEnvVar *string `json:"bearer_token_env_var,omitempty" nullable:"true"` CallTimeoutMs *int64 `json:"call_timeout_ms,omitempty"` Command *string `json:"command,omitempty" nullable:"true"` Cwd *Workspace `json:"cwd,omitempty" nullable:"true"` DisabledTools []string `json:"disabled_tools,omitempty"` Enabled *bool `json:"enabled,omitempty"` EnabledTools []string `json:"enabled_tools,omitempty" nullable:"true"` Environment *map[string]*ValueSource `json:"environment,omitempty" nullable:"true"` Headers *map[string]*ValueSource `json:"headers,omitempty" nullable:"true"` Secrets *MCPSecretsPatch `json:"secrets,omitempty"` StartupTimeoutMs *int64 `json:"startup_timeout_ms,omitempty"` Transport *string `json:"transport,omitempty"` URL *string `json:"url,omitempty" nullable:"true"` } // MCPSecretsPatch defines model for MCPSecretsPatch. type MCPSecretsPatch struct { BearerToken *string `json:"bearer_token,omitempty" nullable:"true"` Environment map[string]*string `json:"environment,omitempty"` Headers map[string]*string `json:"headers,omitempty"` // Oauth Null signs the server out of its OAuth sign-in. Oauth any `json:"oauth,omitempty" nullable:"true"` // OauthClient A client the user registered with the server's authorization server, used instead of registering albedo; null forgets it. OauthClient *struct { ClientID string `json:"client_id"` ClientSecret *string `json:"client_secret,omitempty" nullable:"true"` } `json:"oauth_client,omitempty" nullable:"true"` } // MCPSettings defines model for MCPSettings. type MCPSettings struct { Definitions map[string]MCPDefinition `json:"definitions"` } // MCPSettingsChange defines model for MCPSettingsChange. type MCPSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource MCPSettingsResource `json:"resource"` } // MCPSettingsPatch Validate candidate connections before atomic commit unless explicitly disabled. // // Examples: {"definitions":{"example":{"enabled":true,"secrets":{"bearer_token":"synthetic-example-token"},"transport":"http","url":"https://tools.example/mcp"}},"validate_connection":true} type MCPSettingsPatch struct { Definitions map[string]*MCPDefinitionPatch `json:"definitions,omitempty"` ValidateConnection *bool `json:"validate_connection,omitempty"` } // MCPSettingsResource defines model for MCPSettingsResource. type MCPSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value MCPSettings `json:"value"` } // MailMetadata defines model for MailMetadata. type MailMetadata struct { Bytes Counter `json:"bytes"` Kind string `json:"kind"` // MailID Opaque identity. Never infer a resource type or route from its contents. MailID ID `json:"mail_id"` // ReceiverSessionID Opaque identity. Never infer a resource type or route from its contents. ReceiverSessionID ID `json:"receiver_session_id"` SenderLabel *string `json:"sender_label" nullable:"true"` SenderSessionID *ID `json:"sender_session_id" nullable:"true"` } // MessageInputRequest Examples: {"client_id":"draft-1","kind":"message","text":"Fix the parser."} type MessageInputRequest struct { ClientID *string `json:"client_id,omitempty"` // Images Attached in order; the text's numbered image markers say where each was attached. Images []ImageUpload `json:"images,omitempty"` Kind string `json:"kind"` // Pastes Pasted text the text marks by number; a long one is saved to a file the model reads. Pastes []string `json:"pastes,omitempty"` Text string `json:"text"` } // Model defines model for Model. type Model struct { CachePolicy struct { Source *string `json:"source" nullable:"true"` TTLSeconds *Counter `json:"ttl_seconds" nullable:"true"` } `json:"cache_policy"` // CapKey Opaque identity. Never infer a resource type or route from its contents. CapKey ID `json:"cap_key"` // CompactAt The window the user saved for this model, below its own; null or absent follows the model. CompactAt *Counter `json:"compact_at,omitempty" nullable:"true"` DefaultContextTokens *Counter `json:"default_context_tokens" nullable:"true"` EffectiveContextTokens *Counter `json:"effective_context_tokens" nullable:"true"` Efforts []struct { ID string `json:"id"` Label string `json:"label"` } `json:"efforts"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` ImageEdge *int64 `json:"image_edge" nullable:"true"` InputModalities []string `json:"input_modalities"` Label string `json:"label"` MaxContextTokens *Counter `json:"max_context_tokens" nullable:"true"` MaxOutputTokens *Counter `json:"max_output_tokens" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` Raised bool `json:"raised"` Source string `json:"source"` } // ModelPage defines model for ModelPage. type ModelPage struct { Items []Model `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ModelRead defines model for ModelRead. type ModelRead = json.RawMessage // ModelReloadOutcome defines model for ModelReloadOutcome. type ModelReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` State string `json:"state"` } // ModelSettings defines model for ModelSettings. type ModelSettings struct { CacheTTLPriors []CachePrior `json:"cache_ttl_priors"` CompactAt map[string]int64 `json:"compact_at,omitempty"` RaisedCaps map[string]bool `json:"raised_caps"` } // ModelSettingsChange defines model for ModelSettingsChange. type ModelSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ModelSettingsResource `json:"resource"` } // ModelSettingsPatch Keys are cap_key values from model metadata. For raised_caps, true raises to the advertised maximum; false uses the ordinary limit; null clears the choice. A missing choice defaults to false. For compact_at, a token count is the window every session on that model compacts against, as long as it is below the model's window; null clears it. Only raised_caps and compact_at are writable. type ModelSettingsPatch struct { CompactAt map[string]*int64 `json:"compact_at,omitempty"` RaisedCaps map[string]*bool `json:"raised_caps,omitempty"` } // ModelSettingsResource defines model for ModelSettingsResource. type ModelSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ModelSettings `json:"value"` } // NewSessionIntent defines model for NewSessionIntent. type NewSessionIntent struct { // ContextWindow Tokens this session compacts against instead of the model's catalogued window. Null uses the model's window. ContextWindow *int64 `json:"context_window,omitempty" nullable:"true"` Effort *string `json:"effort" nullable:"true"` Kind string `json:"kind"` Model *ID `json:"model" nullable:"true"` Name *string `json:"name" nullable:"true"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // NewSessionRequest Examples: {"kind":"new","workspace":"/workspace/project"} type NewSessionRequest struct { // ContextWindow Tokens this session compacts against instead of the model's catalogued window. Null uses the model's window. ContextWindow *int64 `json:"context_window,omitempty" nullable:"true"` Effort *string `json:"effort,omitempty" nullable:"true"` Kind string `json:"kind"` Model *ID `json:"model,omitempty" nullable:"true"` Name *string `json:"name,omitempty" nullable:"true"` ProviderProfile *ID `json:"provider_profile,omitempty" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // Notification defines model for Notification. type Notification struct { Code *string `json:"code" nullable:"true"` Detail *string `json:"detail" nullable:"true"` State string `json:"state"` } // PageAction defines model for PageAction. type PageAction struct { Confirmation *string `json:"confirmation" nullable:"true"` Fields []FormField `json:"fields"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` KeyboardHint *string `json:"keyboard_hint" nullable:"true"` Label string `json:"label"` // Operation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. Operation ActionOperation `json:"operation"` } // PageDescriptor defines model for PageDescriptor. type PageDescriptor struct { Actions []PageAction `json:"actions"` EmptyState string `json:"empty_state"` Glance *Glance `json:"glance" nullable:"true"` Rows []PageRow `json:"rows"` Summary string `json:"summary"` Title string `json:"title"` } // PageRow defines model for PageRow. type PageRow struct { Badge *string `json:"badge" nullable:"true"` Detail *string `json:"detail" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Resource *struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } `json:"resource" nullable:"true"` Text string `json:"text"` Tone string `json:"tone"` } // PageToken Opaque continuation, tied to the query and representation; never authority. type PageToken = string // Paperclip defines model for Paperclip. type Paperclip struct { // CreatedAt UTC RFC 3339. CreatedAt Timestamp `json:"created_at"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Message string `json:"message"` Reply string `json:"reply"` Resolution string `json:"resolution"` ResolvingSessionID *ID `json:"resolving_session_id" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` SessionID *ID `json:"session_id" nullable:"true"` Status string `json:"status"` Suggestion string `json:"suggestion"` Title string `json:"title"` Topic string `json:"topic"` // UpdatedAt UTC RFC 3339. UpdatedAt Timestamp `json:"updated_at"` Workspace *Workspace `json:"workspace" nullable:"true"` } // PaperclipChange defines model for PaperclipChange. type PaperclipChange struct { Notification Notification `json:"notification"` Resource PaperclipResource `json:"resource"` } // PaperclipCreate defines model for PaperclipCreate. type PaperclipCreate struct { Message string `json:"message"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Suggestion *string `json:"suggestion,omitempty"` Title *string `json:"title,omitempty"` Topic *string `json:"topic,omitempty"` Workspace *Workspace `json:"workspace,omitempty" nullable:"true"` } // PaperclipPage defines model for PaperclipPage. type PaperclipPage struct { Glance *Glance `json:"glance,omitempty"` Items []PaperclipResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // PaperclipPatch Reply cannot accompany resolved or dismissed status. It acknowledges the item. type PaperclipPatch struct { Reply *string `json:"reply,omitempty"` Resolution *string `json:"resolution,omitempty"` Status *string `json:"status,omitempty"` } // PaperclipResource defines model for PaperclipResource. type PaperclipResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value Paperclip `json:"value"` } // PendingInput defines model for PendingInput. type PendingInput struct { AcceptanceOrder Counter `json:"acceptance_order"` // AcceptedAt UTC RFC 3339. AcceptedAt Timestamp `json:"accepted_at"` BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` Delivery string `json:"delivery"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Preview Preview `json:"preview"` } // PreferencePatch defines model for PreferencePatch. type PreferencePatch struct { Archived *bool `json:"archived,omitempty"` // PinBefore Moves the session among the pinned, before this pinned session, or last when null. The session must be pinned, in this patch or already. Fails with 409 `pin_target_invalid` when the target is not pinned, and 400 `pin_move_unpinned` when the session is not. Only this session is renumbered when a number is free between its new neighbours; otherwise the fewest neighbours shift in the same commit and are named in the collection stream's `invalidate` event. A shift changes their ETag, not their revision, so a change already admitted against them still commits. PinBefore *ID `json:"pin_before,omitempty" nullable:"true"` Pinned *bool `json:"pinned,omitempty"` } // Preview defines model for Preview. type Preview struct { Text string `json:"text"` TranscriptCount Counter `json:"transcript_count"` Truncated bool `json:"truncated"` } // Problem Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem struct { Code string `json:"code"` Decision json.RawMessage `json:"decision,omitempty"` Detail string `json:"detail"` Fields []struct { Detail string `json:"detail"` Pointer string `json:"pointer"` } `json:"fields,omitempty"` Status int64 `json:"status"` Title string `json:"title"` Type string `json:"type"` } // ProgressPreview defines model for ProgressPreview. type ProgressPreview struct { OffsetScalars Counter `json:"offset_scalars"` Text string `json:"text"` } // ProviderProfile defines model for ProviderProfile. type ProviderProfile struct { AccountID *ID `json:"account_id" nullable:"true"` // AccountIDs Accounts this profile rotates between after a limit, by id. Null when it does not rotate. Exclusive with `account_id`; with neither, a profile uses one account (its saved key, the environment key, or the provider's selected or first account) and never switches. AccountIDs []ID `json:"account_ids" nullable:"true"` // API Bedrock API mode. Null or omission means messages; replay protocol is unchanged. API *string `json:"api,omitempty" nullable:"true"` Effort *string `json:"effort" nullable:"true"` Endpoint *string `json:"endpoint" nullable:"true"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension ID `json:"extension"` HasKey bool `json:"has_key"` ImageEdge *int64 `json:"image_edge" nullable:"true"` Location *string `json:"location" nullable:"true"` // Model Opaque identity. Never infer a resource type or route from its contents. Model ID `json:"model"` Project *string `json:"project" nullable:"true"` Protocol string `json:"protocol"` } // ProviderProfilePatch Partial existing profile; extension and model required when creating a new map entry. type ProviderProfilePatch struct { AccountID *ID `json:"account_id,omitempty" nullable:"true"` // AccountIDs Accounts this profile rotates between after a limit, by id. Null when it does not rotate. Exclusive with `account_id`; with neither, a profile uses one account (its saved key, the environment key, or the provider's selected or first account) and never switches. AccountIDs []ID `json:"account_ids,omitempty" nullable:"true"` // API Bedrock API mode. Omission preserves an existing value; new and legacy profiles without a value use messages; converse selects streaming Converse. API *string `json:"api,omitempty"` APIKey *string `json:"api_key,omitempty" nullable:"true"` Effort *string `json:"effort,omitempty" nullable:"true"` Endpoint *string `json:"endpoint,omitempty" nullable:"true"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension *ID `json:"extension,omitempty"` ImageEdge *int64 `json:"image_edge,omitempty" nullable:"true"` Location *string `json:"location,omitempty" nullable:"true"` // Model Opaque identity. Never infer a resource type or route from its contents. Model *ID `json:"model,omitempty"` Project *string `json:"project,omitempty" nullable:"true"` Protocol *string `json:"protocol,omitempty"` } // ProviderRequestRecord defines model for ProviderRequestRecord. type ProviderRequestRecord struct { AccountID *ID `json:"account_id" nullable:"true"` CacheCreationTokens TokenObservation `json:"cache_creation_tokens"` CacheMarks []struct { Index *Counter `json:"index" nullable:"true"` Through string `json:"through"` TTLSeconds Counter `json:"ttl_seconds"` } `json:"cache_marks"` CacheWrite1HTokens TokenObservation `json:"cache_write_1h_tokens"` CacheWrite5MTokens TokenObservation `json:"cache_write_5m_tokens"` CachedTokens TokenObservation `json:"cached_tokens"` CompletionTokens TokenObservation `json:"completion_tokens"` Effort *string `json:"effort" nullable:"true"` EndedAt *Timestamp `json:"ended_at" nullable:"true"` Failure *SafeReason `json:"failure" nullable:"true"` FirstByteMs *Counter `json:"first_byte_ms" nullable:"true"` HeadHash string `json:"head_hash"` HTTPStatus *int64 `json:"http_status" nullable:"true"` InputChain *string `json:"input_chain" nullable:"true"` InputCount Counter `json:"input_count"` Kind string `json:"kind"` // Model Opaque identity. Never infer a resource type or route from its contents. Model ID `json:"model"` ModelVersion *string `json:"model_version" nullable:"true"` Outcome string `json:"outcome"` ProjectionHash *string `json:"projection_hash" nullable:"true"` PromptTokens TokenObservation `json:"prompt_tokens"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` // ProviderProfile Opaque identity. Never infer a resource type or route from its contents. ProviderProfile ID `json:"provider_profile"` ReasoningTokens TokenObservation `json:"reasoning_tokens"` ReplacedInputCount *Counter `json:"replaced_input_count" nullable:"true"` ResponseID *string `json:"response_id" nullable:"true"` RunID *ID `json:"run_id" nullable:"true"` Sequence Counter `json:"sequence"` // StartedAt UTC RFC 3339. StartedAt Timestamp `json:"started_at"` Strategy *string `json:"strategy" nullable:"true"` Stream *struct { Events Counter `json:"events"` FirstEventMs *Counter `json:"first_event_ms" nullable:"true"` OutputBytes Counter `json:"output_bytes"` ThinkingBytes Counter `json:"thinking_bytes"` } `json:"stream" nullable:"true"` TotalTokens TokenObservation `json:"total_tokens"` TraceID *string `json:"trace_id" nullable:"true"` TranscriptPositions []Counter `json:"transcript_positions"` } // ProviderSettings defines model for ProviderSettings. type ProviderSettings struct { DefaultProfile *ID `json:"default_profile" nullable:"true"` Profiles map[string]ProviderProfile `json:"profiles"` } // ProviderSettingsChange defines model for ProviderSettingsChange. type ProviderSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ProviderSettingsResource `json:"resource"` } // ProviderSettingsPatch Removing the selected profile requires replacing or clearing default_profile in this same patch. // // Examples: {"default_profile":"personal","profiles":{"personal":{"account_id":null,"api_key":"synthetic-example-key","effort":null,"endpoint":"https://provider.example/v1","extension":"openai","image_edge":null,"location":null,"model":"example-model","project":null,"protocol":"responses"}}} type ProviderSettingsPatch struct { DefaultProfile *ID `json:"default_profile,omitempty" nullable:"true"` Profiles map[string]*ProviderProfilePatch `json:"profiles,omitempty"` // Renames Existing profile names mapped to new ones, applied before profiles, which then use the new names. The saved key, default_profile and every session on the old name follow. An unknown old name is 409 unknown_profile; a new name another profile already has is 409 profile_exists. Renames map[string]ID `json:"renames,omitempty"` } // ProviderSettingsResource defines model for ProviderSettingsResource. type ProviderSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ProviderSettings `json:"value"` } // ProxyChunk defines model for ProxyChunk. type ProxyChunk struct { Choices []struct { Delta struct { Content *string `json:"content,omitempty"` ReasoningContent *string `json:"reasoning_content,omitempty"` Role *string `json:"role,omitempty"` ToolCalls []ProxyToolDelta `json:"tool_calls,omitempty"` } `json:"delta"` FinishReason *string `json:"finish_reason" nullable:"true"` Index Counter `json:"index"` } `json:"choices"` Created Counter `json:"created"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model string `json:"model"` Object string `json:"object"` Usage *ProxyUsage `json:"usage,omitempty" nullable:"true"` } // ProxyCompletion Examples: {"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Hello","role":"assistant"}}],"created":1790949600,"id":"completion-1","model":"personal/example-model","object":"chat.completion","usage":{"completion_tokens":1,"prompt_tokens":1,"total_tokens":2}} type ProxyCompletion struct { Choices []struct { FinishReason string `json:"finish_reason"` Index Counter `json:"index"` Message struct { Content *string `json:"content" nullable:"true"` ReasoningContent *string `json:"reasoning_content,omitempty" nullable:"true"` Role string `json:"role"` ToolCalls []ProxyToolCall `json:"tool_calls,omitempty"` } `json:"message"` } `json:"choices"` Created Counter `json:"created"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model string `json:"model"` Object string `json:"object"` Usage *ProxyUsage `json:"usage" nullable:"true"` } // ProxyCompletionRequest Examples: {"messages":[{"content":"Hello","role":"user"}],"model":"personal/example-model","stream":true} type ProxyCompletionRequest struct { MaxCompletionTokens *int64 `json:"max_completion_tokens,omitempty"` MaxTokens *int64 `json:"max_tokens,omitempty"` Messages []ProxyMessage `json:"messages"` Model string `json:"model"` ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"` Reasoning *struct { Effort string `json:"effort"` } `json:"reasoning,omitempty"` ReasoningEffort *string `json:"reasoning_effort,omitempty"` ResponseFormat json.RawMessage `json:"response_format,omitempty"` Stop json.RawMessage `json:"stop,omitempty"` Stream *bool `json:"stream,omitempty"` StreamOptions *struct { IncludeUsage *bool `json:"include_usage,omitempty"` } `json:"stream_options,omitempty"` Temperature *float64 `json:"temperature,omitempty"` ToolChoice json.RawMessage `json:"tool_choice,omitempty"` Tools []ProxyToolDefinition `json:"tools,omitempty"` TopP *float64 `json:"top_p,omitempty"` } // ProxyError defines model for ProxyError. type ProxyError struct { Error struct { Code *string `json:"code" nullable:"true"` Message string `json:"message"` Param *string `json:"param" nullable:"true"` Type string `json:"type"` } `json:"error"` } // ProxyImagePart defines model for ProxyImagePart. type ProxyImagePart struct { ImageURL struct { Detail *string `json:"detail,omitempty"` URL string `json:"url"` } `json:"image_url"` Type string `json:"type"` } // ProxyMessage Tool messages require tool_call_id. Only assistant messages carry tool_calls. Images are accepted only as user data URLs. type ProxyMessage struct { Content json.RawMessage `json:"content,omitempty" nullable:"true"` Name *string `json:"name,omitempty"` ReasoningContent *string `json:"reasoning_content,omitempty" nullable:"true"` Role string `json:"role"` ToolCallID *string `json:"tool_call_id,omitempty"` ToolCalls []ProxyToolCall `json:"tool_calls,omitempty"` } // ProxyModels defines model for ProxyModels. type ProxyModels struct { Data []struct { Created Counter `json:"created"` ID string `json:"id"` Object string `json:"object"` OwnedBy string `json:"owned_by"` } `json:"data"` Errors []struct { Message string `json:"message"` // Profile Opaque identity. Never infer a resource type or route from its contents. Profile ID `json:"profile"` } `json:"errors,omitempty"` Object string `json:"object"` } // ProxySSE Data is a JSON chunk or error, followed by literal [DONE]. Validate decoded JSON explicitly. type ProxySSE struct { Data json.RawMessage `json:"data"` } // ProxyTextPart defines model for ProxyTextPart. type ProxyTextPart struct { Text string `json:"text"` Type string `json:"type"` } // ProxyToolCall defines model for ProxyToolCall. type ProxyToolCall struct { Function struct { Arguments string `json:"arguments"` Name string `json:"name"` } `json:"function"` ID string `json:"id"` Type string `json:"type"` } // ProxyToolDefinition defines model for ProxyToolDefinition. type ProxyToolDefinition struct { Function struct { Description *string `json:"description,omitempty"` Name string `json:"name"` // Parameters Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Parameters *DynamicJSON `json:"parameters,omitempty"` Strict *bool `json:"strict,omitempty"` } `json:"function"` Type string `json:"type"` } // ProxyToolDelta defines model for ProxyToolDelta. type ProxyToolDelta struct { Function *struct { Arguments string `json:"arguments"` Name string `json:"name"` } `json:"function,omitempty"` ID *string `json:"id,omitempty"` Index Counter `json:"index"` Type *string `json:"type,omitempty"` } // ProxyUsage defines model for ProxyUsage. type ProxyUsage struct { CompletionTokens Counter `json:"completion_tokens"` CompletionTokensDetails *struct { ReasoningTokens Counter `json:"reasoning_tokens"` } `json:"completion_tokens_details,omitempty"` PromptTokens Counter `json:"prompt_tokens"` PromptTokensDetails *struct { CachedTokens Counter `json:"cached_tokens"` } `json:"prompt_tokens_details,omitempty"` TotalTokens Counter `json:"total_tokens"` } // QuarantineDiagnostic defines model for QuarantineDiagnostic. type QuarantineDiagnostic struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } // QuotaObservation defines model for QuotaObservation. type QuotaObservation struct { // AccountID Opaque identity. Never infer a resource type or route from its contents. AccountID ID `json:"account_id"` Error *SafeReason `json:"error" nullable:"true"` Label string `json:"label"` LimitID string `json:"limit_id"` // ObservedAt UTC RFC 3339. ObservedAt Timestamp `json:"observed_at"` Plan *string `json:"plan" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` ResetsAt *Timestamp `json:"resets_at" nullable:"true"` Scope *string `json:"scope" nullable:"true"` Sequence Counter `json:"sequence"` Source string `json:"source"` Status string `json:"status"` UsedPercent *float64 `json:"used_percent" nullable:"true"` WindowLabel *string `json:"window_label" nullable:"true"` WindowSeconds *Counter `json:"window_seconds" nullable:"true"` } // QuotaPage defines model for QuotaPage. type QuotaPage struct { Items []QuotaObservation `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // RecentWorkspace defines model for RecentWorkspace. type RecentWorkspace struct { ActivityAt *Timestamp `json:"activity_at" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` UseCount Counter `json:"use_count"` } // RecentWorkspacePage defines model for RecentWorkspacePage. type RecentWorkspacePage struct { Items []RecentWorkspace `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ReferenceContent defines model for ReferenceContent. type ReferenceContent struct { Kind string `json:"kind"` Reference ContentReference `json:"reference"` } // ReloadRequest defines model for ReloadRequest. type ReloadRequest struct { Target *string `json:"target,omitempty"` } // ReloadResult defines model for ReloadResult. type ReloadResult struct { CachePolicy *CachePolicyReloadOutcome `json:"cache_policy" nullable:"true"` Models []ModelReloadOutcome `json:"models"` Session *SessionReloadOutcome `json:"session" nullable:"true"` } // ReplayBatch Empty keepalive keeps the last sequence. Nonempty event sequences are contiguous from the requested cursor. // // Examples: {"cursor":1,"events":[{"data":{"input":{"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null}},"sequence":1,"type":"input"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A"} type ReplayBatch struct { Cursor Counter `json:"cursor"` Events []SessionEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` } // RequestRecordPage defines model for RequestRecordPage. type RequestRecordPage struct { Items []ProviderRequestRecord `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ResetBatch Leading reset and complete snapshot. Later events, if any, follow the snapshot cursor. Envelope cursor advances through every delivered event. // // Examples: {"cursor":0,"events":[{"data":{"reason":"initial"},"type":"reset"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A","snapshot":{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"shell_commands":[],"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null}} type ResetBatch struct { Cursor Counter `json:"cursor"` Events []SessionEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` // Snapshot Examples: {"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"shell_commands":[],"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null} Snapshot Session `json:"snapshot"` } // ResetEvent defines model for ResetEvent. type ResetEvent struct { Data struct { Reason string `json:"reason"` } `json:"data"` Type string `json:"type"` } // ResourceURL Daemon-relative URL, including any representation query. No foreign origin or fragment. type ResourceURL = string // ResourceValidator defines model for ResourceValidator. type ResourceValidator struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // RewindRequest defines model for RewindRequest. type RewindRequest struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` // Summary Ask for a summary of the removed tail, added to the session as a note. Summary *struct { Instructions *string `json:"instructions,omitempty" nullable:"true"` } `json:"summary,omitempty" nullable:"true"` } // RewindResult defines model for RewindResult. type RewindResult struct { // ArchiveSessionID Opaque identity. Never infer a resource type or route from its contents. ArchiveSessionID ID `json:"archive_session_id"` // Input The text of the removed user message, when a person wrote it. Input *string `json:"input" nullable:"true"` // Summary The summary note added after the cut, when one was requested. Summary *string `json:"summary" nullable:"true"` } // SafeReason defines model for SafeReason. type SafeReason struct { Code string `json:"code"` Detail string `json:"detail"` } // ScheduleChange defines model for ScheduleChange. type ScheduleChange struct { Notification Notification `json:"notification"` Resource ScheduleResource `json:"resource"` } // ScheduleCreate defines model for ScheduleCreate. type ScheduleCreate struct { DelaySeconds *int64 `json:"delay_seconds,omitempty"` EverySeconds *int64 `json:"every_seconds,omitempty"` Kind string `json:"kind"` Prompt string `json:"prompt"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // ScheduleJob defines model for ScheduleJob. type ScheduleJob struct { // CreatedAt Null for historical schedules that did not record creation time. CreatedAt *Timestamp `json:"created_at" nullable:"true"` EverySeconds *int64 `json:"every_seconds" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` // NextAt UTC RFC 3339. NextAt Timestamp `json:"next_at"` Prompt string `json:"prompt"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` // UpdatedAt Null until a historical schedule records a new update. UpdatedAt *Timestamp `json:"updated_at" nullable:"true"` } // SchedulePage defines model for SchedulePage. type SchedulePage struct { Glance *Glance `json:"glance,omitempty"` Items []ScheduleResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // SchedulePatch Validate complete candidate: once has null repetition; recurring and heartbeat require every_seconds. type SchedulePatch struct { DelaySeconds *int64 `json:"delay_seconds,omitempty"` EverySeconds *int64 `json:"every_seconds,omitempty" nullable:"true"` Kind *string `json:"kind,omitempty"` Prompt *string `json:"prompt,omitempty"` } // ScheduleResource defines model for ScheduleResource. type ScheduleResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ScheduleJob `json:"value"` } // SecretPresence defines model for SecretPresence. type SecretPresence struct { BearerToken bool `json:"bearer_token"` Environment []string `json:"environment"` Headers []string `json:"headers"` } // SelectionOverrides defines model for SelectionOverrides. type SelectionOverrides struct { Extensions map[string]*bool `json:"extensions"` Instructions map[string]*bool `json:"instructions"` MCP map[string]*bool `json:"mcp"` Skills map[string]*bool `json:"skills"` } // SelectionPatch Null map entry clears that override. Null entire map clears all overrides of that kind. type SelectionPatch struct { Extensions *map[string]*bool `json:"extensions,omitempty" nullable:"true"` Instructions *map[string]*bool `json:"instructions,omitempty" nullable:"true"` MCP *map[string]*bool `json:"mcp,omitempty" nullable:"true"` Skills *map[string]*bool `json:"skills,omitempty" nullable:"true"` } // Server Examples: {"build":"example-build","capabilities":{"collection_invalidation":1,"durable_inputs":1,"session_replay":1,"storage_report":1,"tool_progress":1},"digest":null,"extensions":[{"name":"work","version":1}],"instance_id":"instance-1","notices":[],"protocol":3,"quota":null,"state":"ready"} type Server struct { Build *string `json:"build" nullable:"true"` Capabilities map[string]int64 `json:"capabilities"` // Digest Content digest of the running code tree; update information, not attachment compatibility. Digest *string `json:"digest" nullable:"true"` Extensions []struct { // Name Opaque identity. Never infer a resource type or route from its contents. Name ID `json:"name"` Version int64 `json:"version"` } `json:"extensions"` // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` Notices []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Message string `json:"message"` } `json:"notices"` Protocol int64 `json:"protocol"` Quota []QuotaObservation `json:"quota" nullable:"true"` QuotaHistory *QuotaPage `json:"quota_history,omitempty"` State string `json:"state"` } // Session defines model for Session. type Session struct { // Acp Present only for ACP-owned sessions. Attachment state is read separately from the session capture. Acp *ACPState `json:"acp,omitempty"` ActiveOutput []ActiveOutput `json:"active_output"` Activity Activity `json:"activity"` ActivityAt *Timestamp `json:"activity_at" nullable:"true"` Address *string `json:"address" nullable:"true"` AutomaticName string `json:"automatic_name"` Closed bool `json:"closed"` Composition Composition `json:"composition"` ConfigurationResource SessionConfigurationResource `json:"configuration_resource"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` // Creation Null only for stored sessions that predate immutable creation provenance. All newly admitted creations have provenance. Creation *Creation `json:"creation" nullable:"true"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor *Cursor `json:"cursor" nullable:"true"` Depth int64 `json:"depth"` Effort *string `json:"effort" nullable:"true"` // FamilyRevision Opaque identity. Never infer a resource type or route from its contents. FamilyRevision ID `json:"family_revision"` Fast bool `json:"fast"` Glances []Glance `json:"glances"` // History Examples: {"high_water":0,"items":[],"newer":null,"older":null} History HistoryPage `json:"history"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` InputOrder Counter `json:"input_order"` Kernel Kernel `json:"kernel"` // Location Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. Location SessionLocation `json:"location"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` ParentID *ID `json:"parent_id" nullable:"true"` PendingInputs []PendingInput `json:"pending_inputs"` Preferences SessionPreferences `json:"preferences"` Preview Preview `json:"preview"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` Role string `json:"role"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` Selection SessionSelection `json:"selection"` ShellCommands []ShellCommand `json:"shell_commands"` StartedBy *ID `json:"started_by" nullable:"true"` Status SessionStatus `json:"status"` Usage Usage `json:"usage"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` WorkspaceChange *WorkspaceChange `json:"workspace_change" nullable:"true"` } // SessionBatch defines model for SessionBatch. type SessionBatch = json.RawMessage // SessionChange defines model for SessionChange. type SessionChange struct { Move *struct { AppliedCount Counter `json:"applied_count"` AppliedIDs []ID `json:"applied_ids"` DeferredCount Counter `json:"deferred_count"` DeferredIDs []ID `json:"deferred_ids"` Truncated bool `json:"truncated"` Warnings Warnings `json:"warnings"` } `json:"move" nullable:"true"` Resource SessionConfigurationResource `json:"resource"` // Session Examples: {"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"shell_commands":[],"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null} Session Session `json:"session"` } // SessionChangeRequest defines model for SessionChangeRequest. type SessionChangeRequest = json.RawMessage // SessionCommittedEvent defines model for SessionCommittedEvent. type SessionCommittedEvent struct { Data struct { HighWater Counter `json:"high_water"` // ReplacesAllLive Retire all provisional output for a model commit. ReplacesAllLive bool `json:"replaces_all_live"` ReplacesLiveIDs []ID `json:"replaces_live_ids"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionCompactedEvent defines model for SessionCompactedEvent. type SessionCompactedEvent struct { Data CompactionObservation `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionConfiguration Examples: {"effort":null,"fast":false,"id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":null,"preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"} type SessionConfiguration struct { // ContextWindow Tokens this session compacts against instead of the model's catalogued window. Null uses the model's window. ContextWindow *int64 `json:"context_window,omitempty" nullable:"true"` Effort *string `json:"effort" nullable:"true"` // Fast Provider fast-mode setting; defaults off and may affect billing. Fast bool `json:"fast"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model *ID `json:"model" nullable:"true"` // Name Explicit name. Null shows the automatic title for a root, or the family name for a child; the session representation carries the displayed name. Name *string `json:"name" nullable:"true"` Preferences struct { Archived bool `json:"archived"` PinOrder *Counter `json:"pin_order" nullable:"true"` Pinned bool `json:"pinned"` } `json:"preferences"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` Selection SelectionOverrides `json:"selection"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // SessionConfigurationResource defines model for SessionConfigurationResource. type SessionConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` // Value Examples: {"effort":null,"fast":false,"id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":null,"preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"} Value SessionConfiguration `json:"value"` } // SessionCreationRequest defines model for SessionCreationRequest. type SessionCreationRequest = json.RawMessage // SessionDeletion Counts cover the complete captured operation. ID lists are bounded summaries, never false completion. Refresh the authoritative family or known tombstones if truncated; deletion is never repeated to page a result. type SessionDeletion struct { DeletedCount Counter `json:"deleted_count"` DeletedIDs []ID `json:"deleted_ids"` Remaining []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } `json:"remaining"` RemainingCount Counter `json:"remaining_count"` State string `json:"state"` Truncated bool `json:"truncated"` } // SessionErrorEvent defines model for SessionErrorEvent. type SessionErrorEvent struct { Data struct { Code string `json:"code"` Message string `json:"message"` RunID *ID `json:"run_id" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionEvent defines model for SessionEvent. type SessionEvent = json.RawMessage // SessionFile defines model for SessionFile. type SessionFile struct { // ModifiedAt UTC RFC 3339. ModifiedAt Timestamp `json:"modified_at"` // Path Absolute location as the daemon spells it, `host:/path` for a remote workspace. Path string `json:"path"` Size Counter `json:"size"` // Text The file's contents. At most 1 MiB of UTF-8 without NUL. Text string `json:"text"` } // SessionGlancesEvent The loaded extensions' sidebar values changed, observed at a low rate while a client watches the stream. type SessionGlancesEvent struct { Data struct { Glances []Glance `json:"glances"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionInputEvent defines model for SessionInputEvent. type SessionInputEvent struct { Data struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionInvalidateEvent defines model for SessionInvalidateEvent. type SessionInvalidateEvent struct { Data struct { Kind string `json:"kind"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionKernelEvent The kernel's job facts changed. Published only when they differ from what the stream last carried, so a client that keeps them needs no status poll. type SessionKernelEvent struct { Data struct { Kernel Kernel `json:"kernel"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionLocation Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. type SessionLocation struct { Host *string `json:"host" nullable:"true"` Label *string `json:"label" nullable:"true"` Path string `json:"path"` User *string `json:"user" nullable:"true"` } // SessionMessageEvent defines model for SessionMessageEvent. type SessionMessageEvent struct { Data struct { Entry HistoryEntry `json:"entry"` // ReplacesLiveIDs Live message IDs whose streamed text this durable entry represents, in order, as an exact prefix. Empty when nothing of this entry streamed live. Always sent by daemons with capability acp_attachment. ReplacesLiveIDs []ID `json:"replaces_live_ids,omitempty"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionNoteEvent defines model for SessionNoteEvent. type SessionNoteEvent struct { Data struct { // EntryID Opaque identity. Never infer a resource type or route from its contents. EntryID ID `json:"entry_id"` Mail *MailMetadata `json:"mail" nullable:"true"` Origin string `json:"origin"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionPage Examples: {"items":[{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"created_at":"2026-10-02T14:00:00Z","current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"id":"01a0fcea-2b00-7000-8000-000000000001","location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","root_id":"01a0fcea-2b00-7000-8000-000000000001","status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"workspace":"/workspace/project"}],"next":null} type SessionPage struct { Family *struct { // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` } `json:"family,omitempty"` Items []SessionSummary `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // SessionPatch Skill and instruction changes require catalog_revision. All fields validate and commit together. // // Examples: {"catalog_revision":"discovery-1","selection":{"extensions":{"browser":null},"skills":{"candidate-1":false}}} type SessionPatch struct { // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision *ID `json:"catalog_revision,omitempty"` // ContextWindow Tokens this session compacts against instead of the model's catalogued window. Null uses the model's window. ContextWindow *int64 `json:"context_window,omitempty" nullable:"true"` Effort *string `json:"effort,omitempty" nullable:"true"` // Fast Enable provider fast mode; enabling requires a supported capability and may affect billing. Fast *bool `json:"fast,omitempty"` // Model Opaque identity. Never infer a resource type or route from its contents. Model *ID `json:"model,omitempty"` Name *string `json:"name,omitempty" nullable:"true"` Preferences *PreferencePatch `json:"preferences,omitempty"` // ProviderProfile Opaque identity. Never infer a resource type or route from its contents. ProviderProfile *ID `json:"provider_profile,omitempty"` // Selection Null map entry clears that override. Null entire map clears all overrides of that kind. Selection *SelectionPatch `json:"selection,omitempty"` } // SessionPreferences defines model for SessionPreferences. type SessionPreferences struct { Archived bool `json:"archived"` Opens Counter `json:"opens"` PinOrder *Counter `json:"pin_order" nullable:"true"` Pinned bool `json:"pinned"` } // SessionRead defines model for SessionRead. type SessionRead = json.RawMessage // SessionReloadOutcome defines model for SessionReloadOutcome. type SessionReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` LoadedRevision *ID `json:"loaded_revision" nullable:"true"` RestartRequired bool `json:"restart_required"` State string `json:"state"` Warnings Warnings `json:"warnings"` } // SessionRetryEvent defines model for SessionRetryEvent. type SessionRetryEvent struct { Data struct { Attempt int64 `json:"attempt"` DelayMs Counter `json:"delay_ms"` Reason SafeReason `json:"reason"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionSSE One parsed SSE event. Decode data as JSON and validate SessionBatch separately; contentSchema is not asserted by ordinary JSON Schema validation. No event, id or retry fields are emitted. // // Examples: {"data":"{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"cursor\":0,\"events\":[{\"type\":\"reset\",\"data\":{\"reason\":\"initial\"}}],\"snapshot\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"name\":\"New session\",\"automatic_name\":\"New session\",\"workspace\":\"/workspace/project\",\"location\":{\"host\":null,\"user\":null,\"path\":\"/workspace/project\",\"label\":null},\"parent_id\":null,\"root_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"address\":null,\"depth\":0,\"closed\":false,\"created_at\":\"2026-10-02T14:00:00Z\",\"activity_at\":\"2026-10-02T14:00:00Z\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null,\"status\":{\"phase\":\"idle\",\"run_id\":null,\"interrupt_requested\":false,\"blocking_reason\":null},\"preview\":{\"text\":\"\",\"transcript_count\":0,\"truncated\":false},\"preferences\":{\"pinned\":false,\"pin_order\":null,\"archived\":false,\"opens\":0},\"current_progress\":[],\"activity\":{\"lines\":[],\"output_scalars\":0,\"output_utf8_bytes\":0,\"observed_at\":\"2026-10-02T14:00:00Z\",\"latest_input\":null,\"latest_answer\":null},\"cursor\":{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"sequence\":0},\"creation\":{\"submitted\":{\"kind\":\"new\",\"workspace\":\"/workspace/project\",\"name\":null,\"provider_profile\":null,\"model\":null,\"effort\":null},\"resolved\":{\"workspace\":\"/workspace/project\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null}},\"revision\":\"config-1\",\"family_revision\":\"family-1\",\"configuration_resource\":{\"url\":\"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration\",\"etag\":\"\\\"session-config-1\\\"\",\"value\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"name\":\"New session\",\"workspace\":\"/workspace/project\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null,\"preferences\":{\"pinned\":false,\"pin_order\":null,\"archived\":false},\"selection\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}},\"revision\":\"config-1\"}},\"workspace_change\":null,\"selection\":{\"overrides\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}},\"effective\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}}},\"composition\":{\"desired_revision\":\"composition-1\",\"loaded_revision\":null,\"needs_reload\":true,\"dependencies\":{},\"quarantine\":[],\"availability\":{}},\"kernel\":{\"instance_id\":null,\"state\":\"none\",\"stage\":null,\"build\":null,\"stale\":false,\"staleness_reasons\":[],\"live_job_count\":0,\"running_jobs\":[]},\"pending_inputs\":[],\"input_order\":0,\"usage\":{\"model\":null,\"observed_at\":null,\"prompt_tokens\":null,\"cached_prompt_tokens\":null,\"cache_write_tokens\":null,\"completion_tokens\":null,\"total_tokens\":null,\"elapsed_ms\":null,\"tokens_per_second\":null,\"context_window_tokens\":null,\"cache_ttl_seconds\":null,\"cache_fade\":[]},\"history\":{\"items\":[],\"older\":null,\"newer\":null,\"high_water\":0},\"glances\":[]}}"}, {"data":"{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"cursor\":1,\"events\":[{\"type\":\"input\",\"sequence\":1,\"data\":{\"input\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000002\",\"session_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"kind\":\"message\",\"admission\":\"accepted\",\"http_status\":202,\"problem\":null,\"accepted_at\":\"2026-10-02T14:00:00Z\",\"acceptance_order\":1,\"delivery\":\"pending\",\"blocking_reason\":null,\"transcript_position\":null,\"turn\":null,\"client_id\":\"draft-1\"}}}]}"} type SessionSSE struct { Data string `json:"data"` } // SessionSelection defines model for SessionSelection. type SessionSelection struct { Effective struct { Extensions map[string]bool `json:"extensions"` Instructions map[string]bool `json:"instructions"` MCP map[string]bool `json:"mcp"` Skills map[string]bool `json:"skills"` } `json:"effective"` Overrides SelectionOverrides `json:"overrides"` } // SessionShellCommandEvent defines model for SessionShellCommandEvent. type SessionShellCommandEvent struct { Data ShellCommandResponse `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionStatus defines model for SessionStatus. type SessionStatus struct { BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` InterruptRequested bool `json:"interrupt_requested"` Phase string `json:"phase"` RunID *ID `json:"run_id" nullable:"true"` } // SessionStatusEvent defines model for SessionStatusEvent. type SessionStatusEvent struct { Data SessionStatus `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionStatusRead The live facts a watching client keeps current, read from the session's own memory and its kernel, with no configuration, history, or composition read. Kernel job changes and glance changes also arrive on the session stream, so this is a safety read rather than the cadence. type SessionStatusRead struct { Cursor Cursor `json:"cursor"` Glances []Glance `json:"glances"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kernel Kernel `json:"kernel"` Status SessionStatus `json:"status"` Usage Usage `json:"usage"` } // SessionSummary Session live fields and cursor are captured together. ACP attachment metadata is read separately. Extra response fields may be ignored. type SessionSummary struct { // Acp Present only for ACP-owned sessions. Attachment state is read separately from the session capture. Acp *ACPState `json:"acp,omitempty"` Activity Activity `json:"activity"` ActivityAt *Timestamp `json:"activity_at" nullable:"true"` Address *string `json:"address" nullable:"true"` AutomaticName string `json:"automatic_name"` Closed bool `json:"closed"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor *Cursor `json:"cursor" nullable:"true"` Depth int64 `json:"depth"` Effort *string `json:"effort" nullable:"true"` Fast bool `json:"fast"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Location Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. Location SessionLocation `json:"location"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` ParentID *ID `json:"parent_id" nullable:"true"` Preferences SessionPreferences `json:"preferences"` Preview Preview `json:"preview"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` Role string `json:"role"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` StartedBy *ID `json:"started_by" nullable:"true"` Status SessionStatus `json:"status"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // SessionTextEvent defines model for SessionTextEvent. type SessionTextEvent struct { Data struct { // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionThinkingEvent defines model for SessionThinkingEvent. type SessionThinkingEvent struct { Data struct { // ElapsedMs Completed thinking duration, when observed. ElapsedMs *Counter `json:"elapsed_ms,omitempty"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionToolEvent defines model for SessionToolEvent. type SessionToolEvent struct { Data struct { // Arguments Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Arguments DynamicJSON `json:"arguments"` ContentComplete bool `json:"content_complete"` Name string `json:"name"` // ProgressCallID Opaque identity. Never infer a resource type or route from its contents. ProgressCallID ID `json:"progress_call_id"` Reference *ContentReference `json:"reference" nullable:"true"` // Result Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Result DynamicJSON `json:"result"` // Status Outcome of the whole call. progress_call_id equals the call_id of any progress for this call, is unique within the session, and exists even when no progress was sent. Always sent by daemons with capability acp_attachment. Status *string `json:"status,omitempty"` Title *string `json:"title,omitempty" nullable:"true"` // ToolCallID Opaque identity. Never infer a resource type or route from its contents. ToolCallID ID `json:"tool_call_id"` Trace *ToolTrace `json:"trace" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionToolProgressEvent defines model for SessionToolProgressEvent. type SessionToolProgressEvent struct { Data struct { Progress *ToolProgress `json:"progress" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionTurnCompletedEvent defines model for SessionTurnCompletedEvent. type SessionTurnCompletedEvent struct { Data struct { InputCount Counter `json:"input_count"` InputIDs []ID `json:"input_ids"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` State string `json:"state"` Truncated bool `json:"truncated"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionUsageEvent defines model for SessionUsageEvent. type SessionUsageEvent struct { Data Usage `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // Settings defines model for Settings. type Settings struct { Capabilities CapabilitySettings `json:"capabilities"` ExtensionSettings DeclaredSettings `json:"extension_settings"` Extensions ExtensionSettings `json:"extensions"` GroupResources struct { Capabilities ResourceValidator `json:"capabilities"` ExtensionSettings ResourceValidator `json:"extension_settings"` Extensions ResourceValidator `json:"extensions"` MCP ResourceValidator `json:"mcp"` Models ResourceValidator `json:"models"` Providers ResourceValidator `json:"providers"` UI ResourceValidator `json:"ui"` } `json:"group_resources"` MCP MCPSettings `json:"mcp"` Models ModelSettings `json:"models"` Providers ProviderSettings `json:"providers"` UI UISettings `json:"ui"` } // SettingsApplication defines model for SettingsApplication. type SettingsApplication struct { ActiveServiceRevision *ID `json:"active_service_revision" nullable:"true"` // CompositionChanged Whether this save changed the desired composition, so loaded sessions need a reload to apply it. Always false for providers, extension_settings, models and ui. A concurrent save to another composition group can make it true. GET /sessions?needs_reload=true lists the sessions. CompositionChanged bool `json:"composition_changed"` // DesiredRevision Opaque identity. Never infer a resource type or route from its contents. DesiredRevision ID `json:"desired_revision"` Validation string `json:"validation"` Warnings Warnings `json:"warnings"` } // SettingsChange defines model for SettingsChange. type SettingsChange = json.RawMessage // SettingsPatch The group query selects the one applicable patch schema. It is an error to send fields for another group. type SettingsPatch = json.RawMessage // SettingsRead defines model for SettingsRead. type SettingsRead = json.RawMessage // ShellCommand defines model for ShellCommand. type ShellCommand struct { Command string `json:"command"` // Delivery Whether this receipt was included in a model request whose response has started. Pending does not wake an idle agent; unknown is legacy tracking, detached is removed by rewind. Execution status is independent. Delivery string `json:"delivery"` Error *string `json:"error" nullable:"true"` ExitCode *int64 `json:"exit_code" nullable:"true"` HistorySeq *int64 `json:"history_seq" nullable:"true"` // ID Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. ID UUIDv7 `json:"id"` Output string `json:"output"` OutputBytes int64 `json:"output_bytes"` Status string `json:"status"` Truncated bool `json:"truncated"` } // ShellCommandOutput defines model for ShellCommandOutput. type ShellCommandOutput struct { NextOffset *int64 `json:"next_offset" nullable:"true"` Text string `json:"text"` } // ShellCommandRequest defines model for ShellCommandRequest. type ShellCommandRequest struct { Command string `json:"command"` } // ShellCommandResponse defines model for ShellCommandResponse. type ShellCommandResponse struct { ShellCommand ShellCommand `json:"shell_command"` } // Shutdown defines model for Shutdown. type Shutdown struct { // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` State string `json:"state"` } // ShutdownRequest defines model for ShutdownRequest. type ShutdownRequest struct { // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` // StopKernels End every Python kernel this daemon holds instead of leaving them running for the next daemon to attach to. Sessions save their variables first, as when they go idle; running jobs end. StopKernels *bool `json:"stop_kernels,omitempty"` TimeoutMs *int64 `json:"timeout_ms,omitempty"` } // SkillInputRequest defines model for SkillInputRequest. type SkillInputRequest struct { Arguments string `json:"arguments"` // CandidateID Opaque identity. Never infer a resource type or route from its contents. CandidateID ID `json:"candidate_id"` // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision ID `json:"catalog_revision"` ClientID *string `json:"client_id,omitempty"` Kind string `json:"kind"` } // SkillLoad A skill a user's slash activation loaded, as the `skill` JSON part of that user entry. type SkillLoad struct { Name string `json:"name"` // Scope The discovery root a skill came from. Empty for a user activation recorded before scopes were. Scope SkillScope `json:"scope"` // Source The installed SKILL.md path. Source string `json:"source"` } // SkillLoadList defines model for SkillLoadList. type SkillLoadList struct { // Items First loaded first. Items []SkillLoadSummary `json:"items"` } // SkillLoadSummary One skill a session loaded, by the model or the user, with how often and when. type SkillLoadSummary struct { Count int64 `json:"count"` // FirstLoadedAt Unix seconds. FirstLoadedAt int64 `json:"first_loaded_at"` // LastLoadedAt Unix seconds. LastLoadedAt int64 `json:"last_loaded_at"` Name string `json:"name"` // Scope The discovery root a skill came from. Empty for a user activation recorded before scopes were. Scope SkillScope `json:"scope"` // Source The installed SKILL.md path the newest load used. Source string `json:"source"` } // SkillScope The discovery root a skill came from. Empty for a user activation recorded before scopes were. type SkillScope = string // StorageFile defines model for StorageFile. type StorageFile struct { Bytes Counter `json:"bytes"` Category string `json:"category"` CleanupCandidate bool `json:"cleanup_candidate"` CleanupReason *string `json:"cleanup_reason" nullable:"true"` ModifiedAt *Timestamp `json:"modified_at" nullable:"true"` Path string `json:"path"` } // StorageFilePage defines model for StorageFilePage. type StorageFilePage struct { Items []StorageFile `json:"items"` Next *PageToken `json:"next" nullable:"true"` Totals struct { BackupBytes Counter `json:"backup_bytes"` KernelBytes Counter `json:"kernel_bytes"` OtherBytes Counter `json:"other_bytes"` RecentBackupBytes Counter `json:"recent_backup_bytes"` RecentBackupCount Counter `json:"recent_backup_count"` } `json:"totals"` } // StorageReport Examples: {"database":{"free_page_count":0,"main_file_bytes":8192,"page_count":2,"page_size_bytes":4096,"used_bytes":8192,"wal_bytes":0},"files":{"items":[],"next":null,"totals":{"backup_bytes":0,"kernel_bytes":0,"other_bytes":0,"recent_backup_bytes":0,"recent_backup_count":0}},"images":{"bytes":0,"count":0},"measured_at":"2026-10-02T14:00:00Z","sessions":{"items":[],"next":null,"total_count":0,"total_estimated_content_bytes":0}} type StorageReport struct { Database struct { FreePageCount Counter `json:"free_page_count"` MainFileBytes Counter `json:"main_file_bytes"` PageCount Counter `json:"page_count"` PageSizeBytes Counter `json:"page_size_bytes"` UsedBytes Counter `json:"used_bytes"` WalBytes Counter `json:"wal_bytes"` } `json:"database"` Files StorageFilePage `json:"files"` Images struct { Bytes Counter `json:"bytes"` Count Counter `json:"count"` } `json:"images"` // MeasuredAt UTC RFC 3339. MeasuredAt Timestamp `json:"measured_at"` Sessions StorageSessionPage `json:"sessions"` } // StorageSession defines model for StorageSession. type StorageSession struct { ActivityAt *Timestamp `json:"activity_at" nullable:"true"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` EstimatedContentBytes Counter `json:"estimated_content_bytes"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Title string `json:"title"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // StorageSessionPage defines model for StorageSessionPage. type StorageSessionPage struct { Items []StorageSession `json:"items"` Next *PageToken `json:"next" nullable:"true"` TotalCount Counter `json:"total_count"` TotalEstimatedContentBytes Counter `json:"total_estimated_content_bytes"` } // TargetNotification defines model for TargetNotification. type TargetNotification struct { Notification Notification `json:"notification"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // TerminalClose The interactive terminal session was closed and its process group ended. type TerminalClose struct { // Closed Opaque identity. Never infer a resource type or route from its contents. Closed ID `json:"closed"` } // TextContent defines model for TextContent. type TextContent struct { Kind string `json:"kind"` Text string `json:"text"` } // Timestamp UTC RFC 3339. type Timestamp = string // TokenObservation defines model for TokenObservation. type TokenObservation struct { Estimated *Counter `json:"estimated" nullable:"true"` Observed *Counter `json:"observed" nullable:"true"` Source *string `json:"source" nullable:"true"` } // ToolActivity defines model for ToolActivity. type ToolActivity struct { // Artifact The artifact version an `artifact` activity made; its title is the target. Artifact *struct { ID ArtifactID `json:"id"` Version int64 `json:"version"` } `json:"artifact,omitempty"` // Detail What the person watching sees of the result, as markdown; a web search's answer and sources, or displayed content. Detail *string `json:"detail,omitempty"` Kind string `json:"kind"` // Ms How long the call took, when it ended while its cell's trace was open. Ms *int64 `json:"ms,omitempty"` // Ok Whether the call worked, when it ended while its cell's trace was open. Ok *bool `json:"ok,omitempty"` // Skill Where the skill a `skill` activity loaded was found; its name is the target. A cell notes each skill once, when it reads the skill's SKILL.md from the start or runs its command. Skill *struct { // Scope The discovery root a skill came from. Empty for a user activation recorded before scopes were. Scope SkillScope `json:"scope"` // Source The installed SKILL.md path. Source string `json:"source"` } `json:"skill,omitempty"` Target string `json:"target"` } // ToolProgress Examples: {"call_id":"progress-1","intent":"unknown","name":"python","phase":"generating","preview":{"offset_scalars":0,"text":"print(\"hello\")"},"title":"find which go files label python cells","tool_call_id":null} type ToolProgress struct { // CallID Opaque identity. Never infer a resource type or route from its contents. CallID ID `json:"call_id"` Intent string `json:"intent"` Name string `json:"name"` Phase string `json:"phase"` Preview *ProgressPreview `json:"preview,omitempty"` Title *string `json:"title,omitempty" nullable:"true"` ToolCallID *string `json:"tool_call_id" nullable:"true"` } // ToolTrace defines model for ToolTrace. type ToolTrace struct { Activities []ToolActivity `json:"activities"` // Calls The session bindings the cell's code calls (`files.find`, `run`), sorted. Absent for a cell replayed from inside another. Calls []string `json:"calls,omitempty"` Changes []json.RawMessage `json:"changes"` Truncated bool `json:"truncated"` } // TraceContent defines model for TraceContent. type TraceContent struct { Kind string `json:"kind"` Trace ToolTrace `json:"trace"` } // TreeChild defines model for TreeChild. type TreeChild struct { Changed Counter `json:"changed"` Kind string `json:"kind"` Language *string `json:"language" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` Name string `json:"name"` } // TreeEntry defines model for TreeEntry. type TreeEntry struct { Changed Counter `json:"changed"` Children []TreeChild `json:"children"` Kind string `json:"kind"` Language *string `json:"language" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` More Counter `json:"more"` Name string `json:"name"` } // Turn defines model for Turn. type Turn struct { EndedAt *Timestamp `json:"ended_at" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Outcome *SafeReason `json:"outcome" nullable:"true"` // StartedAt UTC RFC 3339. StartedAt Timestamp `json:"started_at"` State string `json:"state"` } // UISettings defines model for UISettings. type UISettings struct { DismissedNotices []ID `json:"dismissed_notices"` // ProxyAllow Networks `albedo proxy` serves to besides this machine, as CIDR or an address whose trailing zero octets stand for any (10.0.0.0 is 10.0.0.0/8). ProxyAllow []string `json:"proxy_allow,omitempty"` Thinking bool `json:"thinking"` Tools bool `json:"tools"` // WebAllow Networks `albedo web` serves to besides this machine, as CIDR or an address whose trailing zero octets stand for any (10.0.0.0 is 10.0.0.0/8). WebAllow []string `json:"web_allow,omitempty"` } // UISettingsChange defines model for UISettingsChange. type UISettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource UISettingsResource `json:"resource"` } // UISettingsPatch defines model for UISettingsPatch. type UISettingsPatch struct { DismissedNotices []ID `json:"dismissed_notices,omitempty"` // ProxyAllow Networks `albedo proxy` serves to besides this machine, as CIDR or an address whose trailing zero octets stand for any (10.0.0.0 is 10.0.0.0/8). ProxyAllow []string `json:"proxy_allow,omitempty"` Thinking *bool `json:"thinking,omitempty"` Tools *bool `json:"tools,omitempty"` // WebAllow Networks `albedo web` serves to besides this machine, as CIDR or an address whose trailing zero octets stand for any (10.0.0.0 is 10.0.0.0/8). WebAllow []string `json:"web_allow,omitempty"` } // UISettingsResource defines model for UISettingsResource. type UISettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value UISettings `json:"value"` } // UUIDv7 Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. type UUIDv7 = string // Usage defines model for Usage. type Usage struct { CacheDriftTokens *Counter `json:"cache_drift_tokens,omitempty" nullable:"true"` CacheFade []struct { // At UTC RFC 3339. At Timestamp `json:"at"` CachedTokens *Counter `json:"cached_tokens" nullable:"true"` } `json:"cache_fade"` CacheMissTokens *Counter `json:"cache_miss_tokens,omitempty" nullable:"true"` CacheTTLSeconds *Counter `json:"cache_ttl_seconds" nullable:"true"` CacheWriteTokens *Counter `json:"cache_write_tokens" nullable:"true"` CachedPromptTokens *Counter `json:"cached_prompt_tokens" nullable:"true"` CompletionTokens *Counter `json:"completion_tokens" nullable:"true"` ContextWindowTokens *Counter `json:"context_window_tokens" nullable:"true"` ElapsedMs *float64 `json:"elapsed_ms" nullable:"true"` Model *ID `json:"model" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` PromptTokens *Counter `json:"prompt_tokens" nullable:"true"` TokensPerSecond *float64 `json:"tokens_per_second" nullable:"true"` TotalTokens *Counter `json:"total_tokens" nullable:"true"` } // ValueSource For env, value is a daemon-host environment variable name. type ValueSource struct { Source string `json:"source"` Value string `json:"value"` } // Visit defines model for Visit. type Visit struct { Opens Counter `json:"opens"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` // VisitID Opaque identity. Never infer a resource type or route from its contents. VisitID ID `json:"visit_id"` } // Warnings defines model for Warnings. type Warnings = []SafeReason // WebSearchProvider defines model for WebSearchProvider. type WebSearchProvider struct { Enabled bool `json:"enabled"` Label string `json:"label"` // Name Opaque identity. Never infer a resource type or route from its contents. Name ID `json:"name"` Position int64 `json:"position"` } // WebSearchProviderChange defines model for WebSearchProviderChange. type WebSearchProviderChange struct { Resource WebSearchProviderResource `json:"resource"` } // WebSearchProviderChangeRequest defines model for WebSearchProviderChangeRequest. type WebSearchProviderChangeRequest struct { Change string `json:"change"` } // WebSearchProviderPage defines model for WebSearchProviderPage. type WebSearchProviderPage struct { Items []WebSearchProviderResource `json:"items"` Next any `json:"next" nullable:"true"` Page PageDescriptor `json:"page"` } // WebSearchProviderResource defines model for WebSearchProviderResource. type WebSearchProviderResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value WebSearchProvider `json:"value"` } // WorkChange Examples: {"notification":{"code":null,"detail":null,"state":"not_requested"},"resource":{"etag":"\"work-revision-1\"","url":"/extensions/work/items/work-1?workspace=%2Fworkspace%2Fproject","value":{"created_at":"2026-10-02T14:00:00Z","id":"work-1","notes":"","parent_id":null,"revision":"work-revision-1","run_id":null,"session_id":null,"status":"open","title":"Fix the parser","updated_at":"2026-10-02T14:00:00Z","workspace":"/workspace/project"}}} type WorkChange struct { Notification Notification `json:"notification"` Resource WorkResource `json:"resource"` } // WorkCreate Examples: {"title":"Fix the parser"} type WorkCreate struct { Notes *string `json:"notes,omitempty"` // NotifySessionID Opaque identity. Never infer a resource type or route from its contents. NotifySessionID *ID `json:"notify_session_id,omitempty"` ParentID *ID `json:"parent_id,omitempty" nullable:"true"` RunID *ID `json:"run_id,omitempty" nullable:"true"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Title string `json:"title"` } // WorkItem defines model for WorkItem. type WorkItem struct { // CreatedAt UTC RFC 3339. CreatedAt Timestamp `json:"created_at"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Notes string `json:"notes"` ParentID *ID `json:"parent_id" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` RunID *ID `json:"run_id" nullable:"true"` SessionID *ID `json:"session_id" nullable:"true"` Status string `json:"status"` Title string `json:"title"` // UpdatedAt UTC RFC 3339. UpdatedAt Timestamp `json:"updated_at"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // WorkPage defines model for WorkPage. type WorkPage struct { Glance *Glance `json:"glance,omitempty"` Items []WorkResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // WorkPatch defines model for WorkPatch. type WorkPatch struct { Notes *string `json:"notes,omitempty"` // NotifySessionID Opaque identity. Never infer a resource type or route from its contents. NotifySessionID *ID `json:"notify_session_id,omitempty"` RunID *ID `json:"run_id,omitempty" nullable:"true"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Status *string `json:"status,omitempty"` Title *string `json:"title,omitempty"` } // WorkResource defines model for WorkResource. type WorkResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value WorkItem `json:"value"` } // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. type Workspace = string // WorkspaceChange defines model for WorkspaceChange. type WorkspaceChange struct { // Active Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Active Workspace `json:"active"` // Desired Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Desired Workspace `json:"desired"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` State string `json:"state"` } // WorkspaceDirectory defines model for WorkspaceDirectory. type WorkspaceDirectory struct { // Directory Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Directory Workspace `json:"directory"` Home *Workspace `json:"home" nullable:"true"` Host *Host `json:"host" nullable:"true"` Items []struct { Hidden bool `json:"hidden"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` ModifiedAt *Timestamp `json:"modified_at" nullable:"true"` Name string `json:"name"` Vcs *string `json:"vcs" nullable:"true"` } `json:"items"` Next *PageToken `json:"next" nullable:"true"` Parent *Workspace `json:"parent" nullable:"true"` Preview *WorkspacePreview `json:"preview,omitempty"` } // WorkspaceMoveRequest Examples: {"family_revision":"family-1","workspace":"/workspace/other-project"} type WorkspaceMoveRequest struct { // FamilyRevision Opaque identity. Never infer a resource type or route from its contents. FamilyRevision ID `json:"family_revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // WorkspacePreview defines model for WorkspacePreview. type WorkspacePreview struct { Languages []struct { Bytes Counter `json:"bytes"` Color *string `json:"color" nullable:"true"` Name string `json:"name"` Share float64 `json:"share"` } `json:"languages"` More Counter `json:"more"` Repository json.RawMessage `json:"repository" nullable:"true"` RepositoryDiagnostic *SafeReason `json:"repository_diagnostic" nullable:"true"` Tree []TreeEntry `json:"tree"` } // WorkspaceRead defines model for WorkspaceRead. type WorkspaceRead = json.RawMessage // AttachmentTokenOptional 32 random bytes, canonical unpadded base64url (the last character carries no stray bits). type AttachmentTokenOptional = AttachmentToken // IfMatch Strong opaque validator for the complete canonical representation. type IfMatch = ETag // IfNoneMatch defines model for IfNoneMatch. type IfNoneMatch = string // Limit defines model for Limit. type Limit = int64 // Next Opaque continuation, tied to the query and representation; never authority. type Next = PageToken // Problem400 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem400 = Problem // Problem401 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem401 = Problem // Problem403 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem403 = Problem // Problem404 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem404 = Problem // Problem405 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem405 = Problem // Problem406 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem406 = Problem // Problem409 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem409 = Problem // Problem410 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem410 = Problem // Problem412 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem412 = Problem // Problem413 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem413 = Problem // Problem415 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem415 = Problem // Problem428 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem428 = Problem // Problem429 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem429 = Problem // Problem503 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem503 = Problem // AnswerLoginParams defines parameters for AnswerLogin. type AnswerLoginParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetArtifactLatestVersionParams defines parameters for GetArtifactLatestVersion. type GetArtifactLatestVersionParams struct { // After The version the page shows; the answer waits for one past it. After *int64 `form:"after,omitempty" json:"after,omitempty"` } // ListArtifactsParams defines parameters for ListArtifacts. type ListArtifactsParams struct { Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` // Session Only this session's artifacts. Session *ID `form:"session,omitempty" json:"session,omitempty"` } // DeleteDiscordBotParams defines parameters for DeleteDiscordBot. type DeleteDiscordBotParams struct { Revision int64 `form:"revision" json:"revision"` } // UnlinkWorkspaceParams defines parameters for UnlinkWorkspace. type UnlinkWorkspaceParams struct { Workspace Workspace `form:"workspace" json:"workspace"` Member Workspace `form:"member" json:"member"` View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetLinkGroupParams defines parameters for GetLinkGroup. type GetLinkGroupParams struct { Workspace Workspace `form:"workspace" json:"workspace"` View *string `form:"view,omitempty" json:"view,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // MergeLinkGroupsParams defines parameters for MergeLinkGroups. type MergeLinkGroupsParams struct { Workspace Workspace `form:"workspace" json:"workspace"` View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListPaperclipsParams defines parameters for ListPaperclips. type ListPaperclipsParams struct { Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeletePaperclipsParams defines parameters for DeletePaperclips. type DeletePaperclipsParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchPaperclipsParams defines parameters for PatchPaperclips. type PatchPaperclipsParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ReadJobOutputParams defines parameters for ReadJobOutput. type ReadJobOutputParams struct { // Offset Byte to start from. Omitted, the page ends at the end of the output. Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` // Limit Most bytes in the page; four hold any character. Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // StopJobJSONBody defines parameters for StopJob. type StopJobJSONBody = map[string]interface{} // ListScheduleParams defines parameters for ListSchedule. type ListScheduleParams struct { SessionID ID `form:"session_id" json:"session_id"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteScheduleParams defines parameters for DeleteSchedule. type DeleteScheduleParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchScheduleParams defines parameters for PatchSchedule. type PatchScheduleParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListSkillLoadsParams defines parameters for ListSkillLoads. type ListSkillLoadsParams struct { SessionID ID `form:"session_id" json:"session_id"` } // ListHooksParams defines parameters for ListHooks. type ListHooksParams struct { SessionID *ID `form:"session_id,omitempty" json:"session_id,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteHookParams defines parameters for DeleteHook. type DeleteHookParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetHookParams defines parameters for GetHook. type GetHookParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` } // PatchHookParams defines parameters for PatchHook. type PatchHookParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListHookDeliveriesParams defines parameters for ListHookDeliveries. type ListHookDeliveriesParams struct { State *string `form:"state,omitempty" json:"state,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeliverWebhookParams defines parameters for DeliverWebhook. type DeliverWebhookParams struct { // XAlbedoEventID Optional sender identity scoped to hook and exact body hash. XAlbedoEventID *string `json:"X-Albedo-Event-Id,omitempty"` } // RotateHookSecretParams defines parameters for RotateHookSecret. type RotateHookSecretParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchHookPermissionParams defines parameters for PatchHookPermission. type PatchHookPermissionParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListWorkParams defines parameters for ListWork. type ListWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // CreateWorkParams defines parameters for CreateWork. type CreateWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` } // DeleteWorkParams defines parameters for DeleteWork. type DeleteWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` // NotifySessionID Queue the deletion note for this session after the durable edit. NotifySessionID *ID `form:"notify_session_id,omitempty" json:"notify_session_id,omitempty"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetWorkParams defines parameters for GetWork. type GetWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` } // PatchWorkParams defines parameters for PatchWork. type PatchWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListHostsParams defines parameters for ListHosts. type ListHostsParams struct { Target *ID `form:"target,omitempty" json:"target,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // ListModelsParams defines parameters for ListModels. type ListModelsParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` // Extension Cache-policy matching only; defaults to the empty selector. Extension *string `form:"extension,omitempty" json:"extension,omitempty"` // Host Cache-policy matching only; defaults to the empty selector. Host *string `form:"host,omitempty" json:"host,omitempty"` Model *ID `form:"model,omitempty" json:"model,omitempty"` ProviderProfile *ID `form:"provider_profile,omitempty" json:"provider_profile,omitempty"` Provider *ID `form:"provider,omitempty" json:"provider,omitempty"` Endpoint *string `form:"endpoint,omitempty" json:"endpoint,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetServerParams defines parameters for GetServer. type GetServerParams struct { Include *string `form:"include,omitempty" json:"include,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` // QuotaProvider Exact provider ID to filter quota history. Requires include=quota_history, quota_account, and quota_limit. QuotaProvider *string `form:"quota_provider,omitempty" json:"quota_provider,omitempty"` // QuotaAccount Exact account label to filter quota history. Requires include=quota_history, quota_provider, and quota_limit. QuotaAccount *string `form:"quota_account,omitempty" json:"quota_account,omitempty"` // QuotaLimit Exact limit ID to filter quota history. Requires include=quota_history, quota_provider, and quota_account. QuotaLimit *string `form:"quota_limit,omitempty" json:"quota_limit,omitempty"` // QuotaSince Filter quota history to observations at or after this RFC 3339 UTC timestamp. Requires include=quota_history and the limit filter trio. QuotaSince *Timestamp `form:"quota_since,omitempty" json:"quota_since,omitempty"` } // ListSessionsParams defines parameters for ListSessions. type ListSessionsParams struct { Scope *string `form:"scope,omitempty" json:"scope,omitempty"` ParentID *ID `form:"parent_id,omitempty" json:"parent_id,omitempty"` FamilyID *ID `form:"family_id,omitempty" json:"family_id,omitempty"` Workspace *Workspace `form:"workspace,omitempty" json:"workspace,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` Archived *bool `form:"archived,omitempty" json:"archived,omitempty"` NeedsReload *bool `form:"needs_reload,omitempty" json:"needs_reload,omitempty"` // Acp true lists only ACP-owned sessions, false only the others. Combine with workspace for an exact canonical workspace match. Acp *bool `form:"acp,omitempty" json:"acp,omitempty"` Sort *string `form:"sort,omitempty" json:"sort,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteSessionParams defines parameters for DeleteSession. type DeleteSessionParams struct { View string `form:"view" json:"view"` Scope *string `form:"scope,omitempty" json:"scope,omitempty"` FamilyRevision *ID `form:"family_revision,omitempty" json:"family_revision,omitempty"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetSessionParams defines parameters for GetSession. type GetSessionParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` Tail *int64 `form:"tail,omitempty" json:"tail,omitempty"` AfterGeneration *Generation `form:"after_generation,omitempty" json:"after_generation,omitempty"` AfterSeq *Counter `form:"after_seq,omitempty" json:"after_seq,omitempty"` } // PatchSessionParams defines parameters for PatchSession. type PatchSessionParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` // AlbedoAttachmentToken Required for kind acp creation and for input or scoped cancellation in an ACP session. Also authorizes model-only configuration patches by an ACP attachment holder. Ordinary creation ignores this header. Input, scoped cancellation, and configuration patches parse and reject malformed supplied values. Not part of the durable intent. AlbedoAttachmentToken *AttachmentTokenOptional `json:"Albedo-Attachment-Token,omitempty"` } // CreateSessionParams defines parameters for CreateSession. type CreateSessionParams struct { // IfNoneMatch Conditional creation only. IfNoneMatch IfNoneMatch `json:"If-None-Match"` // AlbedoAttachmentToken Required for kind acp creation and for input or scoped cancellation in an ACP session. Also authorizes model-only configuration patches by an ACP attachment holder. Ordinary creation ignores this header. Input, scoped cancellation, and configuration patches parse and reject malformed supplied values. Not part of the durable intent. AlbedoAttachmentToken *AttachmentTokenOptional `json:"Albedo-Attachment-Token,omitempty"` } // ReleaseACPSessionParams defines parameters for ReleaseACPSession. type ReleaseACPSessionParams struct { // AlbedoAttachmentToken Per-connection ACP attachment capability, generated by the client. Separate from the daemon bearer token; the daemon keeps only a digest in memory and never returns or logs it. AlbedoAttachmentToken AttachmentToken `json:"Albedo-Attachment-Token"` } // AttachACPSessionParams defines parameters for AttachACPSession. type AttachACPSessionParams struct { // AlbedoAttachmentToken Per-connection ACP attachment capability, generated by the client. Separate from the daemon bearer token; the daemon keeps only a digest in memory and never returns or logs it. AlbedoAttachmentToken AttachmentToken `json:"Albedo-Attachment-Token"` } // RenewACPSessionParams defines parameters for RenewACPSession. type RenewACPSessionParams struct { // AlbedoAttachmentToken Per-connection ACP attachment capability, generated by the client. Separate from the daemon bearer token; the daemon keeps only a digest in memory and never returns or logs it. AlbedoAttachmentToken AttachmentToken `json:"Albedo-Attachment-Token"` } // GetActiveOutputContentParams defines parameters for GetActiveOutputContent. type GetActiveOutputContentParams struct { Snapshot PageToken `form:"snapshot" json:"snapshot"` Next *PageToken `form:"next,omitempty" json:"next,omitempty"` } // GetCatalogParams defines parameters for GetCatalog. type GetCatalogParams struct { Kind *string `form:"kind,omitempty" json:"kind,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetContextParams defines parameters for GetContext. type GetContextParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` SnapshotID *ID `form:"snapshot_id,omitempty" json:"snapshot_id,omitempty"` SectionID *ID `form:"section_id,omitempty" json:"section_id,omitempty"` Page *Counter `form:"page,omitempty" json:"page,omitempty"` After *Counter `form:"after,omitempty" json:"after,omitempty"` // SinceMs Requests only. Include attempts finished at or after this Unix timestamp in milliseconds. SinceMs *Counter `form:"since_ms,omitempty" json:"since_ms,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // PatchFastModeApplicationMergePatchPlusJSONBody defines parameters for PatchFastMode. type PatchFastModeApplicationMergePatchPlusJSONBody struct { State string `json:"state"` } // PatchFastModeParams defines parameters for PatchFastMode. type PatchFastModeParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetSessionFileParams defines parameters for GetSessionFile. type GetSessionFileParams struct { // Path Absolute on the workspace's machine, relative to the workspace, `~/...` in a local workspace, or the host-prefixed spelling `path` answers with. Path string `form:"path" json:"path"` } // GetHistoryParams defines parameters for GetHistory. type GetHistoryParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` Before *Counter `form:"before,omitempty" json:"before,omitempty"` After *Counter `form:"after,omitempty" json:"after,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // GetHistoryContentBatchParams defines parameters for GetHistoryContentBatch. type GetHistoryContentBatchParams struct { // Entries Comma separated history entry ids, in display order, at most 200 of them, each at most 128 characters. Entries string `form:"entries" json:"entries"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetHistoryContentParams defines parameters for GetHistoryContent. type GetHistoryContentParams struct { Next *Next `form:"next,omitempty" json:"next,omitempty"` } // PutInputParams defines parameters for PutInput. type PutInputParams struct { // AlbedoAttachmentToken Required for kind acp creation and for input or scoped cancellation in an ACP session. Also authorizes model-only configuration patches by an ACP attachment holder. Ordinary creation ignores this header. Input, scoped cancellation, and configuration patches parse and reject malformed supplied values. Not part of the durable intent. AlbedoAttachmentToken *AttachmentTokenOptional `json:"Albedo-Attachment-Token,omitempty"` } // CancelInputParams defines parameters for CancelInput. type CancelInputParams struct { // AlbedoAttachmentToken Required for kind acp creation and for input or scoped cancellation in an ACP session. Also authorizes model-only configuration patches by an ACP attachment holder. Ordinary creation ignores this header. Input, scoped cancellation, and configuration patches parse and reject malformed supplied values. Not part of the durable intent. AlbedoAttachmentToken *AttachmentTokenOptional `json:"Albedo-Attachment-Token,omitempty"` } // GetShellCommandOutputParams defines parameters for GetShellCommandOutput. type GetShellCommandOutputParams struct { Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // GetSettingsParams defines parameters for GetSettings. type GetSettingsParams struct { Group *string `form:"group,omitempty" json:"group,omitempty"` } // PatchSettingsParams defines parameters for PatchSettings. type PatchSettingsParams struct { Group string `form:"group" json:"group"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetStorageParams defines parameters for GetStorage. type GetStorageParams struct { SessionsNext *PageToken `form:"sessions_next,omitempty" json:"sessions_next,omitempty"` FilesNext *PageToken `form:"files_next,omitempty" json:"files_next,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` } // AttachTerminalParams defines parameters for AttachTerminal. type AttachTerminalParams struct { // Cwd Initial working directory for the terminal session. Cwd *string `form:"cwd,omitempty" json:"cwd,omitempty"` // SessionID Existing session ID to derive initial working directory from. SessionID *ID `form:"session_id,omitempty" json:"session_id,omitempty"` // Cols Terminal column width (2-500, default 80). Cols *int64 `form:"cols,omitempty" json:"cols,omitempty"` // Rows Terminal row height (1-200, default 24). Rows *int64 `form:"rows,omitempty" json:"rows,omitempty"` // Restart Whether to restart an existing terminal process group. Restart *bool `form:"restart,omitempty" json:"restart,omitempty"` // Shell Command or shell executable to run (defaults to user shell). Shell *string `form:"shell,omitempty" json:"shell,omitempty"` } // GetWorkspacesParams defines parameters for GetWorkspaces. type GetWorkspacesParams struct { Location *Workspace `form:"location,omitempty" json:"location,omitempty"` Include *string `form:"include,omitempty" json:"include,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // PatchAccountJSONRequestBody defines body for PatchAccount for application/json ContentType. type PatchAccountJSONRequestBody = AccountPatch // PutKeyAccountJSONRequestBody defines body for PutKeyAccount for application/json ContentType. type PutKeyAccountJSONRequestBody = KeyAccountRequest // AnswerLoginApplicationMergePatchPlusJSONRequestBody defines body for AnswerLogin for application/merge-patch+json ContentType. type AnswerLoginApplicationMergePatchPlusJSONRequestBody = LoginPatch // CreateLoginJSONRequestBody defines body for CreateLogin for application/json ContentType. type CreateLoginJSONRequestBody = LoginRequest // ReportArtifactErrorTextRequestBody defines body for ReportArtifactError for text/plain ContentType. type ReportArtifactErrorTextRequestBody = ArtifactError // SaveArtifactStateTextRequestBody defines body for SaveArtifactState for text/plain ContentType. type SaveArtifactStateTextRequestBody = ArtifactState // CreateDiscordBotJSONRequestBody defines body for CreateDiscordBot for application/json ContentType. type CreateDiscordBotJSONRequestBody = DiscordBotCreate // PatchDiscordBotApplicationMergePatchPlusJSONRequestBody defines body for PatchDiscordBot for application/merge-patch+json ContentType. type PatchDiscordBotApplicationMergePatchPlusJSONRequestBody = DiscordBotPatch // PutDiscordChannelJSONRequestBody defines body for PutDiscordChannel for application/json ContentType. type PutDiscordChannelJSONRequestBody = DiscordChannelSetting // PutDiscordDMJSONRequestBody defines body for PutDiscordDM for application/json ContentType. type PutDiscordDMJSONRequestBody = DiscordAllow // MergeLinkGroupsJSONRequestBody defines body for MergeLinkGroups for application/json ContentType. type MergeLinkGroupsJSONRequestBody = LinkMerge // CreatePaperclipsJSONRequestBody defines body for CreatePaperclips for application/json ContentType. type CreatePaperclipsJSONRequestBody = PaperclipCreate // PatchPaperclipsApplicationMergePatchPlusJSONRequestBody defines body for PatchPaperclips for application/merge-patch+json ContentType. type PatchPaperclipsApplicationMergePatchPlusJSONRequestBody = PaperclipPatch // CreateProxyCompletionJSONRequestBody defines body for CreateProxyCompletion for application/json ContentType. type CreateProxyCompletionJSONRequestBody = ProxyCompletionRequest // StopJobJSONRequestBody defines body for StopJob for application/json ContentType. type StopJobJSONRequestBody = StopJobJSONBody // CreateScheduleJSONRequestBody defines body for CreateSchedule for application/json ContentType. type CreateScheduleJSONRequestBody = ScheduleCreate // PatchScheduleApplicationMergePatchPlusJSONRequestBody defines body for PatchSchedule for application/merge-patch+json ContentType. type PatchScheduleApplicationMergePatchPlusJSONRequestBody = SchedulePatch // ChangeWebSearchProviderJSONRequestBody defines body for ChangeWebSearchProvider for application/json ContentType. type ChangeWebSearchProviderJSONRequestBody = WebSearchProviderChangeRequest // CreateHookJSONRequestBody defines body for CreateHook for application/json ContentType. type CreateHookJSONRequestBody = HookCreate // PatchHookApplicationMergePatchPlusJSONRequestBody defines body for PatchHook for application/merge-patch+json ContentType. type PatchHookApplicationMergePatchPlusJSONRequestBody = HookPatch // RotateHookSecretJSONRequestBody defines body for RotateHookSecret for application/json ContentType. type RotateHookSecretJSONRequestBody = HookSecretRequest // PatchHookPermissionApplicationMergePatchPlusJSONRequestBody defines body for PatchHookPermission for application/merge-patch+json ContentType. type PatchHookPermissionApplicationMergePatchPlusJSONRequestBody = HookPermissionPatch // CreateWorkJSONRequestBody defines body for CreateWork for application/json ContentType. type CreateWorkJSONRequestBody = WorkCreate // PatchWorkApplicationMergePatchPlusJSONRequestBody defines body for PatchWork for application/merge-patch+json ContentType. type PatchWorkApplicationMergePatchPlusJSONRequestBody = WorkPatch // ProbeHostJSONRequestBody defines body for ProbeHost for application/json ContentType. type ProbeHostJSONRequestBody = EmptyRequest // ShutdownServerJSONRequestBody defines body for ShutdownServer for application/json ContentType. type ShutdownServerJSONRequestBody = ShutdownRequest // PatchSessionApplicationMergePatchPlusJSONRequestBody defines body for PatchSession for application/merge-patch+json ContentType. type PatchSessionApplicationMergePatchPlusJSONRequestBody = SessionChangeRequest // CreateSessionJSONRequestBody defines body for CreateSession for application/json ContentType. type CreateSessionJSONRequestBody = SessionCreationRequest // AttachACPSessionJSONRequestBody defines body for AttachACPSession for application/json ContentType. type AttachACPSessionJSONRequestBody = ACPAttachRequest // RenewACPSessionJSONRequestBody defines body for RenewACPSession for application/json ContentType. type RenewACPSessionJSONRequestBody = EmptyRequest // CompactSessionJSONRequestBody defines body for CompactSession for application/json ContentType. type CompactSessionJSONRequestBody = CompactionRequest // PatchFastModeApplicationMergePatchPlusJSONRequestBody defines body for PatchFastMode for application/merge-patch+json ContentType. type PatchFastModeApplicationMergePatchPlusJSONRequestBody PatchFastModeApplicationMergePatchPlusJSONBody // PutInputJSONRequestBody defines body for PutInput for application/json ContentType. type PutInputJSONRequestBody = InputRequest // CancelInputJSONRequestBody defines body for CancelInput for application/json ContentType. type CancelInputJSONRequestBody = EmptyRequest // InterruptSessionJSONRequestBody defines body for InterruptSession for application/json ContentType. type InterruptSessionJSONRequestBody = InterruptRequest // UpgradeKernelJSONRequestBody defines body for UpgradeKernel for application/json ContentType. type UpgradeKernelJSONRequestBody = EmptyRequest // ReloadSessionJSONRequestBody defines body for ReloadSession for application/json ContentType. type ReloadSessionJSONRequestBody = ReloadRequest // RewindSessionJSONRequestBody defines body for RewindSession for application/json ContentType. type RewindSessionJSONRequestBody = RewindRequest // PutShellCommandJSONRequestBody defines body for PutShellCommand for application/json ContentType. type PutShellCommandJSONRequestBody = ShellCommandRequest // RecordVisitJSONRequestBody defines body for RecordVisit for application/json ContentType. type RecordVisitJSONRequestBody = EmptyRequest // PatchSettingsApplicationMergePatchPlusJSONRequestBody defines body for PatchSettings for application/merge-patch+json ContentType. type PatchSettingsApplicationMergePatchPlusJSONRequestBody = SettingsPatch // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. // // The standard http.Client implements this interface. type HttpRequestDoer interface { Do(req *http.Request) (*http.Response, error) } // Client which conforms to the OpenAPI3 specification for this service. type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn } // ClientOption allows setting custom parameters during construction type ClientOption func(*Client) error // Creates a new Client, with reasonable defaults func NewClient(server string, opts ...ClientOption) (*Client, error) { // create a client with sane default values client := Client{ Server: server, } // mutate client and add all optional params for _, o := range opts { if err := o(&client); err != nil { return nil, err } } // ensure the server URL always has a trailing slash if !strings.HasSuffix(client.Server, "/") { client.Server += "/" } // create httpClient, if not already present if client.Client == nil { client.Client = &http.Client{} } return &client, nil } // WithHTTPClient allows overriding the default Doer, which is // automatically created using http.Client. This is useful for tests. func WithHTTPClient(doer HttpRequestDoer) ClientOption { return func(c *Client) error { c.Client = doer return nil } } // WithRequestEditorFn allows setting up a callback function, which will be // called right before sending the request. This can be used to mutate the request. func WithRequestEditorFn(fn RequestEditorFn) ClientOption { return func(c *Client) error { c.RequestEditors = append(c.RequestEditors, fn) return nil } } // The interface specification for the client above. type ClientInterface interface { // GetAuth Read login choices and redacted accounts // // Requires capability `provider_auth: 1`. // // Corresponds with GET /auth (the `GetAuth` operationId). GetAuth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteAccount Remove an unreferenced provider account // // Reject if a profile pins it by `account_id`, if it is the last account of a profile's `account_ids`, or if it comes from the environment (`account_external`). Otherwise it also leaves every `account_ids` list naming it. Does not interrupt captured credentials in an active request. Account IDs are never reused. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/accounts/{account_id} (the `DeleteAccount` operationId). DeleteAccount(ctx context.Context, accountID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchAccountWithBody Rename a saved provider account // // Environment accounts cannot be renamed (`account_external`). Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/accounts/{account_id} (the `PatchAccount` operationId). PatchAccountWithBody(ctx context.Context, accountID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchAccount Rename a saved provider account // // Environment accounts cannot be renamed (`account_external`). Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PATCH /auth/accounts/{account_id} (the `PatchAccount` operationId). PatchAccount(ctx context.Context, accountID ID, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PutKeyAccountWithBody Save an API key as a provider account // // The client chooses the account id (a UUIDv7). Replaying the same request returns the account; different content at a used id is `409 conflict`. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/keys/{account_id} (the `PutKeyAccount` operationId). PutKeyAccountWithBody(ctx context.Context, accountID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutKeyAccount Save an API key as a provider account // // The client chooses the account id (a UUIDv7). Replaying the same request returns the account; different content at a used id is `409 conflict`. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/keys/{account_id} (the `PutKeyAccount` operationId). PutKeyAccount(ctx context.Context, accountID UUIDv7, body PutKeyAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelLogin Cancel a login idempotently // // Cancellation stops only this flow; completed accounts remain saved. No If-Match is needed for identity-scoped cancellation. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/logins/{login_id} (the `CancelLogin` operationId). CancelLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // GetLogin Inspect a provider login // // No credential or submitted form echo. Terminal records remain fifteen minutes; unfinished flows expire at their provider deadline. Requires capability `provider_auth: 1`. // // Corresponds with GET /auth/logins/{login_id} (the `GetLogin` operationId). GetLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // AnswerLoginWithBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). AnswerLoginWithBody(ctx context.Context, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AnswerLoginWithApplicationMergePatchPlusJSONBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). AnswerLoginWithApplicationMergePatchPlusJSONBody(ctx context.Context, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateLoginWithBody Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). CreateLoginWithBody(ctx context.Context, loginID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateLogin Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). CreateLogin(ctx context.Context, loginID UUIDv7, body CreateLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetEvents Upgrade to multiplexed live session events // // WebSocket upgrade endpoint, authenticated by the same bearer token and origin // policy as other daemon routes. A socket owns at most 64 keyed follows. // Client text frames are JSON objects: {key,type:"session",session_id,tail:0, // after_generation?,after_seq?}, {key,type:"sessions",scope:"roots"}, // {key,type:"stop"}, or {type:"ping"}. Keys contain 1 to 128 UTF-8 bytes. // Session replay and tail validation match GET /sessions/{session_id} SSE. // Subscribing an existing key replaces that follow. after_seq accepts an // integer or its decimal string; tail defaults to 100 and is at most 200. // Server text frames are {key,batch:}: session batches // carry generation,cursor,events and optional snapshot; collection batches // carry events. A successful send acknowledges its session cursor. A follow // ending (including stop, deletion, failure or overflow) sends {key,end:true}. // Invalid commands and admission refusals send {key,failure:{code,detail}}; // malformed commands without a usable key use an empty key. Session failures // and collection overflow retain their SSE batch before the end frame. // Ping replies and 15-second keepalives are {type:"pong"}. Commands are at // most 4096 UTF-8 bytes; response frames are at most 1 MiB. Unsubscribe and // socket closure release watches. Clients reconnect a follow with its last // fully consumed cursor. Existing SSE routes remain available. // // Corresponds with GET /events (the `GetEvents` operationId). GetEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ReportArtifactErrorWithBody Record a failure in the page // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/errors (the `ReportArtifactError` operationId). ReportArtifactErrorWithBody(ctx context.Context, frame string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ReportArtifactErrorWithTextBody Record a failure in the page // // Takes a body of the `text/plain` content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/errors (the `ReportArtifactError` operationId). ReportArtifactErrorWithTextBody(ctx context.Context, frame string, version string, body ReportArtifactErrorTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // SaveArtifactStateWithBody Save the page's localStorage // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/state (the `SaveArtifactState` operationId). SaveArtifactStateWithBody(ctx context.Context, frame string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // SaveArtifactStateWithTextBody Save the page's localStorage // // Takes a body of the `text/plain` content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/state (the `SaveArtifactState` operationId). SaveArtifactStateWithTextBody(ctx context.Context, frame string, version string, body SaveArtifactStateTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetArtifactLatestVersion Wait for a newer version of an artifact // // What a page open on `latest/` in a tab of its own asks to know when to reload. With `after`, the daemon holds the answer until the latest version passes it or about 25 seconds pass; without, it answers at once. The version in the path only has to exist. // // Corresponds with GET /extensions/artifacts/frame/{frame}/{version}/.albedo/version (the `GetArtifactLatestVersion` operationId). GetArtifactLatestVersion(ctx context.Context, frame string, version string, params *GetArtifactLatestVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetArtifactFile Serve one file of one artifact version // // `albedo web` forwards `/frame/...` here; see robot-docs/artifacts.md. A wrong key answers 404. `path` may contain `/`; one ending in `/` serves its index.html, and an empty one the entry of that version. Under `latest` files are `no-cache` and the bridge is told to follow; the files of a numbered version are immutable. // // Corresponds with GET /extensions/artifacts/frame/{frame}/{version}/{path} (the `GetArtifactFile` operationId). GetArtifactFile(ctx context.Context, frame string, version string, path string, reqEditors ...RequestEditorFn) (*http.Response, error) // ListArtifacts List artifacts, newest change first // // Requires enabled extension artifacts. Artifacts outlive their session; `session_deleted` marks one whose session is gone. // // Corresponds with GET /extensions/artifacts/items (the `ListArtifacts` operationId). ListArtifacts(ctx context.Context, params *ListArtifactsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteArtifact Delete an artifact and every version of it // // Corresponds with DELETE /extensions/artifacts/items/{artifact_id} (the `DeleteArtifact` operationId). DeleteArtifact(ctx context.Context, artifactID ArtifactID, reqEditors ...RequestEditorFn) (*http.Response, error) // GetArtifact Read one artifact with its versions // // Corresponds with GET /extensions/artifacts/items/{artifact_id} (the `GetArtifact` operationId). GetArtifact(ctx context.Context, artifactID ArtifactID, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDiscordBots List Discord bots of every session without tokens // // Corresponds with GET /extensions/discord/bots (the `ListDiscordBots` operationId). ListDiscordBots(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateDiscordBotWithBody Create the Discord bot of a session // // One bot per session (409 bot_exists). The token must have three dot-separated parts and is never returned. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/discord/bots (the `CreateDiscordBot` operationId). CreateDiscordBotWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateDiscordBot Create the Discord bot of a session // // One bot per session (409 bot_exists). The token must have three dot-separated parts and is never returned. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/discord/bots (the `CreateDiscordBot` operationId). CreateDiscordBot(ctx context.Context, body CreateDiscordBotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDiscordBot Delete a Discord bot and its channel and DM settings // // Corresponds with DELETE /extensions/discord/bots/{bot_id} (the `DeleteDiscordBot` operationId). DeleteDiscordBot(ctx context.Context, botID ID, params *DeleteDiscordBotParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDiscordBot Read a Discord bot and its live state // // Corresponds with GET /extensions/discord/bots/{bot_id} (the `GetDiscordBot` operationId). GetDiscordBot(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchDiscordBotWithBody Edit a Discord bot at an observed revision // // A token or enabled change restarts or stops the bot process. A stale revision is 412 precondition_failed. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/discord/bots/{bot_id} (the `PatchDiscordBot` operationId). PatchDiscordBotWithBody(ctx context.Context, botID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchDiscordBotWithApplicationMergePatchPlusJSONBody Edit a Discord bot at an observed revision // // A token or enabled change restarts or stops the bot process. A stale revision is 412 precondition_failed. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/discord/bots/{bot_id} (the `PatchDiscordBot` operationId). PatchDiscordBotWithApplicationMergePatchPlusJSONBody(ctx context.Context, botID ID, body PatchDiscordBotApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PutDiscordChannelWithBody Set how a channel reaches the session // // Delivery off removes the channel; threads follow their parent channel. // // Takes any type of body and a specified content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/channels/{channel_id} (the `PutDiscordChannel` operationId). PutDiscordChannelWithBody(ctx context.Context, botID ID, channelID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutDiscordChannel Set how a channel reaches the session // // Delivery off removes the channel; threads follow their parent channel. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/channels/{channel_id} (the `PutDiscordChannel` operationId). PutDiscordChannel(ctx context.Context, botID ID, channelID ID, body PutDiscordChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDiscordDMs Read the DM allow list and pending requests // // Corresponds with GET /extensions/discord/bots/{bot_id}/dms (the `GetDiscordDMs` operationId). GetDiscordDMs(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDiscordDM Remove a person from the DM allow list // // The owner cannot be removed (400). // // Corresponds with DELETE /extensions/discord/bots/{bot_id}/dms/{user_id} (the `DeleteDiscordDM` operationId). DeleteDiscordDM(ctx context.Context, botID ID, userID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PutDiscordDMWithBody Allow a person to DM the session // // A null name is resolved from Discord when the bot is online. Allowing removes a pending request. // // Takes any type of body and a specified content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/dms/{user_id} (the `PutDiscordDM` operationId). PutDiscordDMWithBody(ctx context.Context, botID ID, userID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutDiscordDM Allow a person to DM the session // // A null name is resolved from Discord when the bot is online. Allowing removes a pending request. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/dms/{user_id} (the `PutDiscordDM` operationId). PutDiscordDM(ctx context.Context, botID ID, userID ID, body PutDiscordDMJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDiscordGuilds List the servers and channels the bot can see, with their delivery // // Read live from the bot process; 503 bot_offline when the bot is not online. // // Corresponds with GET /extensions/discord/bots/{bot_id}/guilds (the `ListDiscordGuilds` operationId). ListDiscordGuilds(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDiscordRequest Dismiss a pending DM request // // Corresponds with DELETE /extensions/discord/bots/{bot_id}/requests/{user_id} (the `DeleteDiscordRequest` operationId). DeleteDiscordRequest(ctx context.Context, botID ID, userID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // UnlinkWorkspace Remove a member from the observed group // // Check membership at commit. Creates a singleton group; deletes no work or memory. Human-only. // // Corresponds with DELETE /extensions/links/groups (the `UnlinkWorkspace` operationId). UnlinkWorkspace(ctx context.Context, params *UnlinkWorkspaceParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetLinkGroup Read linked membership and presence // // Only configuration view has the canonical membership ETag. Presence does not change that validator. // // Corresponds with GET /extensions/links/groups (the `GetLinkGroup` operationId). GetLinkGroup(ctx context.Context, params *GetLinkGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) // MergeLinkGroupsWithBody Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). MergeLinkGroupsWithBody(ctx context.Context, params *MergeLinkGroupsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // MergeLinkGroups Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). MergeLinkGroups(ctx context.Context, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListPaperclips List paperclips resources // // Requires enabled extension paperclips. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/paperclips/items (the `ListPaperclips` operationId). ListPaperclips(ctx context.Context, params *ListPaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePaperclipsWithBody Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). CreatePaperclipsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePaperclips Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). CreatePaperclips(ctx context.Context, body CreatePaperclipsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeletePaperclips Delete a paperclips resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/paperclips/items/{item_id} (the `DeletePaperclips` operationId). DeletePaperclips(ctx context.Context, itemID ID, params *DeletePaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetPaperclips Read one paperclips resource // // Corresponds with GET /extensions/paperclips/items/{item_id} (the `GetPaperclips` operationId). GetPaperclips(ctx context.Context, itemID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchPaperclipsWithBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). PatchPaperclipsWithBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchPaperclipsWithApplicationMergePatchPlusJSONBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). PatchPaperclipsWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateProxyCompletionWithBody Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). CreateProxyCompletionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateProxyCompletion Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). CreateProxyCompletion(ctx context.Context, body CreateProxyCompletionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListProxyModels List saved-profile OpenAI model IDs // // External OpenAI envelope. Bearer required unless operator explicitly configured anonymous loopback access. // // Corresponds with GET /extensions/proxy/v1/models (the `ListProxyModels` operationId). ListProxyModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ListJobs Read bounded live job observations and the jobs page // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs (the `ListJobs` operationId). ListJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // ListRecentJobs Read the kernel's jobs, running and finished // // What the session's kernel still knows of the jobs its run tool started, newest first, with up to 100 rows. Finished jobs stay for as long as the kernel keeps their output (its 64 newest). A session with no kernel has none. // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs/recent (the `ListRecentJobs` operationId). ListRecentJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // ReadJobOutput Read a page of one job's output // // Pages are byte ranges cut on character boundaries, so a reader that continues from `next_offset` loses none of what the job wrote; a running job's last character waits for the page after it. Without `offset` the page is the end of the output. Reading never counts as the model reading the job's result. // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs/{job_id}/output (the `ReadJobOutput` operationId). ReadJobOutput(ctx context.Context, sessionID ID, jobID ID, params *ReadJobOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error) // StopJobWithBody Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). StopJobWithBody(ctx context.Context, sessionID ID, jobID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // StopJob Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). StopJob(ctx context.Context, sessionID ID, jobID ID, body StopJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSchedule List schedule resources // // Requires enabled extension schedule. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/schedule/jobs (the `ListSchedule` operationId). ListSchedule(ctx context.Context, params *ListScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateScheduleWithBody Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). CreateScheduleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSchedule Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). CreateSchedule(ctx context.Context, body CreateScheduleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSchedule Delete a schedule resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/schedule/jobs/{job_id} (the `DeleteSchedule` operationId). DeleteSchedule(ctx context.Context, jobID ID, params *DeleteScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSchedule Read one schedule resource // // Corresponds with GET /extensions/schedule/jobs/{job_id} (the `GetSchedule` operationId). GetSchedule(ctx context.Context, jobID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchScheduleWithBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). PatchScheduleWithBody(ctx context.Context, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchScheduleWithApplicationMergePatchPlusJSONBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). PatchScheduleWithApplicationMergePatchPlusJSONBody(ctx context.Context, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSkillLoads List the skills a session loaded // // Requires enabled extension skills. Each skill the session's model or user loaded, once, first loaded first; the session's sidebar glance lists the same. // // Corresponds with GET /extensions/skills/loads (the `ListSkillLoads` operationId). ListSkillLoads(ctx context.Context, params *ListSkillLoadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ListWebSearchProviders List web search providers in the order a search tries them // // Requires enabled extension web-search. The global order lives in extensions.json. // // Corresponds with GET /extensions/web-search/providers (the `ListWebSearchProviders` operationId). ListWebSearchProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ChangeWebSearchProviderWithBody Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). ChangeWebSearchProviderWithBody(ctx context.Context, name ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ChangeWebSearchProvider Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). ChangeWebSearchProvider(ctx context.Context, name ID, body ChangeWebSearchProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDelivery Read an accepted delivery payload // // Corresponds with GET /extensions/webhooks/deliveries/{delivery_id} (the `GetDelivery` operationId). GetDelivery(ctx context.Context, deliveryID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHooks List hooks without secrets // // Corresponds with GET /extensions/webhooks/hooks (the `ListHooks` operationId). ListHooks(ctx context.Context, params *ListHooksParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateHookWithBody Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). CreateHookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateHook Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). CreateHook(ctx context.Context, body CreateHookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteHook Delete a hook while retaining accepted deliveries // // Corresponds with DELETE /extensions/webhooks/hooks/{hook_id} (the `DeleteHook` operationId). DeleteHook(ctx context.Context, hookID ID, params *DeleteHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHook Read hook state or canonical configuration // // ETag is present only on configuration view. Ordinary read exposes the configuration resource and validator plus runtime observations. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id} (the `GetHook` operationId). GetHook(ctx context.Context, hookID ID, params *GetHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookWithBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). PatchHookWithBody(ctx context.Context, hookID ID, params *PatchHookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookWithApplicationMergePatchPlusJSONBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). PatchHookWithApplicationMergePatchPlusJSONBody(ctx context.Context, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHookDeliveries Read accepted hook delivery metadata // // Historical reads remain available after hook deletion while retained deliveries exist. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id}/deliveries (the `ListHookDeliveries` operationId). ListHookDeliveries(ctx context.Context, hookID ID, params *ListHookDeliveriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeliverWebhookWithBody Accept signed external data durably // // Authenticate configured HMAC-SHA256 over the exact raw body. A daemon bearer is not a substitute. Signature header name and prefix come from hook configuration. Same event ID and body returns original admission; changed body conflicts. Pending inbox limit 1000. Raw body maximum 65536 bytes. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/deliveries (the `DeliverWebhook` operationId). DeliverWebhookWithBody(ctx context.Context, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RotateHookSecretWithBody Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). RotateHookSecretWithBody(ctx context.Context, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RotateHookSecret Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). RotateHookSecret(ctx context.Context, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHookPermission Read agent hook-management permission // // Absent stored permission reads false with its initial canonical validator. // // Corresponds with GET /extensions/webhooks/permissions/{session_id} (the `GetHookPermission` operationId). GetHookPermission(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookPermissionWithBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). PatchHookPermissionWithBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookPermissionWithApplicationMergePatchPlusJSONBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). PatchHookPermissionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListWork List work resources // // Requires enabled extension work. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/work/items (the `ListWork` operationId). ListWork(ctx context.Context, params *ListWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateWorkWithBody Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). CreateWorkWithBody(ctx context.Context, params *CreateWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateWork Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). CreateWork(ctx context.Context, params *CreateWorkParams, body CreateWorkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteWork Delete a work resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/work/items/{item_id} (the `DeleteWork` operationId). DeleteWork(ctx context.Context, itemID ID, params *DeleteWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetWork Read one work resource // // Corresponds with GET /extensions/work/items/{item_id} (the `GetWork` operationId). GetWork(ctx context.Context, itemID ID, params *GetWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchWorkWithBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). PatchWorkWithBody(ctx context.Context, itemID ID, params *PatchWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchWorkWithApplicationMergePatchPlusJSONBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). PatchWorkWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHosts Read known SSH hosts and cached state // // Requires capability `host_probes: 1`. // // Corresponds with GET /hosts (the `ListHosts` operationId). ListHosts(ctx context.Context, params *ListHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ProbeHostWithBody Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). ProbeHostWithBody(ctx context.Context, host ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ProbeHost Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). ProbeHost(ctx context.Context, host ID, body ProbeHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListModels Read provider model metadata // // In catalogue view, exactly one of provider_profile/provider is required. Endpoint is allowed only with provider. Unknown facts are null. A manual unlisted ID remains usable. Optional model returns one metadata row, including cap_key, for an unlisted manual ID; unknown facts stay null. // // Corresponds with GET /models (the `ListModels` operationId). ListModels(ctx context.Context, params *ListModelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetServer Read daemon identity and capabilities // // No startup or replacement. Authentication and protocol failures remain actionable errors. Pagination is valid only with include=quota_history. // // Corresponds with GET /server (the `GetServer` operationId). GetServer(ctx context.Context, params *GetServerParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ShutdownServerWithBody Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes any type of body and a specified content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). ShutdownServerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ShutdownServer Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes a body of the `application/json` content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). ShutdownServer(ctx context.Context, body ShutdownServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSessions Browse sessions or watch collection changes // // JSON defaults to roots, or all with parent/family. Parent and family are exclusive. Explicit roots with either is invalid. SSE accepts the same scope filters, excluding sort/limit/next; no cursor or replay. Subscribe, wait for ready, then read pages. Closure or overflow repeats this flow. // // Corresponds with GET /sessions (the `ListSessions` operationId). ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSession Delete a leaf or captured subtree // // Leaf requires idle and no children. Subtree requires the session's observed family revision and gates new children, interrupts captured members and deletes deepest first. Partial outcomes are explicit. Refresh before confirming a new attempt; never automatically replay after transport loss. // // Corresponds with DELETE /sessions/{session_id} (the `DeleteSession` operationId). DeleteSession(ctx context.Context, sessionID ID, params *DeleteSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSession Read or watch one session // // JSON defaults to complete Session. Configuration and status JSON exclude tail and replay parameters. SSE accepts tail and after_generation/after_seq, without view. Initial subscription omits both cursors; reconnect keeps the fully consumed pair. A missing generation requests reset. after_generation without after_seq is invalid. Neither auth failure nor closure starts a daemon. // // Corresponds with GET /sessions/{session_id} (the `GetSession` operationId). GetSession(ctx context.Context, sessionID ID, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSessionWithBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change carrying the observed session family revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. An ACP attachment holder may select a model with a patch containing only model and an optional provider_profile; other execution changes remain unavailable to ACP sessions. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). PatchSessionWithBody(ctx context.Context, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSessionWithApplicationMergePatchPlusJSONBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change carrying the observed session family revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. An ACP attachment holder may select a model with a patch containing only model and an optional provider_profile; other execution changes remain unavailable to ACP sessions. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). PatchSessionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSessionWithBody Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). CreateSessionWithBody(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSession Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). CreateSession(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ReleaseACPSession Release this connection's attachment // // Idempotent. Never cancels accepted inputs, the active turn, or the MCP overlay. // // Corresponds with DELETE /sessions/{session_id}/acp-attachment (the `ReleaseACPSession` operationId). ReleaseACPSession(ctx context.Context, sessionID ID, params *ReleaseACPSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // AttachACPSessionWithBody Attach this ACP connection as the session's single writer // // Attach or re-attach with the same token. 409 not_acp_session for a session created without kind acp; 409 workspace_mismatch unless workspace equals the session's canonical workspace exactly; 409 attachment_held while another token holds a live lease (never stolen); 409 session_busy when the session has an active turn and the overlay differs from the installed one (nothing changes); 409 mcp_overlay_conflict for duplicate names or names already configured globally; 409 mcp_overlay_failed when an idle replacement could not be prepared (the previous overlay and attachment stay as they were). 503 overlay_installed_reload_failed means publication succeeded but runtime reload failed; the replacement remains installed. 503 overlay_update_uncertain means publication or reload was not confirmed within 15 seconds and may still complete. An identical reattach retries a failed reload. With editor-mcp enabled, publication awaiting reload blocks turns with 409 overlay_installed_reload_failed. A missing required overlay after restart blocks turns with 409 overlay_reattach_required; the editor must resume and resupply its servers. An empty overlay permits daemon-driven turns after daemon restart, but old editor tokens are invalid. Failed setup releases a newly acquired lease and retains a preexisting same-token lease. An empty list removes only the editor overlay. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/acp-attachment (the `AttachACPSession` operationId). AttachACPSessionWithBody(ctx context.Context, sessionID ID, params *AttachACPSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AttachACPSession Attach this ACP connection as the session's single writer // // Attach or re-attach with the same token. 409 not_acp_session for a session created without kind acp; 409 workspace_mismatch unless workspace equals the session's canonical workspace exactly; 409 attachment_held while another token holds a live lease (never stolen); 409 session_busy when the session has an active turn and the overlay differs from the installed one (nothing changes); 409 mcp_overlay_conflict for duplicate names or names already configured globally; 409 mcp_overlay_failed when an idle replacement could not be prepared (the previous overlay and attachment stay as they were). 503 overlay_installed_reload_failed means publication succeeded but runtime reload failed; the replacement remains installed. 503 overlay_update_uncertain means publication or reload was not confirmed within 15 seconds and may still complete. An identical reattach retries a failed reload. With editor-mcp enabled, publication awaiting reload blocks turns with 409 overlay_installed_reload_failed. A missing required overlay after restart blocks turns with 409 overlay_reattach_required; the editor must resume and resupply its servers. An empty overlay permits daemon-driven turns after daemon restart, but old editor tokens are invalid. Failed setup releases a newly acquired lease and retains a preexisting same-token lease. An empty list removes only the editor overlay. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/acp-attachment (the `AttachACPSession` operationId). AttachACPSession(ctx context.Context, sessionID ID, params *AttachACPSessionParams, body AttachACPSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RenewACPSessionWithBody Extend this connection's attachment lease // // 409 attachment_lost when this token no longer holds the attachment (expired, released, or the daemon restarted). Renewal never re-attaches; the client must attach again. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/acp-attachment/renew (the `RenewACPSession` operationId). RenewACPSessionWithBody(ctx context.Context, sessionID ID, params *RenewACPSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RenewACPSession Extend this connection's attachment lease // // 409 attachment_lost when this token no longer holds the attachment (expired, released, or the daemon restarted). Renewal never re-attaches; the client must attach again. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/acp-attachment/renew (the `RenewACPSession` operationId). RenewACPSession(ctx context.Context, sessionID ID, params *RenewACPSessionParams, body RenewACPSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetActiveOutputContent Read unfinished output at a captured snapshot cutoff // // Pages contain at most 262144 UTF-8 bytes and remain within the captured cutoff. Preserve the required snapshot query when following next. // // Corresponds with GET /sessions/{session_id}/active-output/{content_id} (the `GetActiveOutputContent` operationId). GetActiveOutputContent(ctx context.Context, sessionID ID, contentID ID, params *GetActiveOutputContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetCatalog Discover candidates, loaded commands and pages // // Discovery and loaded composition are separate. Reads do not reload. Continuation identifies its section; candidate revision guards discovery-based selection. Requires capability `catalog: 1`. // // Corresponds with GET /sessions/{session_id}/catalog (the `GetCatalog` operationId). GetCatalog(ctx context.Context, sessionID ID, params *GetCatalogParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CompactSessionWithBody Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). CompactSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CompactSession Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). CompactSession(ctx context.Context, sessionID ID, body CompactSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetContext Inspect prepared context or request records // // Summary never prepares a request. Section requires snapshot_id, section_id, page and forbids request-pagination fields. Requests accepts after/since_ms/limit/next. Stale snapshot is 410 context_changed, never another section. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context (the `GetContext` operationId). GetContext(ctx context.Context, sessionID ID, params *GetContextParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetContextWindow Read the window this session compacts against // // The session's own window outranks the model's. Reads do not prepare a request, so the answer is available while the prepared context is pending. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context-window (the `GetContextWindow` operationId). GetContextWindow(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // GetFastMode Read fast-mode state and provider capability // // Corresponds with GET /sessions/{session_id}/fast-mode (the `GetFastMode` operationId). GetFastMode(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchFastModeWithBody Change session fast mode // // Conditional, user-facing configuration change. Requires the session // configuration ETag. Enabling is rejected unless the provider reports // fast mode supported; unknown capability is not inferred. Disabling is // always allowed. `toggle` inverts the state protected by If-Match; replaying // a successful toggle with the old ETag is refused rather than toggling twice. // This setting can affect provider billing. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id}/fast-mode (the `PatchFastMode` operationId). PatchFastModeWithBody(ctx context.Context, sessionID ID, params *PatchFastModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchFastModeWithApplicationMergePatchPlusJSONBody Change session fast mode // // Conditional, user-facing configuration change. Requires the session // configuration ETag. Enabling is rejected unless the provider reports // fast mode supported; unknown capability is not inferred. Disabling is // always allowed. `toggle` inverts the state protected by If-Match; replaying // a successful toggle with the old ETag is refused rather than toggling twice. // This setting can affect provider billing. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id}/fast-mode (the `PatchFastMode` operationId). PatchFastModeWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchFastModeParams, body PatchFastModeApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSessionFile Read a text file in the session's workspace // // Reads on the machine the workspace is on: the daemon for a local workspace, the host through one SSH gather for a remote one. A missing file, a directory or another non-regular file answers 404 `file_not_found`; an unknown session answers 404 like other session routes. A remote host that is not ready answers 503 `workspace_unavailable`, a failed gather 502. Requires capability `file_reading: 1`. // // Corresponds with GET /sessions/{session_id}/files (the `GetSessionFile` operationId). GetSessionFile(ctx context.Context, sessionID ID, params *GetSessionFileParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistory Page history or fork checkpoints // // Use only one of before/after/next. Durable positions are independent of actor replay. Pages are ascending and preserve complete display groups where bounded. // // Corresponds with GET /sessions/{session_id}/history (the `GetHistory` operationId). GetHistory(ctx context.Context, sessionID ID, params *GetHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistoryContentBatch Read several entries' full content in one walk // // The same parts and byte offsets as the single-entry route, for up to 200 entries, in the order `entries` names them. Follow next until null, repeating entries. One page stays inside the common encoded response bound, so a page whose entries are mostly references costs one request per byte budget instead of one request per entry. // // Corresponds with GET /sessions/{session_id}/history/content (the `GetHistoryContentBatch` operationId). GetHistoryContentBatch(ctx context.Context, sessionID ID, params *GetHistoryContentBatchParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistoryContent Read full content in bounded pieces // // Follow next until null. UTF-8 pieces end at character boundaries. Reconstruct stored content, not shortened previews. Image fields are not paged here; their references name the image resource. // // Corresponds with GET /sessions/{session_id}/history/{entry_id} (the `GetHistoryContent` operationId). GetHistoryContent(ctx context.Context, sessionID ID, entryID ID, params *GetHistoryContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistoryImage Read one image field as its own bytes // // Image references in history point here. The body is the stored image itself, not base64, and is never content-coded. // // Corresponds with GET /sessions/{session_id}/history/{entry_id}/{field} (the `GetHistoryImage` operationId). GetHistoryImage(ctx context.Context, sessionID ID, entryID ID, field string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInput Read a durable input outcome // // Available after session deletion. Accepted is not consumed or answered. Retain pending and unfinished-turn identities; terminal decisions last seven days. Unknown old UUIDv7 returns 410, never a fresh admission. // // Corresponds with GET /sessions/{session_id}/inputs/{input_id} (the `GetInput` operationId). GetInput(ctx context.Context, sessionID ID, inputID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PutInputWithBody Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). PutInputWithBody(ctx context.Context, sessionID ID, inputID UUIDv7, params *PutInputParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutInput Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). PutInput(ctx context.Context, sessionID ID, inputID UUIDv7, params *PutInputParams, body PutInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelInputWithBody Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. ACP sessions require the current attachment token. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). CancelInputWithBody(ctx context.Context, sessionID ID, inputID ID, params *CancelInputParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelInput Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. ACP sessions require the current attachment token. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). CancelInput(ctx context.Context, sessionID ID, inputID ID, params *CancelInputParams, body CancelInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // InterruptSessionWithBody Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). InterruptSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // InterruptSession Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). InterruptSession(ctx context.Context, sessionID ID, body InterruptSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // UpgradeKernelWithBody Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). UpgradeKernelWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpgradeKernel Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). UpgradeKernel(ctx context.Context, sessionID ID, body UpgradeKernelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ReloadSessionWithBody Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). ReloadSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ReloadSession Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). ReloadSession(ctx context.Context, sessionID ID, body ReloadSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RewindSessionWithBody Cut a session back to before a user message and keep the removed tail as an archived session // // Idle required. The checkpoint must be a user message from the checkpoint view. The session keeps every row before it, and the full prior conversation is copied first into a new archived session. The session actor stops, so attached streams reconnect and reset. Python namespace and files on disk are not rewound. A requested summary is made before anything changes, so a failed summary leaves the session untouched. Requires capability `history_rewind: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/rewind (the `RewindSession` operationId). RewindSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RewindSession Cut a session back to before a user message and keep the removed tail as an archived session // // Idle required. The checkpoint must be a user message from the checkpoint view. The session keeps every row before it, and the full prior conversation is copied first into a new archived session. The session actor stops, so attached streams reconnect and reset. Python namespace and files on disk are not rewound. A requested summary is made before anything changes, so a failed summary leaves the session untouched. Requires capability `history_rewind: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/rewind (the `RewindSession` operationId). RewindSession(ctx context.Context, sessionID ID, body RewindSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetShellCommand Read a human shell command // // Corresponds with GET /sessions/{session_id}/shell-commands/{command_id} (the `GetShellCommand` operationId). GetShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, reqEditors ...RequestEditorFn) (*http.Response, error) // PutShellCommandWithBody Admit one immutable human shell command // // Durable admission precedes process spawn. Same identity and command returns the original resource before mutable checks; changed intent conflicts. One running command and at most 32 uncommitted outcomes per session. No automatic model turn. Remote workspaces are refused. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/shell-commands/{command_id} (the `PutShellCommand` operationId). PutShellCommandWithBody(ctx context.Context, sessionID ID, commandID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutShellCommand Admit one immutable human shell command // // Durable admission precedes process spawn. Same identity and command returns the original resource before mutable checks; changed intent conflicts. One running command and at most 32 uncommitted outcomes per session. No automatic model turn. Remote workspaces are refused. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/shell-commands/{command_id} (the `PutShellCommand` operationId). PutShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, body PutShellCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetShellCommandOutput Read retained sanitized shell output // // UTF-8 byte offsets, complete-codepoint pages, next_offset null at the current captured cutoff. Retained output is at most 16 MiB; no terminal controls are stored. // // Corresponds with GET /sessions/{session_id}/shell-commands/{command_id}/output (the `GetShellCommandOutput` operationId). GetShellCommandOutput(ctx context.Context, sessionID ID, commandID UUIDv7, params *GetShellCommandOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error) // StopShellCommand Request termination of one human shell command // // Stops this command process group only. Response can remain running until cleanup is confirmed; read the same resource for its terminal outcome. // // Corresponds with POST /sessions/{session_id}/shell-commands/{command_id}/stop (the `StopShellCommand` operationId). StopShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, reqEditors ...RequestEditorFn) (*http.Response, error) // RecordVisitWithBody Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). RecordVisitWithBody(ctx context.Context, sessionID ID, visitID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RecordVisit Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). RecordVisit(ctx context.Context, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSettings Read shared settings or one canonical group // // Without group, return Settings and observed group validators. With group, return that group only; the ETag covers that representation. // // Corresponds with GET /settings (the `GetSettings` operationId). GetSettings(ctx context.Context, params *GetSettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSettingsWithBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). PatchSettingsWithBody(ctx context.Context, params *PatchSettingsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSettingsWithApplicationMergePatchPlusJSONBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). PatchSettingsWithApplicationMergePatchPlusJSONBody(ctx context.Context, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetStorage Read storage accounting // // Each section has its own continuation. Totals cover complete storage. Paths never authorize local mutation. Requires capability `storage_report: 1`. // // Corresponds with GET /storage (the `GetStorage` operationId). GetStorage(ctx context.Context, params *GetStorageParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CloseTerminal Explicitly close an interactive pseudo-terminal session // // Terminates the pseudo-terminal process group and releases its resources. // // Corresponds with DELETE /terminals/{terminal_id} (the `CloseTerminal` operationId). CloseTerminal(ctx context.Context, terminalID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // AttachTerminal Upgrade to interactive pseudo-terminal session // // WebSocket upgrade endpoint for an interactive terminal. Authenticated by the same bearer token and origin policy as other daemon routes. // Binary frames carry raw terminal PTY bytes. Text frames are JSON objects for control commands: // {type:"ping"}, {type:"input",data:...}, {type:"resize",cols:...,rows:...}, {type:"signal",signal:"SIGINT"|"SIGTERM"|...}, {type:"restart",cols:...,rows:...}. // Server sends {type:"ready",id,cwd,shell,cols,rows,state,exit_code} on attach, binary frames for terminal output (including initial scrollback history), // {type:"exit",exit_code} when the shell process exits, and {type:"pong"} keepalives. // // Corresponds with GET /terminals/{terminal_id} (the `AttachTerminal` operationId). AttachTerminal(ctx context.Context, terminalID ID, params *AttachTerminalParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetWorkspaces Browse recent locations or a directory // // Without location return recent workspaces. include=preview requires location. Paths resolve on the daemon host; cached host state does not perform SSH sign-in. Requires capability `workspace_browsing: 1`. // // Corresponds with GET /workspaces (the `GetWorkspaces` operationId). GetWorkspaces(ctx context.Context, params *GetWorkspacesParams, reqEditors ...RequestEditorFn) (*http.Response, error) } // GetAuth Read login choices and redacted accounts // // Requires capability `provider_auth: 1`. // // Corresponds with GET /auth (the `GetAuth` operationId). func (c *Client) GetAuth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetAuthRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteAccount Remove an unreferenced provider account // // Reject if a profile pins it by `account_id`, if it is the last account of a profile's `account_ids`, or if it comes from the environment (`account_external`). Otherwise it also leaves every `account_ids` list naming it. Does not interrupt captured credentials in an active request. Account IDs are never reused. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/accounts/{account_id} (the `DeleteAccount` operationId). func (c *Client) DeleteAccount(ctx context.Context, accountID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteAccountRequest(c.Server, accountID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchAccountWithBody Rename a saved provider account // // Environment accounts cannot be renamed (`account_external`). Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/accounts/{account_id} (the `PatchAccount` operationId). func (c *Client) PatchAccountWithBody(ctx context.Context, accountID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchAccountRequestWithBody(c.Server, accountID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchAccount Rename a saved provider account // // Environment accounts cannot be renamed (`account_external`). Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PATCH /auth/accounts/{account_id} (the `PatchAccount` operationId). func (c *Client) PatchAccount(ctx context.Context, accountID ID, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchAccountRequest(c.Server, accountID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutKeyAccountWithBody Save an API key as a provider account // // The client chooses the account id (a UUIDv7). Replaying the same request returns the account; different content at a used id is `409 conflict`. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/keys/{account_id} (the `PutKeyAccount` operationId). func (c *Client) PutKeyAccountWithBody(ctx context.Context, accountID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutKeyAccountRequestWithBody(c.Server, accountID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutKeyAccount Save an API key as a provider account // // The client chooses the account id (a UUIDv7). Replaying the same request returns the account; different content at a used id is `409 conflict`. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/keys/{account_id} (the `PutKeyAccount` operationId). func (c *Client) PutKeyAccount(ctx context.Context, accountID UUIDv7, body PutKeyAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutKeyAccountRequest(c.Server, accountID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelLogin Cancel a login idempotently // // Cancellation stops only this flow; completed accounts remain saved. No If-Match is needed for identity-scoped cancellation. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/logins/{login_id} (the `CancelLogin` operationId). func (c *Client) CancelLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelLoginRequest(c.Server, loginID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetLogin Inspect a provider login // // No credential or submitted form echo. Terminal records remain fifteen minutes; unfinished flows expire at their provider deadline. Requires capability `provider_auth: 1`. // // Corresponds with GET /auth/logins/{login_id} (the `GetLogin` operationId). func (c *Client) GetLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLoginRequest(c.Server, loginID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AnswerLoginWithBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). func (c *Client) AnswerLoginWithBody(ctx context.Context, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAnswerLoginRequestWithBody(c.Server, loginID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AnswerLoginWithApplicationMergePatchPlusJSONBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). func (c *Client) AnswerLoginWithApplicationMergePatchPlusJSONBody(ctx context.Context, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody(c.Server, loginID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateLoginWithBody Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). func (c *Client) CreateLoginWithBody(ctx context.Context, loginID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateLoginRequestWithBody(c.Server, loginID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateLogin Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). func (c *Client) CreateLogin(ctx context.Context, loginID UUIDv7, body CreateLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateLoginRequest(c.Server, loginID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetEvents Upgrade to multiplexed live session events // // WebSocket upgrade endpoint, authenticated by the same bearer token and origin // policy as other daemon routes. A socket owns at most 64 keyed follows. // Client text frames are JSON objects: {key,type:"session",session_id,tail:0, // after_generation?,after_seq?}, {key,type:"sessions",scope:"roots"}, // {key,type:"stop"}, or {type:"ping"}. Keys contain 1 to 128 UTF-8 bytes. // Session replay and tail validation match GET /sessions/{session_id} SSE. // Subscribing an existing key replaces that follow. after_seq accepts an // integer or its decimal string; tail defaults to 100 and is at most 200. // Server text frames are {key,batch:}: session batches // carry generation,cursor,events and optional snapshot; collection batches // carry events. A successful send acknowledges its session cursor. A follow // ending (including stop, deletion, failure or overflow) sends {key,end:true}. // Invalid commands and admission refusals send {key,failure:{code,detail}}; // malformed commands without a usable key use an empty key. Session failures // and collection overflow retain their SSE batch before the end frame. // Ping replies and 15-second keepalives are {type:"pong"}. Commands are at // most 4096 UTF-8 bytes; response frames are at most 1 MiB. Unsubscribe and // socket closure release watches. Clients reconnect a follow with its last // fully consumed cursor. Existing SSE routes remain available. // // Corresponds with GET /events (the `GetEvents` operationId). func (c *Client) GetEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetEventsRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReportArtifactErrorWithBody Record a failure in the page // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/errors (the `ReportArtifactError` operationId). func (c *Client) ReportArtifactErrorWithBody(ctx context.Context, frame string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReportArtifactErrorRequestWithBody(c.Server, frame, version, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReportArtifactErrorWithTextBody Record a failure in the page // // Takes a body of the `text/plain` content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/errors (the `ReportArtifactError` operationId). func (c *Client) ReportArtifactErrorWithTextBody(ctx context.Context, frame string, version string, body ReportArtifactErrorTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReportArtifactErrorRequestWithTextBody(c.Server, frame, version, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // SaveArtifactStateWithBody Save the page's localStorage // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/state (the `SaveArtifactState` operationId). func (c *Client) SaveArtifactStateWithBody(ctx context.Context, frame string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSaveArtifactStateRequestWithBody(c.Server, frame, version, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // SaveArtifactStateWithTextBody Save the page's localStorage // // Takes a body of the `text/plain` content type. // // Corresponds with POST /extensions/artifacts/frame/{frame}/{version}/.albedo/state (the `SaveArtifactState` operationId). func (c *Client) SaveArtifactStateWithTextBody(ctx context.Context, frame string, version string, body SaveArtifactStateTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSaveArtifactStateRequestWithTextBody(c.Server, frame, version, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetArtifactLatestVersion Wait for a newer version of an artifact // // What a page open on `latest/` in a tab of its own asks to know when to reload. With `after`, the daemon holds the answer until the latest version passes it or about 25 seconds pass; without, it answers at once. The version in the path only has to exist. // // Corresponds with GET /extensions/artifacts/frame/{frame}/{version}/.albedo/version (the `GetArtifactLatestVersion` operationId). func (c *Client) GetArtifactLatestVersion(ctx context.Context, frame string, version string, params *GetArtifactLatestVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetArtifactLatestVersionRequest(c.Server, frame, version, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetArtifactFile Serve one file of one artifact version // // `albedo web` forwards `/frame/...` here; see robot-docs/artifacts.md. A wrong key answers 404. `path` may contain `/`; one ending in `/` serves its index.html, and an empty one the entry of that version. Under `latest` files are `no-cache` and the bridge is told to follow; the files of a numbered version are immutable. // // Corresponds with GET /extensions/artifacts/frame/{frame}/{version}/{path} (the `GetArtifactFile` operationId). func (c *Client) GetArtifactFile(ctx context.Context, frame string, version string, path string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetArtifactFileRequest(c.Server, frame, version, path) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListArtifacts List artifacts, newest change first // // Requires enabled extension artifacts. Artifacts outlive their session; `session_deleted` marks one whose session is gone. // // Corresponds with GET /extensions/artifacts/items (the `ListArtifacts` operationId). func (c *Client) ListArtifacts(ctx context.Context, params *ListArtifactsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListArtifactsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteArtifact Delete an artifact and every version of it // // Corresponds with DELETE /extensions/artifacts/items/{artifact_id} (the `DeleteArtifact` operationId). func (c *Client) DeleteArtifact(ctx context.Context, artifactID ArtifactID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteArtifactRequest(c.Server, artifactID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetArtifact Read one artifact with its versions // // Corresponds with GET /extensions/artifacts/items/{artifact_id} (the `GetArtifact` operationId). func (c *Client) GetArtifact(ctx context.Context, artifactID ArtifactID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetArtifactRequest(c.Server, artifactID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListDiscordBots List Discord bots of every session without tokens // // Corresponds with GET /extensions/discord/bots (the `ListDiscordBots` operationId). func (c *Client) ListDiscordBots(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListDiscordBotsRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateDiscordBotWithBody Create the Discord bot of a session // // One bot per session (409 bot_exists). The token must have three dot-separated parts and is never returned. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/discord/bots (the `CreateDiscordBot` operationId). func (c *Client) CreateDiscordBotWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateDiscordBotRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateDiscordBot Create the Discord bot of a session // // One bot per session (409 bot_exists). The token must have three dot-separated parts and is never returned. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/discord/bots (the `CreateDiscordBot` operationId). func (c *Client) CreateDiscordBot(ctx context.Context, body CreateDiscordBotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateDiscordBotRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteDiscordBot Delete a Discord bot and its channel and DM settings // // Corresponds with DELETE /extensions/discord/bots/{bot_id} (the `DeleteDiscordBot` operationId). func (c *Client) DeleteDiscordBot(ctx context.Context, botID ID, params *DeleteDiscordBotParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteDiscordBotRequest(c.Server, botID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetDiscordBot Read a Discord bot and its live state // // Corresponds with GET /extensions/discord/bots/{bot_id} (the `GetDiscordBot` operationId). func (c *Client) GetDiscordBot(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDiscordBotRequest(c.Server, botID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchDiscordBotWithBody Edit a Discord bot at an observed revision // // A token or enabled change restarts or stops the bot process. A stale revision is 412 precondition_failed. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/discord/bots/{bot_id} (the `PatchDiscordBot` operationId). func (c *Client) PatchDiscordBotWithBody(ctx context.Context, botID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchDiscordBotRequestWithBody(c.Server, botID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchDiscordBotWithApplicationMergePatchPlusJSONBody Edit a Discord bot at an observed revision // // A token or enabled change restarts or stops the bot process. A stale revision is 412 precondition_failed. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/discord/bots/{bot_id} (the `PatchDiscordBot` operationId). func (c *Client) PatchDiscordBotWithApplicationMergePatchPlusJSONBody(ctx context.Context, botID ID, body PatchDiscordBotApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchDiscordBotRequestWithApplicationMergePatchPlusJSONBody(c.Server, botID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutDiscordChannelWithBody Set how a channel reaches the session // // Delivery off removes the channel; threads follow their parent channel. // // Takes any type of body and a specified content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/channels/{channel_id} (the `PutDiscordChannel` operationId). func (c *Client) PutDiscordChannelWithBody(ctx context.Context, botID ID, channelID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutDiscordChannelRequestWithBody(c.Server, botID, channelID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutDiscordChannel Set how a channel reaches the session // // Delivery off removes the channel; threads follow their parent channel. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/channels/{channel_id} (the `PutDiscordChannel` operationId). func (c *Client) PutDiscordChannel(ctx context.Context, botID ID, channelID ID, body PutDiscordChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutDiscordChannelRequest(c.Server, botID, channelID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetDiscordDMs Read the DM allow list and pending requests // // Corresponds with GET /extensions/discord/bots/{bot_id}/dms (the `GetDiscordDMs` operationId). func (c *Client) GetDiscordDMs(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDiscordDMsRequest(c.Server, botID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteDiscordDM Remove a person from the DM allow list // // The owner cannot be removed (400). // // Corresponds with DELETE /extensions/discord/bots/{bot_id}/dms/{user_id} (the `DeleteDiscordDM` operationId). func (c *Client) DeleteDiscordDM(ctx context.Context, botID ID, userID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteDiscordDMRequest(c.Server, botID, userID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutDiscordDMWithBody Allow a person to DM the session // // A null name is resolved from Discord when the bot is online. Allowing removes a pending request. // // Takes any type of body and a specified content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/dms/{user_id} (the `PutDiscordDM` operationId). func (c *Client) PutDiscordDMWithBody(ctx context.Context, botID ID, userID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutDiscordDMRequestWithBody(c.Server, botID, userID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutDiscordDM Allow a person to DM the session // // A null name is resolved from Discord when the bot is online. Allowing removes a pending request. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /extensions/discord/bots/{bot_id}/dms/{user_id} (the `PutDiscordDM` operationId). func (c *Client) PutDiscordDM(ctx context.Context, botID ID, userID ID, body PutDiscordDMJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutDiscordDMRequest(c.Server, botID, userID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListDiscordGuilds List the servers and channels the bot can see, with their delivery // // Read live from the bot process; 503 bot_offline when the bot is not online. // // Corresponds with GET /extensions/discord/bots/{bot_id}/guilds (the `ListDiscordGuilds` operationId). func (c *Client) ListDiscordGuilds(ctx context.Context, botID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListDiscordGuildsRequest(c.Server, botID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteDiscordRequest Dismiss a pending DM request // // Corresponds with DELETE /extensions/discord/bots/{bot_id}/requests/{user_id} (the `DeleteDiscordRequest` operationId). func (c *Client) DeleteDiscordRequest(ctx context.Context, botID ID, userID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteDiscordRequestRequest(c.Server, botID, userID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UnlinkWorkspace Remove a member from the observed group // // Check membership at commit. Creates a singleton group; deletes no work or memory. Human-only. // // Corresponds with DELETE /extensions/links/groups (the `UnlinkWorkspace` operationId). func (c *Client) UnlinkWorkspace(ctx context.Context, params *UnlinkWorkspaceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnlinkWorkspaceRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetLinkGroup Read linked membership and presence // // Only configuration view has the canonical membership ETag. Presence does not change that validator. // // Corresponds with GET /extensions/links/groups (the `GetLinkGroup` operationId). func (c *Client) GetLinkGroup(ctx context.Context, params *GetLinkGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLinkGroupRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // MergeLinkGroupsWithBody Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). func (c *Client) MergeLinkGroupsWithBody(ctx context.Context, params *MergeLinkGroupsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMergeLinkGroupsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // MergeLinkGroups Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). func (c *Client) MergeLinkGroups(ctx context.Context, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMergeLinkGroupsRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListPaperclips List paperclips resources // // Requires enabled extension paperclips. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/paperclips/items (the `ListPaperclips` operationId). func (c *Client) ListPaperclips(ctx context.Context, params *ListPaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListPaperclipsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePaperclipsWithBody Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). func (c *Client) CreatePaperclipsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePaperclipsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePaperclips Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). func (c *Client) CreatePaperclips(ctx context.Context, body CreatePaperclipsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePaperclipsRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeletePaperclips Delete a paperclips resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/paperclips/items/{item_id} (the `DeletePaperclips` operationId). func (c *Client) DeletePaperclips(ctx context.Context, itemID ID, params *DeletePaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePaperclipsRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetPaperclips Read one paperclips resource // // Corresponds with GET /extensions/paperclips/items/{item_id} (the `GetPaperclips` operationId). func (c *Client) GetPaperclips(ctx context.Context, itemID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPaperclipsRequest(c.Server, itemID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchPaperclipsWithBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). func (c *Client) PatchPaperclipsWithBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchPaperclipsRequestWithBody(c.Server, itemID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchPaperclipsWithApplicationMergePatchPlusJSONBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). func (c *Client) PatchPaperclipsWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody(c.Server, itemID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateProxyCompletionWithBody Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). func (c *Client) CreateProxyCompletionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateProxyCompletionRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateProxyCompletion Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). func (c *Client) CreateProxyCompletion(ctx context.Context, body CreateProxyCompletionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateProxyCompletionRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListProxyModels List saved-profile OpenAI model IDs // // External OpenAI envelope. Bearer required unless operator explicitly configured anonymous loopback access. // // Corresponds with GET /extensions/proxy/v1/models (the `ListProxyModels` operationId). func (c *Client) ListProxyModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListProxyModelsRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListJobs Read bounded live job observations and the jobs page // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs (the `ListJobs` operationId). func (c *Client) ListJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListJobsRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListRecentJobs Read the kernel's jobs, running and finished // // What the session's kernel still knows of the jobs its run tool started, newest first, with up to 100 rows. Finished jobs stay for as long as the kernel keeps their output (its 64 newest). A session with no kernel has none. // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs/recent (the `ListRecentJobs` operationId). func (c *Client) ListRecentJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListRecentJobsRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReadJobOutput Read a page of one job's output // // Pages are byte ranges cut on character boundaries, so a reader that continues from `next_offset` loses none of what the job wrote; a running job's last character waits for the page after it. Without `offset` the page is the end of the output. Reading never counts as the model reading the job's result. // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs/{job_id}/output (the `ReadJobOutput` operationId). func (c *Client) ReadJobOutput(ctx context.Context, sessionID ID, jobID ID, params *ReadJobOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReadJobOutputRequest(c.Server, sessionID, jobID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // StopJobWithBody Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). func (c *Client) StopJobWithBody(ctx context.Context, sessionID ID, jobID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewStopJobRequestWithBody(c.Server, sessionID, jobID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // StopJob Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). func (c *Client) StopJob(ctx context.Context, sessionID ID, jobID ID, body StopJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewStopJobRequest(c.Server, sessionID, jobID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListSchedule List schedule resources // // Requires enabled extension schedule. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/schedule/jobs (the `ListSchedule` operationId). func (c *Client) ListSchedule(ctx context.Context, params *ListScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListScheduleRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateScheduleWithBody Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). func (c *Client) CreateScheduleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateScheduleRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSchedule Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). func (c *Client) CreateSchedule(ctx context.Context, body CreateScheduleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateScheduleRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteSchedule Delete a schedule resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/schedule/jobs/{job_id} (the `DeleteSchedule` operationId). func (c *Client) DeleteSchedule(ctx context.Context, jobID ID, params *DeleteScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteScheduleRequest(c.Server, jobID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSchedule Read one schedule resource // // Corresponds with GET /extensions/schedule/jobs/{job_id} (the `GetSchedule` operationId). func (c *Client) GetSchedule(ctx context.Context, jobID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetScheduleRequest(c.Server, jobID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchScheduleWithBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). func (c *Client) PatchScheduleWithBody(ctx context.Context, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchScheduleRequestWithBody(c.Server, jobID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchScheduleWithApplicationMergePatchPlusJSONBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). func (c *Client) PatchScheduleWithApplicationMergePatchPlusJSONBody(ctx context.Context, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody(c.Server, jobID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListSkillLoads List the skills a session loaded // // Requires enabled extension skills. Each skill the session's model or user loaded, once, first loaded first; the session's sidebar glance lists the same. // // Corresponds with GET /extensions/skills/loads (the `ListSkillLoads` operationId). func (c *Client) ListSkillLoads(ctx context.Context, params *ListSkillLoadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSkillLoadsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListWebSearchProviders List web search providers in the order a search tries them // // Requires enabled extension web-search. The global order lives in extensions.json. // // Corresponds with GET /extensions/web-search/providers (the `ListWebSearchProviders` operationId). func (c *Client) ListWebSearchProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWebSearchProvidersRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ChangeWebSearchProviderWithBody Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). func (c *Client) ChangeWebSearchProviderWithBody(ctx context.Context, name ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewChangeWebSearchProviderRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ChangeWebSearchProvider Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). func (c *Client) ChangeWebSearchProvider(ctx context.Context, name ID, body ChangeWebSearchProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewChangeWebSearchProviderRequest(c.Server, name, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetDelivery Read an accepted delivery payload // // Corresponds with GET /extensions/webhooks/deliveries/{delivery_id} (the `GetDelivery` operationId). func (c *Client) GetDelivery(ctx context.Context, deliveryID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDeliveryRequest(c.Server, deliveryID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHooks List hooks without secrets // // Corresponds with GET /extensions/webhooks/hooks (the `ListHooks` operationId). func (c *Client) ListHooks(ctx context.Context, params *ListHooksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHooksRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateHookWithBody Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). func (c *Client) CreateHookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateHookRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateHook Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). func (c *Client) CreateHook(ctx context.Context, body CreateHookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateHookRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteHook Delete a hook while retaining accepted deliveries // // Corresponds with DELETE /extensions/webhooks/hooks/{hook_id} (the `DeleteHook` operationId). func (c *Client) DeleteHook(ctx context.Context, hookID ID, params *DeleteHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteHookRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHook Read hook state or canonical configuration // // ETag is present only on configuration view. Ordinary read exposes the configuration resource and validator plus runtime observations. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id} (the `GetHook` operationId). func (c *Client) GetHook(ctx context.Context, hookID ID, params *GetHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHookRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookWithBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). func (c *Client) PatchHookWithBody(ctx context.Context, hookID ID, params *PatchHookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookWithApplicationMergePatchPlusJSONBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). func (c *Client) PatchHookWithApplicationMergePatchPlusJSONBody(ctx context.Context, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookRequestWithApplicationMergePatchPlusJSONBody(c.Server, hookID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHookDeliveries Read accepted hook delivery metadata // // Historical reads remain available after hook deletion while retained deliveries exist. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id}/deliveries (the `ListHookDeliveries` operationId). func (c *Client) ListHookDeliveries(ctx context.Context, hookID ID, params *ListHookDeliveriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHookDeliveriesRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeliverWebhookWithBody Accept signed external data durably // // Authenticate configured HMAC-SHA256 over the exact raw body. A daemon bearer is not a substitute. Signature header name and prefix come from hook configuration. Same event ID and body returns original admission; changed body conflicts. Pending inbox limit 1000. Raw body maximum 65536 bytes. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/deliveries (the `DeliverWebhook` operationId). func (c *Client) DeliverWebhookWithBody(ctx context.Context, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeliverWebhookRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RotateHookSecretWithBody Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). func (c *Client) RotateHookSecretWithBody(ctx context.Context, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRotateHookSecretRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RotateHookSecret Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). func (c *Client) RotateHookSecret(ctx context.Context, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRotateHookSecretRequest(c.Server, hookID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHookPermission Read agent hook-management permission // // Absent stored permission reads false with its initial canonical validator. // // Corresponds with GET /extensions/webhooks/permissions/{session_id} (the `GetHookPermission` operationId). func (c *Client) GetHookPermission(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHookPermissionRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookPermissionWithBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). func (c *Client) PatchHookPermissionWithBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookPermissionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookPermissionWithApplicationMergePatchPlusJSONBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). func (c *Client) PatchHookPermissionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListWork List work resources // // Requires enabled extension work. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/work/items (the `ListWork` operationId). func (c *Client) ListWork(ctx context.Context, params *ListWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWorkRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateWorkWithBody Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). func (c *Client) CreateWorkWithBody(ctx context.Context, params *CreateWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateWorkRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateWork Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). func (c *Client) CreateWork(ctx context.Context, params *CreateWorkParams, body CreateWorkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateWorkRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteWork Delete a work resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/work/items/{item_id} (the `DeleteWork` operationId). func (c *Client) DeleteWork(ctx context.Context, itemID ID, params *DeleteWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteWorkRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetWork Read one work resource // // Corresponds with GET /extensions/work/items/{item_id} (the `GetWork` operationId). func (c *Client) GetWork(ctx context.Context, itemID ID, params *GetWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetWorkRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchWorkWithBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). func (c *Client) PatchWorkWithBody(ctx context.Context, itemID ID, params *PatchWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchWorkRequestWithBody(c.Server, itemID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchWorkWithApplicationMergePatchPlusJSONBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). func (c *Client) PatchWorkWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody(c.Server, itemID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHosts Read known SSH hosts and cached state // // Requires capability `host_probes: 1`. // // Corresponds with GET /hosts (the `ListHosts` operationId). func (c *Client) ListHosts(ctx context.Context, params *ListHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHostsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ProbeHostWithBody Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). func (c *Client) ProbeHostWithBody(ctx context.Context, host ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewProbeHostRequestWithBody(c.Server, host, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ProbeHost Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). func (c *Client) ProbeHost(ctx context.Context, host ID, body ProbeHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewProbeHostRequest(c.Server, host, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListModels Read provider model metadata // // In catalogue view, exactly one of provider_profile/provider is required. Endpoint is allowed only with provider. Unknown facts are null. A manual unlisted ID remains usable. Optional model returns one metadata row, including cap_key, for an unlisted manual ID; unknown facts stay null. // // Corresponds with GET /models (the `ListModels` operationId). func (c *Client) ListModels(ctx context.Context, params *ListModelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListModelsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetServer Read daemon identity and capabilities // // No startup or replacement. Authentication and protocol failures remain actionable errors. Pagination is valid only with include=quota_history. // // Corresponds with GET /server (the `GetServer` operationId). func (c *Client) GetServer(ctx context.Context, params *GetServerParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetServerRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ShutdownServerWithBody Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes any type of body and a specified content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). func (c *Client) ShutdownServerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewShutdownServerRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ShutdownServer Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes a body of the `application/json` content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). func (c *Client) ShutdownServer(ctx context.Context, body ShutdownServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewShutdownServerRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListSessions Browse sessions or watch collection changes // // JSON defaults to roots, or all with parent/family. Parent and family are exclusive. Explicit roots with either is invalid. SSE accepts the same scope filters, excluding sort/limit/next; no cursor or replay. Subscribe, wait for ready, then read pages. Closure or overflow repeats this flow. // // Corresponds with GET /sessions (the `ListSessions` operationId). func (c *Client) ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSessionsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteSession Delete a leaf or captured subtree // // Leaf requires idle and no children. Subtree requires the session's observed family revision and gates new children, interrupts captured members and deletes deepest first. Partial outcomes are explicit. Refresh before confirming a new attempt; never automatically replay after transport loss. // // Corresponds with DELETE /sessions/{session_id} (the `DeleteSession` operationId). func (c *Client) DeleteSession(ctx context.Context, sessionID ID, params *DeleteSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSessionRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSession Read or watch one session // // JSON defaults to complete Session. Configuration and status JSON exclude tail and replay parameters. SSE accepts tail and after_generation/after_seq, without view. Initial subscription omits both cursors; reconnect keeps the fully consumed pair. A missing generation requests reset. after_generation without after_seq is invalid. Neither auth failure nor closure starts a daemon. // // Corresponds with GET /sessions/{session_id} (the `GetSession` operationId). func (c *Client) GetSession(ctx context.Context, sessionID ID, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSessionRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSessionWithBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change carrying the observed session family revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. An ACP attachment holder may select a model with a patch containing only model and an optional provider_profile; other execution changes remain unavailable to ACP sessions. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). func (c *Client) PatchSessionWithBody(ctx context.Context, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSessionWithApplicationMergePatchPlusJSONBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change carrying the observed session family revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. An ACP attachment holder may select a model with a patch containing only model and an optional provider_profile; other execution changes remain unavailable to ACP sessions. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). func (c *Client) PatchSessionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSessionWithBody Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). func (c *Client) CreateSessionWithBody(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSession Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). func (c *Client) CreateSession(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSessionRequest(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReleaseACPSession Release this connection's attachment // // Idempotent. Never cancels accepted inputs, the active turn, or the MCP overlay. // // Corresponds with DELETE /sessions/{session_id}/acp-attachment (the `ReleaseACPSession` operationId). func (c *Client) ReleaseACPSession(ctx context.Context, sessionID ID, params *ReleaseACPSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReleaseACPSessionRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AttachACPSessionWithBody Attach this ACP connection as the session's single writer // // Attach or re-attach with the same token. 409 not_acp_session for a session created without kind acp; 409 workspace_mismatch unless workspace equals the session's canonical workspace exactly; 409 attachment_held while another token holds a live lease (never stolen); 409 session_busy when the session has an active turn and the overlay differs from the installed one (nothing changes); 409 mcp_overlay_conflict for duplicate names or names already configured globally; 409 mcp_overlay_failed when an idle replacement could not be prepared (the previous overlay and attachment stay as they were). 503 overlay_installed_reload_failed means publication succeeded but runtime reload failed; the replacement remains installed. 503 overlay_update_uncertain means publication or reload was not confirmed within 15 seconds and may still complete. An identical reattach retries a failed reload. With editor-mcp enabled, publication awaiting reload blocks turns with 409 overlay_installed_reload_failed. A missing required overlay after restart blocks turns with 409 overlay_reattach_required; the editor must resume and resupply its servers. An empty overlay permits daemon-driven turns after daemon restart, but old editor tokens are invalid. Failed setup releases a newly acquired lease and retains a preexisting same-token lease. An empty list removes only the editor overlay. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/acp-attachment (the `AttachACPSession` operationId). func (c *Client) AttachACPSessionWithBody(ctx context.Context, sessionID ID, params *AttachACPSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAttachACPSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AttachACPSession Attach this ACP connection as the session's single writer // // Attach or re-attach with the same token. 409 not_acp_session for a session created without kind acp; 409 workspace_mismatch unless workspace equals the session's canonical workspace exactly; 409 attachment_held while another token holds a live lease (never stolen); 409 session_busy when the session has an active turn and the overlay differs from the installed one (nothing changes); 409 mcp_overlay_conflict for duplicate names or names already configured globally; 409 mcp_overlay_failed when an idle replacement could not be prepared (the previous overlay and attachment stay as they were). 503 overlay_installed_reload_failed means publication succeeded but runtime reload failed; the replacement remains installed. 503 overlay_update_uncertain means publication or reload was not confirmed within 15 seconds and may still complete. An identical reattach retries a failed reload. With editor-mcp enabled, publication awaiting reload blocks turns with 409 overlay_installed_reload_failed. A missing required overlay after restart blocks turns with 409 overlay_reattach_required; the editor must resume and resupply its servers. An empty overlay permits daemon-driven turns after daemon restart, but old editor tokens are invalid. Failed setup releases a newly acquired lease and retains a preexisting same-token lease. An empty list removes only the editor overlay. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/acp-attachment (the `AttachACPSession` operationId). func (c *Client) AttachACPSession(ctx context.Context, sessionID ID, params *AttachACPSessionParams, body AttachACPSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAttachACPSessionRequest(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RenewACPSessionWithBody Extend this connection's attachment lease // // 409 attachment_lost when this token no longer holds the attachment (expired, released, or the daemon restarted). Renewal never re-attaches; the client must attach again. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/acp-attachment/renew (the `RenewACPSession` operationId). func (c *Client) RenewACPSessionWithBody(ctx context.Context, sessionID ID, params *RenewACPSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRenewACPSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RenewACPSession Extend this connection's attachment lease // // 409 attachment_lost when this token no longer holds the attachment (expired, released, or the daemon restarted). Renewal never re-attaches; the client must attach again. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/acp-attachment/renew (the `RenewACPSession` operationId). func (c *Client) RenewACPSession(ctx context.Context, sessionID ID, params *RenewACPSessionParams, body RenewACPSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRenewACPSessionRequest(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetActiveOutputContent Read unfinished output at a captured snapshot cutoff // // Pages contain at most 262144 UTF-8 bytes and remain within the captured cutoff. Preserve the required snapshot query when following next. // // Corresponds with GET /sessions/{session_id}/active-output/{content_id} (the `GetActiveOutputContent` operationId). func (c *Client) GetActiveOutputContent(ctx context.Context, sessionID ID, contentID ID, params *GetActiveOutputContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetActiveOutputContentRequest(c.Server, sessionID, contentID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetCatalog Discover candidates, loaded commands and pages // // Discovery and loaded composition are separate. Reads do not reload. Continuation identifies its section; candidate revision guards discovery-based selection. Requires capability `catalog: 1`. // // Corresponds with GET /sessions/{session_id}/catalog (the `GetCatalog` operationId). func (c *Client) GetCatalog(ctx context.Context, sessionID ID, params *GetCatalogParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetCatalogRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CompactSessionWithBody Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). func (c *Client) CompactSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCompactSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CompactSession Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). func (c *Client) CompactSession(ctx context.Context, sessionID ID, body CompactSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCompactSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetContext Inspect prepared context or request records // // Summary never prepares a request. Section requires snapshot_id, section_id, page and forbids request-pagination fields. Requests accepts after/since_ms/limit/next. Stale snapshot is 410 context_changed, never another section. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context (the `GetContext` operationId). func (c *Client) GetContext(ctx context.Context, sessionID ID, params *GetContextParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetContextRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetContextWindow Read the window this session compacts against // // The session's own window outranks the model's. Reads do not prepare a request, so the answer is available while the prepared context is pending. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context-window (the `GetContextWindow` operationId). func (c *Client) GetContextWindow(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetContextWindowRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetFastMode Read fast-mode state and provider capability // // Corresponds with GET /sessions/{session_id}/fast-mode (the `GetFastMode` operationId). func (c *Client) GetFastMode(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetFastModeRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchFastModeWithBody Change session fast mode // // Conditional, user-facing configuration change. Requires the session // configuration ETag. Enabling is rejected unless the provider reports // fast mode supported; unknown capability is not inferred. Disabling is // always allowed. `toggle` inverts the state protected by If-Match; replaying // a successful toggle with the old ETag is refused rather than toggling twice. // This setting can affect provider billing. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id}/fast-mode (the `PatchFastMode` operationId). func (c *Client) PatchFastModeWithBody(ctx context.Context, sessionID ID, params *PatchFastModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchFastModeRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchFastModeWithApplicationMergePatchPlusJSONBody Change session fast mode // // Conditional, user-facing configuration change. Requires the session // configuration ETag. Enabling is rejected unless the provider reports // fast mode supported; unknown capability is not inferred. Disabling is // always allowed. `toggle` inverts the state protected by If-Match; replaying // a successful toggle with the old ETag is refused rather than toggling twice. // This setting can affect provider billing. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id}/fast-mode (the `PatchFastMode` operationId). func (c *Client) PatchFastModeWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchFastModeParams, body PatchFastModeApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchFastModeRequestWithApplicationMergePatchPlusJSONBody(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSessionFile Read a text file in the session's workspace // // Reads on the machine the workspace is on: the daemon for a local workspace, the host through one SSH gather for a remote one. A missing file, a directory or another non-regular file answers 404 `file_not_found`; an unknown session answers 404 like other session routes. A remote host that is not ready answers 503 `workspace_unavailable`, a failed gather 502. Requires capability `file_reading: 1`. // // Corresponds with GET /sessions/{session_id}/files (the `GetSessionFile` operationId). func (c *Client) GetSessionFile(ctx context.Context, sessionID ID, params *GetSessionFileParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSessionFileRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistory Page history or fork checkpoints // // Use only one of before/after/next. Durable positions are independent of actor replay. Pages are ascending and preserve complete display groups where bounded. // // Corresponds with GET /sessions/{session_id}/history (the `GetHistory` operationId). func (c *Client) GetHistory(ctx context.Context, sessionID ID, params *GetHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistoryContentBatch Read several entries' full content in one walk // // The same parts and byte offsets as the single-entry route, for up to 200 entries, in the order `entries` names them. Follow next until null, repeating entries. One page stays inside the common encoded response bound, so a page whose entries are mostly references costs one request per byte budget instead of one request per entry. // // Corresponds with GET /sessions/{session_id}/history/content (the `GetHistoryContentBatch` operationId). func (c *Client) GetHistoryContentBatch(ctx context.Context, sessionID ID, params *GetHistoryContentBatchParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryContentBatchRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistoryContent Read full content in bounded pieces // // Follow next until null. UTF-8 pieces end at character boundaries. Reconstruct stored content, not shortened previews. Image fields are not paged here; their references name the image resource. // // Corresponds with GET /sessions/{session_id}/history/{entry_id} (the `GetHistoryContent` operationId). func (c *Client) GetHistoryContent(ctx context.Context, sessionID ID, entryID ID, params *GetHistoryContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryContentRequest(c.Server, sessionID, entryID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistoryImage Read one image field as its own bytes // // Image references in history point here. The body is the stored image itself, not base64, and is never content-coded. // // Corresponds with GET /sessions/{session_id}/history/{entry_id}/{field} (the `GetHistoryImage` operationId). func (c *Client) GetHistoryImage(ctx context.Context, sessionID ID, entryID ID, field string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryImageRequest(c.Server, sessionID, entryID, field) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetInput Read a durable input outcome // // Available after session deletion. Accepted is not consumed or answered. Retain pending and unfinished-turn identities; terminal decisions last seven days. Unknown old UUIDv7 returns 410, never a fresh admission. // // Corresponds with GET /sessions/{session_id}/inputs/{input_id} (the `GetInput` operationId). func (c *Client) GetInput(ctx context.Context, sessionID ID, inputID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInputRequest(c.Server, sessionID, inputID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutInputWithBody Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). func (c *Client) PutInputWithBody(ctx context.Context, sessionID ID, inputID UUIDv7, params *PutInputParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutInputRequestWithBody(c.Server, sessionID, inputID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutInput Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). func (c *Client) PutInput(ctx context.Context, sessionID ID, inputID UUIDv7, params *PutInputParams, body PutInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutInputRequest(c.Server, sessionID, inputID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelInputWithBody Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. ACP sessions require the current attachment token. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). func (c *Client) CancelInputWithBody(ctx context.Context, sessionID ID, inputID ID, params *CancelInputParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelInputRequestWithBody(c.Server, sessionID, inputID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelInput Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. ACP sessions require the current attachment token. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). func (c *Client) CancelInput(ctx context.Context, sessionID ID, inputID ID, params *CancelInputParams, body CancelInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelInputRequest(c.Server, sessionID, inputID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // InterruptSessionWithBody Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). func (c *Client) InterruptSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewInterruptSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // InterruptSession Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). func (c *Client) InterruptSession(ctx context.Context, sessionID ID, body InterruptSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewInterruptSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UpgradeKernelWithBody Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). func (c *Client) UpgradeKernelWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpgradeKernelRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UpgradeKernel Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). func (c *Client) UpgradeKernel(ctx context.Context, sessionID ID, body UpgradeKernelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpgradeKernelRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReloadSessionWithBody Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). func (c *Client) ReloadSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReloadSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReloadSession Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). func (c *Client) ReloadSession(ctx context.Context, sessionID ID, body ReloadSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReloadSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RewindSessionWithBody Cut a session back to before a user message and keep the removed tail as an archived session // // Idle required. The checkpoint must be a user message from the checkpoint view. The session keeps every row before it, and the full prior conversation is copied first into a new archived session. The session actor stops, so attached streams reconnect and reset. Python namespace and files on disk are not rewound. A requested summary is made before anything changes, so a failed summary leaves the session untouched. Requires capability `history_rewind: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/rewind (the `RewindSession` operationId). func (c *Client) RewindSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRewindSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RewindSession Cut a session back to before a user message and keep the removed tail as an archived session // // Idle required. The checkpoint must be a user message from the checkpoint view. The session keeps every row before it, and the full prior conversation is copied first into a new archived session. The session actor stops, so attached streams reconnect and reset. Python namespace and files on disk are not rewound. A requested summary is made before anything changes, so a failed summary leaves the session untouched. Requires capability `history_rewind: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/rewind (the `RewindSession` operationId). func (c *Client) RewindSession(ctx context.Context, sessionID ID, body RewindSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRewindSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetShellCommand Read a human shell command // // Corresponds with GET /sessions/{session_id}/shell-commands/{command_id} (the `GetShellCommand` operationId). func (c *Client) GetShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetShellCommandRequest(c.Server, sessionID, commandID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutShellCommandWithBody Admit one immutable human shell command // // Durable admission precedes process spawn. Same identity and command returns the original resource before mutable checks; changed intent conflicts. One running command and at most 32 uncommitted outcomes per session. No automatic model turn. Remote workspaces are refused. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/shell-commands/{command_id} (the `PutShellCommand` operationId). func (c *Client) PutShellCommandWithBody(ctx context.Context, sessionID ID, commandID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutShellCommandRequestWithBody(c.Server, sessionID, commandID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutShellCommand Admit one immutable human shell command // // Durable admission precedes process spawn. Same identity and command returns the original resource before mutable checks; changed intent conflicts. One running command and at most 32 uncommitted outcomes per session. No automatic model turn. Remote workspaces are refused. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/shell-commands/{command_id} (the `PutShellCommand` operationId). func (c *Client) PutShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, body PutShellCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutShellCommandRequest(c.Server, sessionID, commandID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetShellCommandOutput Read retained sanitized shell output // // UTF-8 byte offsets, complete-codepoint pages, next_offset null at the current captured cutoff. Retained output is at most 16 MiB; no terminal controls are stored. // // Corresponds with GET /sessions/{session_id}/shell-commands/{command_id}/output (the `GetShellCommandOutput` operationId). func (c *Client) GetShellCommandOutput(ctx context.Context, sessionID ID, commandID UUIDv7, params *GetShellCommandOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetShellCommandOutputRequest(c.Server, sessionID, commandID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // StopShellCommand Request termination of one human shell command // // Stops this command process group only. Response can remain running until cleanup is confirmed; read the same resource for its terminal outcome. // // Corresponds with POST /sessions/{session_id}/shell-commands/{command_id}/stop (the `StopShellCommand` operationId). func (c *Client) StopShellCommand(ctx context.Context, sessionID ID, commandID UUIDv7, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewStopShellCommandRequest(c.Server, sessionID, commandID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RecordVisitWithBody Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). func (c *Client) RecordVisitWithBody(ctx context.Context, sessionID ID, visitID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRecordVisitRequestWithBody(c.Server, sessionID, visitID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RecordVisit Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). func (c *Client) RecordVisit(ctx context.Context, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRecordVisitRequest(c.Server, sessionID, visitID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSettings Read shared settings or one canonical group // // Without group, return Settings and observed group validators. With group, return that group only; the ETag covers that representation. // // Corresponds with GET /settings (the `GetSettings` operationId). func (c *Client) GetSettings(ctx context.Context, params *GetSettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSettingsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSettingsWithBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). func (c *Client) PatchSettingsWithBody(ctx context.Context, params *PatchSettingsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSettingsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSettingsWithApplicationMergePatchPlusJSONBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). func (c *Client) PatchSettingsWithApplicationMergePatchPlusJSONBody(ctx context.Context, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetStorage Read storage accounting // // Each section has its own continuation. Totals cover complete storage. Paths never authorize local mutation. Requires capability `storage_report: 1`. // // Corresponds with GET /storage (the `GetStorage` operationId). func (c *Client) GetStorage(ctx context.Context, params *GetStorageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetStorageRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CloseTerminal Explicitly close an interactive pseudo-terminal session // // Terminates the pseudo-terminal process group and releases its resources. // // Corresponds with DELETE /terminals/{terminal_id} (the `CloseTerminal` operationId). func (c *Client) CloseTerminal(ctx context.Context, terminalID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCloseTerminalRequest(c.Server, terminalID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AttachTerminal Upgrade to interactive pseudo-terminal session // // WebSocket upgrade endpoint for an interactive terminal. Authenticated by the same bearer token and origin policy as other daemon routes. // Binary frames carry raw terminal PTY bytes. Text frames are JSON objects for control commands: // {type:"ping"}, {type:"input",data:...}, {type:"resize",cols:...,rows:...}, {type:"signal",signal:"SIGINT"|"SIGTERM"|...}, {type:"restart",cols:...,rows:...}. // Server sends {type:"ready",id,cwd,shell,cols,rows,state,exit_code} on attach, binary frames for terminal output (including initial scrollback history), // {type:"exit",exit_code} when the shell process exits, and {type:"pong"} keepalives. // // Corresponds with GET /terminals/{terminal_id} (the `AttachTerminal` operationId). func (c *Client) AttachTerminal(ctx context.Context, terminalID ID, params *AttachTerminalParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAttachTerminalRequest(c.Server, terminalID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetWorkspaces Browse recent locations or a directory // // Without location return recent workspaces. include=preview requires location. Paths resolve on the daemon host; cached host state does not perform SSH sign-in. Requires capability `workspace_browsing: 1`. // // Corresponds with GET /workspaces (the `GetWorkspaces` operationId). func (c *Client) GetWorkspaces(ctx context.Context, params *GetWorkspacesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetWorkspacesRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // NewGetAuthRequest constructs an http.Request for the GetAuth method func NewGetAuthRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteAccountRequest constructs an http.Request for the DeleteAccount method func NewDeleteAccountRequest(server string, accountID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "account_id", accountID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchAccountRequest calls the generic PatchAccount builder with application/json body func NewPatchAccountRequest(server string, accountID ID, body PatchAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchAccountRequestWithBody(server, accountID, "application/json", bodyReader) } // NewPatchAccountRequestWithBody constructs an http.Request for the PatchAccount method, with any body, and a specified content type func NewPatchAccountRequestWithBody(server string, accountID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "account_id", accountID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewPutKeyAccountRequest calls the generic PutKeyAccount builder with application/json body func NewPutKeyAccountRequest(server string, accountID UUIDv7, body PutKeyAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutKeyAccountRequestWithBody(server, accountID, "application/json", bodyReader) } // NewPutKeyAccountRequestWithBody constructs an http.Request for the PutKeyAccount method, with any body, and a specified content type func NewPutKeyAccountRequestWithBody(server string, accountID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "account_id", accountID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/keys/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewCancelLoginRequest constructs an http.Request for the CancelLogin method func NewCancelLoginRequest(server string, loginID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetLoginRequest constructs an http.Request for the GetLogin method func NewGetLoginRequest(server string, loginID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody calls the generic AnswerLogin builder with application/merge-patch+json body func NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody(server string, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAnswerLoginRequestWithBody(server, loginID, params, "application/merge-patch+json", bodyReader) } // NewAnswerLoginRequestWithBody constructs an http.Request for the AnswerLogin method, with any body, and a specified content type func NewAnswerLoginRequestWithBody(server string, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewCreateLoginRequest calls the generic CreateLogin builder with application/json body func NewCreateLoginRequest(server string, loginID UUIDv7, body CreateLoginJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateLoginRequestWithBody(server, loginID, "application/json", bodyReader) } // NewCreateLoginRequestWithBody constructs an http.Request for the CreateLogin method, with any body, and a specified content type func NewCreateLoginRequestWithBody(server string, loginID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetEventsRequest constructs an http.Request for the GetEvents method func NewGetEventsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/events") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewReportArtifactErrorRequestWithTextBody calls the generic ReportArtifactError builder with text/plain body func NewReportArtifactErrorRequestWithTextBody(server string, frame string, version string, body ReportArtifactErrorTextRequestBody) (*http.Request, error) { var bodyReader io.Reader if stringer, ok := interface{}(body).(fmt.Stringer); ok { bodyReader = strings.NewReader(stringer.String()) } else { return nil, fmt.Errorf("text/plain is not supported for complex types, define a String() method on ArtifactError to marshal it as text") } return NewReportArtifactErrorRequestWithBody(server, frame, version, "text/plain", bodyReader) } // NewReportArtifactErrorRequestWithBody constructs an http.Request for the ReportArtifactError method, with any body, and a specified content type func NewReportArtifactErrorRequestWithBody(server string, frame string, version string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "frame", frame, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "version", version, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/frame/%s/%s/.albedo/errors", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewSaveArtifactStateRequestWithTextBody calls the generic SaveArtifactState builder with text/plain body func NewSaveArtifactStateRequestWithTextBody(server string, frame string, version string, body SaveArtifactStateTextRequestBody) (*http.Request, error) { var bodyReader io.Reader if stringer, ok := interface{}(body).(fmt.Stringer); ok { bodyReader = strings.NewReader(stringer.String()) } else { return nil, fmt.Errorf("text/plain is not supported for complex types, define a String() method on ArtifactState to marshal it as text") } return NewSaveArtifactStateRequestWithBody(server, frame, version, "text/plain", bodyReader) } // NewSaveArtifactStateRequestWithBody constructs an http.Request for the SaveArtifactState method, with any body, and a specified content type func NewSaveArtifactStateRequestWithBody(server string, frame string, version string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "frame", frame, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "version", version, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/frame/%s/%s/.albedo/state", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetArtifactLatestVersionRequest constructs an http.Request for the GetArtifactLatestVersion method func NewGetArtifactLatestVersionRequest(server string, frame string, version string, params *GetArtifactLatestVersionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "frame", frame, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "version", version, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/frame/%s/%s/.albedo/version", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.After != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after", *params.After, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetArtifactFileRequest constructs an http.Request for the GetArtifactFile method func NewGetArtifactFileRequest(server string, frame string, version string, path string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "frame", frame, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "version", version, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "path", path, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/frame/%s/%s/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListArtifactsRequest constructs an http.Request for the ListArtifacts method func NewListArtifactsRequest(server string, params *ListArtifactsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Session != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session", *params.Session, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteArtifactRequest constructs an http.Request for the DeleteArtifact method func NewDeleteArtifactRequest(server string, artifactID ArtifactID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "artifact_id", artifactID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetArtifactRequest constructs an http.Request for the GetArtifact method func NewGetArtifactRequest(server string, artifactID ArtifactID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "artifact_id", artifactID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/artifacts/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListDiscordBotsRequest constructs an http.Request for the ListDiscordBots method func NewListDiscordBotsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateDiscordBotRequest calls the generic CreateDiscordBot builder with application/json body func NewCreateDiscordBotRequest(server string, body CreateDiscordBotJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateDiscordBotRequestWithBody(server, "application/json", bodyReader) } // NewCreateDiscordBotRequestWithBody constructs an http.Request for the CreateDiscordBot method, with any body, and a specified content type func NewCreateDiscordBotRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteDiscordBotRequest constructs an http.Request for the DeleteDiscordBot method func NewDeleteDiscordBotRequest(server string, botID ID, params *DeleteDiscordBotParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "revision", params.Revision, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetDiscordBotRequest constructs an http.Request for the GetDiscordBot method func NewGetDiscordBotRequest(server string, botID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchDiscordBotRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchDiscordBot builder with application/merge-patch+json body func NewPatchDiscordBotRequestWithApplicationMergePatchPlusJSONBody(server string, botID ID, body PatchDiscordBotApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchDiscordBotRequestWithBody(server, botID, "application/merge-patch+json", bodyReader) } // NewPatchDiscordBotRequestWithBody constructs an http.Request for the PatchDiscordBot method, with any body, and a specified content type func NewPatchDiscordBotRequestWithBody(server string, botID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewPutDiscordChannelRequest calls the generic PutDiscordChannel builder with application/json body func NewPutDiscordChannelRequest(server string, botID ID, channelID ID, body PutDiscordChannelJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutDiscordChannelRequestWithBody(server, botID, channelID, "application/json", bodyReader) } // NewPutDiscordChannelRequestWithBody constructs an http.Request for the PutDiscordChannel method, with any body, and a specified content type func NewPutDiscordChannelRequestWithBody(server string, botID ID, channelID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "channel_id", channelID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/channels/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetDiscordDMsRequest constructs an http.Request for the GetDiscordDMs method func NewGetDiscordDMsRequest(server string, botID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/dms", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteDiscordDMRequest constructs an http.Request for the DeleteDiscordDM method func NewDeleteDiscordDMRequest(server string, botID ID, userID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "user_id", userID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/dms/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPutDiscordDMRequest calls the generic PutDiscordDM builder with application/json body func NewPutDiscordDMRequest(server string, botID ID, userID ID, body PutDiscordDMJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutDiscordDMRequestWithBody(server, botID, userID, "application/json", bodyReader) } // NewPutDiscordDMRequestWithBody constructs an http.Request for the PutDiscordDM method, with any body, and a specified content type func NewPutDiscordDMRequestWithBody(server string, botID ID, userID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "user_id", userID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/dms/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListDiscordGuildsRequest constructs an http.Request for the ListDiscordGuilds method func NewListDiscordGuildsRequest(server string, botID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/guilds", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteDiscordRequestRequest constructs an http.Request for the DeleteDiscordRequest method func NewDeleteDiscordRequestRequest(server string, botID ID, userID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bot_id", botID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "user_id", userID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/discord/bots/%s/requests/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUnlinkWorkspaceRequest constructs an http.Request for the UnlinkWorkspace method func NewUnlinkWorkspaceRequest(server string, params *UnlinkWorkspaceParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "member", params.Member, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetLinkGroupRequest constructs an http.Request for the GetLinkGroup method func NewGetLinkGroupRequest(server string, params *GetLinkGroupParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewMergeLinkGroupsRequest calls the generic MergeLinkGroups builder with application/json body func NewMergeLinkGroupsRequest(server string, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewMergeLinkGroupsRequestWithBody(server, params, "application/json", bodyReader) } // NewMergeLinkGroupsRequestWithBody constructs an http.Request for the MergeLinkGroups method, with any body, and a specified content type func NewMergeLinkGroupsRequestWithBody(server string, params *MergeLinkGroupsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListPaperclipsRequest constructs an http.Request for the ListPaperclips method func NewListPaperclipsRequest(server string, params *ListPaperclipsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreatePaperclipsRequest calls the generic CreatePaperclips builder with application/json body func NewCreatePaperclipsRequest(server string, body CreatePaperclipsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreatePaperclipsRequestWithBody(server, "application/json", bodyReader) } // NewCreatePaperclipsRequestWithBody constructs an http.Request for the CreatePaperclips method, with any body, and a specified content type func NewCreatePaperclipsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeletePaperclipsRequest constructs an http.Request for the DeletePaperclips method func NewDeletePaperclipsRequest(server string, itemID ID, params *DeletePaperclipsParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetPaperclipsRequest constructs an http.Request for the GetPaperclips method func NewGetPaperclipsRequest(server string, itemID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchPaperclips builder with application/merge-patch+json body func NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody(server string, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchPaperclipsRequestWithBody(server, itemID, params, "application/merge-patch+json", bodyReader) } // NewPatchPaperclipsRequestWithBody constructs an http.Request for the PatchPaperclips method, with any body, and a specified content type func NewPatchPaperclipsRequestWithBody(server string, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewCreateProxyCompletionRequest calls the generic CreateProxyCompletion builder with application/json body func NewCreateProxyCompletionRequest(server string, body CreateProxyCompletionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateProxyCompletionRequestWithBody(server, "application/json", bodyReader) } // NewCreateProxyCompletionRequestWithBody constructs an http.Request for the CreateProxyCompletion method, with any body, and a specified content type func NewCreateProxyCompletionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/proxy/v1/chat/completions") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListProxyModelsRequest constructs an http.Request for the ListProxyModels method func NewListProxyModelsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/proxy/v1/models") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListJobsRequest constructs an http.Request for the ListJobs method func NewListJobsRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListRecentJobsRequest constructs an http.Request for the ListRecentJobs method func NewListRecentJobsRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs/recent", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewReadJobOutputRequest constructs an http.Request for the ReadJobOutput method func NewReadJobOutputRequest(server string, sessionID ID, jobID ID, params *ReadJobOutputParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs/%s/output", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Offset != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "offset", *params.Offset, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewStopJobRequest calls the generic StopJob builder with application/json body func NewStopJobRequest(server string, sessionID ID, jobID ID, body StopJobJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewStopJobRequestWithBody(server, sessionID, jobID, "application/json", bodyReader) } // NewStopJobRequestWithBody constructs an http.Request for the StopJob method, with any body, and a specified content type func NewStopJobRequestWithBody(server string, sessionID ID, jobID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs/%s/stop", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListScheduleRequest constructs an http.Request for the ListSchedule method func NewListScheduleRequest(server string, params *ListScheduleParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateScheduleRequest calls the generic CreateSchedule builder with application/json body func NewCreateScheduleRequest(server string, body CreateScheduleJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateScheduleRequestWithBody(server, "application/json", bodyReader) } // NewCreateScheduleRequestWithBody constructs an http.Request for the CreateSchedule method, with any body, and a specified content type func NewCreateScheduleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteScheduleRequest constructs an http.Request for the DeleteSchedule method func NewDeleteScheduleRequest(server string, jobID ID, params *DeleteScheduleParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetScheduleRequest constructs an http.Request for the GetSchedule method func NewGetScheduleRequest(server string, jobID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSchedule builder with application/merge-patch+json body func NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody(server string, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchScheduleRequestWithBody(server, jobID, params, "application/merge-patch+json", bodyReader) } // NewPatchScheduleRequestWithBody constructs an http.Request for the PatchSchedule method, with any body, and a specified content type func NewPatchScheduleRequestWithBody(server string, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListSkillLoadsRequest constructs an http.Request for the ListSkillLoads method func NewListSkillLoadsRequest(server string, params *ListSkillLoadsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/skills/loads") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListWebSearchProvidersRequest constructs an http.Request for the ListWebSearchProviders method func NewListWebSearchProvidersRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/web-search/providers") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewChangeWebSearchProviderRequest calls the generic ChangeWebSearchProvider builder with application/json body func NewChangeWebSearchProviderRequest(server string, name ID, body ChangeWebSearchProviderJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewChangeWebSearchProviderRequestWithBody(server, name, "application/json", bodyReader) } // NewChangeWebSearchProviderRequestWithBody constructs an http.Request for the ChangeWebSearchProvider method, with any body, and a specified content type func NewChangeWebSearchProviderRequestWithBody(server string, name ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/web-search/providers/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetDeliveryRequest constructs an http.Request for the GetDelivery method func NewGetDeliveryRequest(server string, deliveryID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "delivery_id", deliveryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/deliveries/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListHooksRequest constructs an http.Request for the ListHooks method func NewListHooksRequest(server string, params *ListHooksParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.SessionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", *params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateHookRequest calls the generic CreateHook builder with application/json body func NewCreateHookRequest(server string, body CreateHookJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateHookRequestWithBody(server, "application/json", bodyReader) } // NewCreateHookRequestWithBody constructs an http.Request for the CreateHook method, with any body, and a specified content type func NewCreateHookRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteHookRequest constructs an http.Request for the DeleteHook method func NewDeleteHookRequest(server string, hookID ID, params *DeleteHookParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetHookRequest constructs an http.Request for the GetHook method func NewGetHookRequest(server string, hookID ID, params *GetHookParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchHookRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchHook builder with application/merge-patch+json body func NewPatchHookRequestWithApplicationMergePatchPlusJSONBody(server string, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchHookRequestWithBody(server, hookID, params, "application/merge-patch+json", bodyReader) } // NewPatchHookRequestWithBody constructs an http.Request for the PatchHook method, with any body, and a specified content type func NewPatchHookRequestWithBody(server string, hookID ID, params *PatchHookParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListHookDeliveriesRequest constructs an http.Request for the ListHookDeliveries method func NewListHookDeliveriesRequest(server string, hookID ID, params *ListHookDeliveriesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/deliveries", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.State != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "state", *params.State, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeliverWebhookRequestWithBody constructs an http.Request for the DeliverWebhook method, with any body, and a specified content type func NewDeliverWebhookRequestWithBody(server string, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/deliveries", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { if params.XAlbedoEventID != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "X-Albedo-Event-Id", *params.XAlbedoEventID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("X-Albedo-Event-Id", headerParam0) } } return req, nil } // NewRotateHookSecretRequest calls the generic RotateHookSecret builder with application/json body func NewRotateHookSecretRequest(server string, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRotateHookSecretRequestWithBody(server, hookID, params, "application/json", bodyReader) } // NewRotateHookSecretRequestWithBody constructs an http.Request for the RotateHookSecret method, with any body, and a specified content type func NewRotateHookSecretRequestWithBody(server string, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/secret", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetHookPermissionRequest constructs an http.Request for the GetHookPermission method func NewGetHookPermissionRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/permissions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchHookPermission builder with application/merge-patch+json body func NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody(server string, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchHookPermissionRequestWithBody(server, sessionID, params, "application/merge-patch+json", bodyReader) } // NewPatchHookPermissionRequestWithBody constructs an http.Request for the PatchHookPermission method, with any body, and a specified content type func NewPatchHookPermissionRequestWithBody(server string, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/permissions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListWorkRequest constructs an http.Request for the ListWork method func NewListWorkRequest(server string, params *ListWorkParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateWorkRequest calls the generic CreateWork builder with application/json body func NewCreateWorkRequest(server string, params *CreateWorkParams, body CreateWorkJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateWorkRequestWithBody(server, params, "application/json", bodyReader) } // NewCreateWorkRequestWithBody constructs an http.Request for the CreateWork method, with any body, and a specified content type func NewCreateWorkRequestWithBody(server string, params *CreateWorkParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteWorkRequest constructs an http.Request for the DeleteWork method func NewDeleteWorkRequest(server string, itemID ID, params *DeleteWorkParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.NotifySessionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "notify_session_id", *params.NotifySessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetWorkRequest constructs an http.Request for the GetWork method func NewGetWorkRequest(server string, itemID ID, params *GetWorkParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchWork builder with application/merge-patch+json body func NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody(server string, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchWorkRequestWithBody(server, itemID, params, "application/merge-patch+json", bodyReader) } // NewPatchWorkRequestWithBody constructs an http.Request for the PatchWork method, with any body, and a specified content type func NewPatchWorkRequestWithBody(server string, itemID ID, params *PatchWorkParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListHostsRequest constructs an http.Request for the ListHosts method func NewListHostsRequest(server string, params *ListHostsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/hosts") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Target != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "target", *params.Target, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewProbeHostRequest calls the generic ProbeHost builder with application/json body func NewProbeHostRequest(server string, host ID, body ProbeHostJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewProbeHostRequestWithBody(server, host, "application/json", bodyReader) } // NewProbeHostRequestWithBody constructs an http.Request for the ProbeHost method, with any body, and a specified content type func NewProbeHostRequestWithBody(server string, host ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "host", host, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/hosts/%s/probe", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListModelsRequest constructs an http.Request for the ListModels method func NewListModelsRequest(server string, params *ListModelsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/models") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Extension != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "extension", *params.Extension, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Host != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "host", *params.Host, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Model != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "model", *params.Model, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.ProviderProfile != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "provider_profile", *params.ProviderProfile, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Provider != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "provider", *params.Provider, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Endpoint != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endpoint", *params.Endpoint, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uri"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetServerRequest constructs an http.Request for the GetServer method func NewGetServerRequest(server string, params *GetServerParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/server") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Include != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaProvider != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_provider", *params.QuotaProvider, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaAccount != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_account", *params.QuotaAccount, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaLimit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_limit", *params.QuotaLimit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaSince != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_since", *params.QuotaSince, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewShutdownServerRequest calls the generic ShutdownServer builder with application/json body func NewShutdownServerRequest(server string, body ShutdownServerJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewShutdownServerRequestWithBody(server, "application/json", bodyReader) } // NewShutdownServerRequestWithBody constructs an http.Request for the ShutdownServer method, with any body, and a specified content type func NewShutdownServerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/server/shutdown") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListSessionsRequest constructs an http.Request for the ListSessions method func NewListSessionsRequest(server string, params *ListSessionsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Scope != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "scope", *params.Scope, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.ParentID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "parent_id", *params.ParentID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FamilyID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "family_id", *params.FamilyID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Workspace != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", *params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Search != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "search", *params.Search, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Archived != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "archived", *params.Archived, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.NeedsReload != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "needs_reload", *params.NeedsReload, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Acp != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "acp", *params.Acp, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Sort != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort", *params.Sort, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteSessionRequest constructs an http.Request for the DeleteSession method func NewDeleteSessionRequest(server string, sessionID ID, params *DeleteSessionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Scope != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "scope", *params.Scope, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FamilyRevision != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "family_revision", *params.FamilyRevision, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetSessionRequest constructs an http.Request for the GetSession method func NewGetSessionRequest(server string, sessionID ID, params *GetSessionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Tail != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tail", *params.Tail, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.AfterGeneration != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after_generation", *params.AfterGeneration, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.AfterSeq != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after_seq", *params.AfterSeq, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSession builder with application/merge-patch+json body func NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody(server string, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchSessionRequestWithBody(server, sessionID, params, "application/merge-patch+json", bodyReader) } // NewPatchSessionRequestWithBody constructs an http.Request for the PatchSession method, with any body, and a specified content type func NewPatchSessionRequestWithBody(server string, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) if params.AlbedoAttachmentToken != nil { var headerParam1 string headerParam1, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", *params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam1) } } return req, nil } // NewCreateSessionRequest calls the generic CreateSession builder with application/json body func NewCreateSessionRequest(server string, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateSessionRequestWithBody(server, sessionID, params, "application/json", bodyReader) } // NewCreateSessionRequestWithBody constructs an http.Request for the CreateSession method, with any body, and a specified content type func NewCreateSessionRequestWithBody(server string, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-None-Match", params.IfNoneMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-None-Match", headerParam0) if params.AlbedoAttachmentToken != nil { var headerParam1 string headerParam1, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", *params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam1) } } return req, nil } // NewReleaseACPSessionRequest constructs an http.Request for the ReleaseACPSession method func NewReleaseACPSessionRequest(server string, sessionID ID, params *ReleaseACPSessionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/acp-attachment", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam0) } return req, nil } // NewAttachACPSessionRequest calls the generic AttachACPSession builder with application/json body func NewAttachACPSessionRequest(server string, sessionID ID, params *AttachACPSessionParams, body AttachACPSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAttachACPSessionRequestWithBody(server, sessionID, params, "application/json", bodyReader) } // NewAttachACPSessionRequestWithBody constructs an http.Request for the AttachACPSession method, with any body, and a specified content type func NewAttachACPSessionRequestWithBody(server string, sessionID ID, params *AttachACPSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/acp-attachment", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam0) } return req, nil } // NewRenewACPSessionRequest calls the generic RenewACPSession builder with application/json body func NewRenewACPSessionRequest(server string, sessionID ID, params *RenewACPSessionParams, body RenewACPSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRenewACPSessionRequestWithBody(server, sessionID, params, "application/json", bodyReader) } // NewRenewACPSessionRequestWithBody constructs an http.Request for the RenewACPSession method, with any body, and a specified content type func NewRenewACPSessionRequestWithBody(server string, sessionID ID, params *RenewACPSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/acp-attachment/renew", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam0) } return req, nil } // NewGetActiveOutputContentRequest constructs an http.Request for the GetActiveOutputContent method func NewGetActiveOutputContentRequest(server string, sessionID ID, contentID ID, params *GetActiveOutputContentParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "content_id", contentID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/active-output/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "snapshot", params.Snapshot, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetCatalogRequest constructs an http.Request for the GetCatalog method func NewGetCatalogRequest(server string, sessionID ID, params *GetCatalogParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/catalog", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Kind != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "kind", *params.Kind, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCompactSessionRequest calls the generic CompactSession builder with application/json body func NewCompactSessionRequest(server string, sessionID ID, body CompactSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCompactSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewCompactSessionRequestWithBody constructs an http.Request for the CompactSession method, with any body, and a specified content type func NewCompactSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/compaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetContextRequest constructs an http.Request for the GetContext method func NewGetContextRequest(server string, sessionID ID, params *GetContextParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/context", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SnapshotID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "snapshot_id", *params.SnapshotID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SectionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "section_id", *params.SectionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.After != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after", *params.After, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SinceMs != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "since_ms", *params.SinceMs, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetContextWindowRequest constructs an http.Request for the GetContextWindow method func NewGetContextWindowRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/context-window", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetFastModeRequest constructs an http.Request for the GetFastMode method func NewGetFastModeRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/fast-mode", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchFastModeRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchFastMode builder with application/merge-patch+json body func NewPatchFastModeRequestWithApplicationMergePatchPlusJSONBody(server string, sessionID ID, params *PatchFastModeParams, body PatchFastModeApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchFastModeRequestWithBody(server, sessionID, params, "application/merge-patch+json", bodyReader) } // NewPatchFastModeRequestWithBody constructs an http.Request for the PatchFastMode method, with any body, and a specified content type func NewPatchFastModeRequestWithBody(server string, sessionID ID, params *PatchFastModeParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/fast-mode", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetSessionFileRequest constructs an http.Request for the GetSessionFile method func NewGetSessionFileRequest(server string, sessionID ID, params *GetSessionFileParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/files", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "path", params.Path, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryRequest constructs an http.Request for the GetHistory method func NewGetHistoryRequest(server string, sessionID ID, params *GetHistoryParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Before != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "before", *params.Before, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.After != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after", *params.After, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryContentBatchRequest constructs an http.Request for the GetHistoryContentBatch method func NewGetHistoryContentBatchRequest(server string, sessionID ID, params *GetHistoryContentBatchParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history/content", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "entries", params.Entries, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryContentRequest constructs an http.Request for the GetHistoryContent method func NewGetHistoryContentRequest(server string, sessionID ID, entryID ID, params *GetHistoryContentParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "entry_id", entryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryImageRequest constructs an http.Request for the GetHistoryImage method func NewGetHistoryImageRequest(server string, sessionID ID, entryID ID, field string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "entry_id", entryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "field", field, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history/%s/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetInputRequest constructs an http.Request for the GetInput method func NewGetInputRequest(server string, sessionID ID, inputID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPutInputRequest calls the generic PutInput builder with application/json body func NewPutInputRequest(server string, sessionID ID, inputID UUIDv7, params *PutInputParams, body PutInputJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutInputRequestWithBody(server, sessionID, inputID, params, "application/json", bodyReader) } // NewPutInputRequestWithBody constructs an http.Request for the PutInput method, with any body, and a specified content type func NewPutInputRequestWithBody(server string, sessionID ID, inputID UUIDv7, params *PutInputParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { if params.AlbedoAttachmentToken != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", *params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam0) } } return req, nil } // NewCancelInputRequest calls the generic CancelInput builder with application/json body func NewCancelInputRequest(server string, sessionID ID, inputID ID, params *CancelInputParams, body CancelInputJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCancelInputRequestWithBody(server, sessionID, inputID, params, "application/json", bodyReader) } // NewCancelInputRequestWithBody constructs an http.Request for the CancelInput method, with any body, and a specified content type func NewCancelInputRequestWithBody(server string, sessionID ID, inputID ID, params *CancelInputParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s/cancel", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { if params.AlbedoAttachmentToken != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Albedo-Attachment-Token", *params.AlbedoAttachmentToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Albedo-Attachment-Token", headerParam0) } } return req, nil } // NewInterruptSessionRequest calls the generic InterruptSession builder with application/json body func NewInterruptSessionRequest(server string, sessionID ID, body InterruptSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewInterruptSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewInterruptSessionRequestWithBody constructs an http.Request for the InterruptSession method, with any body, and a specified content type func NewInterruptSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/interrupt", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewUpgradeKernelRequest calls the generic UpgradeKernel builder with application/json body func NewUpgradeKernelRequest(server string, sessionID ID, body UpgradeKernelJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpgradeKernelRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewUpgradeKernelRequestWithBody constructs an http.Request for the UpgradeKernel method, with any body, and a specified content type func NewUpgradeKernelRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/kernel/upgrade", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewReloadSessionRequest calls the generic ReloadSession builder with application/json body func NewReloadSessionRequest(server string, sessionID ID, body ReloadSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewReloadSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewReloadSessionRequestWithBody constructs an http.Request for the ReloadSession method, with any body, and a specified content type func NewReloadSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/reload", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewRewindSessionRequest calls the generic RewindSession builder with application/json body func NewRewindSessionRequest(server string, sessionID ID, body RewindSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRewindSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewRewindSessionRequestWithBody constructs an http.Request for the RewindSession method, with any body, and a specified content type func NewRewindSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/rewind", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetShellCommandRequest constructs an http.Request for the GetShellCommand method func NewGetShellCommandRequest(server string, sessionID ID, commandID UUIDv7) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "command_id", commandID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/shell-commands/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPutShellCommandRequest calls the generic PutShellCommand builder with application/json body func NewPutShellCommandRequest(server string, sessionID ID, commandID UUIDv7, body PutShellCommandJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutShellCommandRequestWithBody(server, sessionID, commandID, "application/json", bodyReader) } // NewPutShellCommandRequestWithBody constructs an http.Request for the PutShellCommand method, with any body, and a specified content type func NewPutShellCommandRequestWithBody(server string, sessionID ID, commandID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "command_id", commandID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/shell-commands/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetShellCommandOutputRequest constructs an http.Request for the GetShellCommandOutput method func NewGetShellCommandOutputRequest(server string, sessionID ID, commandID UUIDv7, params *GetShellCommandOutputParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "command_id", commandID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/shell-commands/%s/output", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Offset != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "offset", *params.Offset, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewStopShellCommandRequest constructs an http.Request for the StopShellCommand method func NewStopShellCommandRequest(server string, sessionID ID, commandID UUIDv7) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "command_id", commandID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/shell-commands/%s/stop", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewRecordVisitRequest calls the generic RecordVisit builder with application/json body func NewRecordVisitRequest(server string, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRecordVisitRequestWithBody(server, sessionID, visitID, "application/json", bodyReader) } // NewRecordVisitRequestWithBody constructs an http.Request for the RecordVisit method, with any body, and a specified content type func NewRecordVisitRequestWithBody(server string, sessionID ID, visitID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "visit_id", visitID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/visits/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetSettingsRequest constructs an http.Request for the GetSettings method func NewGetSettingsRequest(server string, params *GetSettingsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/settings") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Group != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "group", *params.Group, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSettings builder with application/merge-patch+json body func NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody(server string, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchSettingsRequestWithBody(server, params, "application/merge-patch+json", bodyReader) } // NewPatchSettingsRequestWithBody constructs an http.Request for the PatchSettings method, with any body, and a specified content type func NewPatchSettingsRequestWithBody(server string, params *PatchSettingsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/settings") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "group", params.Group, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetStorageRequest constructs an http.Request for the GetStorage method func NewGetStorageRequest(server string, params *GetStorageParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/storage") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.SessionsNext != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sessions_next", *params.SessionsNext, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FilesNext != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "files_next", *params.FilesNext, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCloseTerminalRequest constructs an http.Request for the CloseTerminal method func NewCloseTerminalRequest(server string, terminalID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "terminal_id", terminalID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/terminals/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewAttachTerminalRequest constructs an http.Request for the AttachTerminal method func NewAttachTerminalRequest(server string, terminalID ID, params *AttachTerminalParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "terminal_id", terminalID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/terminals/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Cwd != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cwd", *params.Cwd, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SessionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", *params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Cols != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cols", *params.Cols, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Rows != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "rows", *params.Rows, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Restart != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "restart", *params.Restart, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Shell != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "shell", *params.Shell, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetWorkspacesRequest constructs an http.Request for the GetWorkspaces method func NewGetWorkspacesRequest(server string, params *GetWorkspacesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/workspaces") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Location != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "location", *params.Location, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Include != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { return err } } for _, r := range additionalEditors { if err := r(ctx, req); err != nil { return err } } return nil } // Response decoding is owned by the daemon adapter.