Backend Reference
pocketbase
Section titled “pocketbase”import "github.com/qtpi-bonding-org/pocketcoder/backend"@pocketcoder-core: Main Orchestrator. Registers hooks, starts the relay, and boots PocketBase. @pocketcoder-core: Sovereign Relay. The orchestration layer that syncs the agent runtime with the Sandbox.
func main
Section titled “func main”func main()import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/api"@pocketcoder-core: Agent API. The AG-UI SSE run, event replay, cancel, and approval routes for the mobile client.
@pocketcoder-core: Logs API. Native Docker log streaming via SSE.
@pocketcoder-core: MCP API. Handler for MCP server requests from Poco.
@pocketcoder-core: MCP OAuth Token Intake. Receives the {access_token, refresh_token} pair a client obtained via workers/oauth-relay’s PKCE exchange (Component 3) and writes it into the same mcp_servers.config JSON blob hooks/mcp.go’s renderMcpConfig already turns into mcp.env — this is not a new secret-delivery path, it reuses the existing one. NOT written into mcp-gateway’s own OAuth credential-helper store (pkg/oauth/token_store.go) — that store belongs to the gateway’s own DCR-based OAuth subsystem, which this design does not use (see the spec’s Problem section).
@pocketcoder-core: Ollama control API. PocketBase is the only service on the control network, so clients never receive a route or a port to the local-model runtime directly.
@pocketcoder-core: Proxy API. Reverse proxy for observability and log services.
PocketCoder release compatibility and authenticated update status APIs.
- Constants
- Variables
- func AddAgentOperations(app core.App, registry *operation.Registry, deps AgentDeps) (coordinator.AgentRuntime, error)
- func AddLiveActivityOperations(app core.App, registry *operation.Registry)
- func AddLogOperations(registry *operation.Registry, deps LogsDeps)
- func AddMcpOAuthOperations(app core.App, registry *operation.Registry)
- func AddMcpOperations(app core.App, registry *operation.Registry, deps McpDeps)
- func AddOllamaOperations(registry *operation.Registry, deps OllamaDeps)
- func AddProxyOperations(registry *operation.Registry, deps ProxyDeps)
- func AddReleaseStatusOperations(registry *operation.Registry)
- func AddScheduleOperations(app core.App, registry *operation.Registry, coord func() coordinator.AgentRuntime) *schedule.Runner
- func CancelChatSession(app core.App, service coordinator.AgentRuntime, re *core.RequestEvent) error
- func EndLiveActivity(app core.App, re *core.RequestEvent) error
- func ExecuteMcpRequest(app core.App, resolveImage mcpserver.ImageResolver, re *core.RequestEvent) (mcpserver.Result, error)
- func ListOllamaModels(re *core.RequestEvent, client *http.Client, baseURL string) ([]ollama.Model, bool, error)
- func PersistModelOverride(app core.App, chatID string, modelID string)
- func PromptChat(app core.App, service coordinator.AgentRuntime, ollamaBaseURL string, re *core.RequestEvent) (string, error)
- func ReleaseCompatibility() (dataVersion int, compatibility any)
- func RequireOwnedRecordForOperation(app core.App, re *core.RequestEvent, collection, id string) (*core.Record, error)
- func RespondToElicitation(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, resp acpsdk.UnstableCreateElicitationResponse) error
- func RespondToPermission(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, input acpsdk.RequestPermissionResponse) error
- func RunScheduleNow(app core.App, runner *schedule.Runner, re *core.RequestEvent) error
- func SetChatConfigOption(app core.App, re *core.RequestEvent, service coordinator.AgentRuntime, chatID string, req acpsdk.SetSessionConfigOptionRequest) error
- func SetChatMode(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, modeID string) error
- func SetLiveActivityToken(app core.App, re *core.RequestEvent) error
- func SetLiveActivityTokenByID(app core.App, re *core.RequestEvent, id, token string) error
- func StoreMcpOAuthToken(app core.App, re *core.RequestEvent) error
- func clearSelectionToNone(app core.App, userID, harnessID, providerID string) error
- func createProxyHandler(target string, prefix string, transport http.RoundTripper) func(re *core.RequestEvent) error
- func parseCursor(re *core.RequestEvent) int
- func readJSON(path string, target any) error
- func releaseStateDir() string
- func requireOwnedRecord(app core.App, re *core.RequestEvent, collection, id string) (*core.Record, error)
- func requireRole(re *core.RequestEvent, roles …string) error
- func resolveAccountAndAttemptError(re *core.RequestEvent, err error) error
- func resolveMode(app core.App, userID, harnessID, providerID string) string
- func storeOAuthToken(app core.App, serverName, accessToken, refreshToken string) error
- func writeFlush(w http.ResponseWriter, flusher http.Flusher, seq int, ev events.Event) error
- func writeSeqFrame(w io.Writer, seq int, ev events.Event) error
- type AgentDeps
- type HarnessAuthDeps
- type HarnessAuthRuntime
- type HarnessAuthStatusResponse
- type LogsDeps
- type McpDeps
- type OllamaDeps
- type ProxyDeps
- type ReleaseStatusDocument
- type containerLister
- type dockerLogSource
- type dockerProxyContainerLister
- type dockerProxyLogSource
- type harnessAuthAttemptResp
- type harnessAuthChallengeResp
- type harnessAuthRequest
- type harnessAuthRuntime
- type harnessAuthStatusResp
- func CancelHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func DisconnectHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func GetHarnessAuthStatus(app core.App, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func PollHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func StartHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func SubmitHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)
- func renderHarnessAuthStatus(account *core.Record, attempt *core.Record, mode string) harnessAuthStatusResp
- type ollamaPullRequest
- type releasePointerResponse
Constants
Section titled “Constants”ObservabilityProxyPrefix is the path this proxy is mounted at, exported so config_consistency_test.go can assert docker-compose.yml’s SQLPAGE_SITE_PREFIX actually matches it. It has to: the reverse proxy strips this prefix before forwarding, so SQLPage sees an unprefixed path and 308-redirects to whatever site prefix IT was told to expect -- a mismatch there sends that redirect to a path this proxy never registered at all, 404ing. Confirmed live: SQLPAGE_SITE_PREFIX had drifted to a stale pre-v1 path (missing this route’s “v1” segment), breaking the Monitor screen’s observability dashboard 100% of the time.
const ObservabilityProxyPrefix = "/api/pocketcoder/v1/proxy/observability"const defaultReleaseStateDir = "/var/lib/pocketcoder/release"const maxLogExcerptBytes = 64 * 1024Variables
Section titled “Variables”var ( errOAuthServerNotFound = fmt.Errorf("mcp_servers row not found") errOAuthNotConfigured = fmt.Errorf("mcp_servers row has no oauth_token_env_var set"))var developmentCompatibility = map[string]any{ "app": map[string]any{ "contractVersion": 1, "officialMinimumVersions": map[string]string{ "pocketcoder-pro": "1.0.0", "pocketcoder-foss": "1.0.0", }, }, "server": map[string]int{"apiVersion": 1}, "workers": map[string]int{ "image-relay": 1, "push-relay": 1, "oauth-relay": 1, }, "provisioning": map[string]int{"contractVersion": 1}, "deployment": map[string]any{ "contractVersion": 1, "supportedSourceContractVersions": map[string]int{ "minimum": 1, "maximum": 1, }, },}errLogsUnavailable indicates the upstream Docker proxy responded, but not with a usable log stream (e.g. unknown container) -- distinct from a connection failure to the proxy itself.
var errLogsUnavailable = errors.New("logs unavailable")var safeContainerName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}$`)func AddAgentOperations
Section titled “func AddAgentOperations”func AddAgentOperations(app core.App, registry *operation.Registry, deps AgentDeps) (coordinator.AgentRuntime, error)func AddLiveActivityOperations
Section titled “func AddLiveActivityOperations”func AddLiveActivityOperations(app core.App, registry *operation.Registry)func AddLogOperations
Section titled “func AddLogOperations”func AddLogOperations(registry *operation.Registry, deps LogsDeps)func AddMcpOAuthOperations
Section titled “func AddMcpOAuthOperations”func AddMcpOAuthOperations(app core.App, registry *operation.Registry)func AddMcpOperations
Section titled “func AddMcpOperations”func AddMcpOperations(app core.App, registry *operation.Registry, deps McpDeps)func AddOllamaOperations
Section titled “func AddOllamaOperations”func AddOllamaOperations(registry *operation.Registry, deps OllamaDeps)func AddProxyOperations
Section titled “func AddProxyOperations”func AddProxyOperations(registry *operation.Registry, deps ProxyDeps)func AddReleaseStatusOperations
Section titled “func AddReleaseStatusOperations”func AddReleaseStatusOperations(registry *operation.Registry)func AddScheduleOperations
Section titled “func AddScheduleOperations”func AddScheduleOperations(app core.App, registry *operation.Registry, coord func() coordinator.AgentRuntime) *schedule.Runnerfunc CancelChatSession
Section titled “func CancelChatSession”func CancelChatSession(app core.App, service coordinator.AgentRuntime, re *core.RequestEvent) errorCancelChatSession validates ownership and cancels the active agent run. The operationapi strict server uses this plain function to construct the operation’s typed success response without routing through dispatch.
func EndLiveActivity
Section titled “func EndLiveActivity”func EndLiveActivity(app core.App, re *core.RequestEvent) errorfunc ExecuteMcpRequest
Section titled “func ExecuteMcpRequest”func ExecuteMcpRequest(app core.App, resolveImage mcpserver.ImageResolver, re *core.RequestEvent) (mcpserver.Result, error)func ListOllamaModels
Section titled “func ListOllamaModels”func ListOllamaModels(re *core.RequestEvent, client *http.Client, baseURL string) ([]ollama.Model, bool, error)func PersistModelOverride
Section titled “func PersistModelOverride”func PersistModelOverride(app core.App, chatID string, modelID string)PersistModelOverride is best-effort: the live RPC already succeeded, so a lookup/save failure here is logged, not returned.
func PromptChat
Section titled “func PromptChat”func PromptChat(app core.App, service coordinator.AgentRuntime, ollamaBaseURL string, re *core.RequestEvent) (string, error)PromptChat starts an agent run and returns its run id. It contains the synchronous validation and side effects shared by the strict operation adapter; the legacy registry action remains as the direct-route adapter.
func ReleaseCompatibility
Section titled “func ReleaseCompatibility”func ReleaseCompatibility() (dataVersion int, compatibility any)ReleaseCompatibility computes the current release-compatibility document. Exported so operationapi.server.GetReleaseCompatibility can call it directly and build a typed response.
func RequireOwnedRecordForOperation
Section titled “func RequireOwnedRecordForOperation”func RequireOwnedRecordForOperation(app core.App, re *core.RequestEvent, collection, id string) (*core.Record, error)RequireOwnedRecordForOperation exposes the common chat ownership check to typed strict-server methods while keeping the authorization policy here.
func RespondToElicitation
Section titled “func RespondToElicitation”func RespondToElicitation(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, resp acpsdk.UnstableCreateElicitationResponse) errorRespondToElicitation resolves a pending elicitation request. Shared by the registry action and the strict operation adapter.
func RespondToPermission
Section titled “func RespondToPermission”func RespondToPermission(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, input acpsdk.RequestPermissionResponse) errorRespondToPermission resolves a pending permission request with the caller’s decision. Shared by the registry action and the strict operation adapter.
func RunScheduleNow
Section titled “func RunScheduleNow”func RunScheduleNow(app core.App, runner *schedule.Runner, re *core.RequestEvent) errorfunc SetChatConfigOption
Section titled “func SetChatConfigOption”func SetChatConfigOption(app core.App, re *core.RequestEvent, service coordinator.AgentRuntime, chatID string, req acpsdk.SetSessionConfigOptionRequest) errorSetChatConfigOption changes a single session config option on the active run. Shared by the registry action and the strict operation adapter.
func SetChatMode
Section titled “func SetChatMode”func SetChatMode(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, modeID string) errorSetChatMode changes the active run’s mode. Shared by the registry action (raw-body parsing) and the strict operation adapter (typed request body).
func SetLiveActivityToken
Section titled “func SetLiveActivityToken”func SetLiveActivityToken(app core.App, re *core.RequestEvent) errorSetLiveActivityToken lets the client report back the real ActivityKit push token once it’s handed one asynchronously after a server-created (push-to-start) Activity actually starts on-device -- there is no other way to do this, since the collection’s updateRule is null. Parses the body itself, for the raw registry.Route path.
func SetLiveActivityTokenByID
Section titled “func SetLiveActivityTokenByID”func SetLiveActivityTokenByID(app core.App, re *core.RequestEvent, id, token string) errorSetLiveActivityTokenByID does the ownership check and status-checked save, taking an already-parsed token -- shared by SetLiveActivityToken’s raw-body path and the operationapi strict handler (which already has request.Body.ActivityPushToken typed for it, so it calls this directly rather than round-tripping through a raw HTTP body).
func StoreMcpOAuthToken
Section titled “func StoreMcpOAuthToken”func StoreMcpOAuthToken(app core.App, re *core.RequestEvent) errorfunc clearSelectionToNone
Section titled “func clearSelectionToNone”func clearSelectionToNone(app core.App, userID, harnessID, providerID string) errorfunc createProxyHandler
Section titled “func createProxyHandler”func createProxyHandler(target string, prefix string, transport http.RoundTripper) func(re *core.RequestEvent) errorcreateProxyHandler creates a standard reverse proxy handler that strips a prefix and forwards to a target.
func parseCursor
Section titled “func parseCursor”func parseCursor(re *core.RequestEvent) intparseCursor reads the resume cursor from ?cursor= or the Last-Event-ID header (falling back to 0, meaning “everything”). ?cursor= wins if both are present.
func readJSON
Section titled “func readJSON”func readJSON(path string, target any) errorfunc releaseStateDir
Section titled “func releaseStateDir”func releaseStateDir() stringfunc requireOwnedRecord
Section titled “func requireOwnedRecord”func requireOwnedRecord(app core.App, re *core.RequestEvent, collection, id string) (*core.Record, error)requireOwnedRecord returns a record only when it belongs to the caller. Missing, unauthenticated, and non-owned records are intentionally indistinguishable to callers.
func requireRole
Section titled “func requireRole”func requireRole(re *core.RequestEvent, roles ...string) errorrequireRole enforces authentication and membership in one of the supplied roles. Authentication failures deliberately have a different status from authorization failures.
func resolveAccountAndAttemptError
Section titled “func resolveAccountAndAttemptError”func resolveAccountAndAttemptError(re *core.RequestEvent, err error) errorresolveAccountAndAttemptError classifies harnessauth.ResolveAccountAndAttempt’s error: the two genuinely-not-found cases become a real 404, everything else (malformed input, ownership mismatches surfaced as plain errors, etc.) stays a 400. Live-confirmed 2026-08-27: every one of this function’s four call sites previously did `re.BadRequestError(err.Error(), nil)` unconditionally, so a caller with no matching account at all got a misleading 400 instead of 404.
func resolveMode
Section titled “func resolveMode”func resolveMode(app core.App, userID, harnessID, providerID string) stringresolveMode returns the user’s currently selected credential_selections.mode for (harness, provider), or harnessauth.ModeNone if no selection exists yet.
func storeOAuthToken
Section titled “func storeOAuthToken”func storeOAuthToken(app core.App, serverName, accessToken, refreshToken string) errorstoreOAuthToken merges access_token (and, if present, refresh_token) into the target mcp_servers row’s existing `config` map — the same field hooks/mcp.go’s renderMcpConfig already writes into mcp.env as `KEY=value` lines for every approved server. The env var name comes from that row’s oauth_token_env_var field; the refresh token, if any, lands under “{oauth_token_env_var}_REFRESH_TOKEN” — a naming convention, not a separate schema field, since nothing consumes it yet (token refresh is out of scope, see the spec’s Out of scope section).
Saving the record fires hooks/mcp.go’s OnRecordAfterUpdateSuccess handler, which re-renders mcp.env and restarts the gateway container whenever the row’s *current* status is “approved” or “revoked” — no separate re-render call is needed here, and a still-“pending” row is correctly left out of the catalog until it’s explicitly approved.
func writeFlush
Section titled “func writeFlush”func writeFlush(w http.ResponseWriter, flusher http.Flusher, seq int, ev events.Event) errorfunc writeSeqFrame
Section titled “func writeSeqFrame”func writeSeqFrame(w io.Writer, seq int, ev events.Event) errorwriteSeqFrame writes one SSE frame whose id: line is the chat-global seq (not the AG-UI SDK’s default `<Type>_<timestamp>` id, which the stream route needs to be a monotonic cursor clients can resume from via Last-Event-ID / ?cursor=). Newlines in the JSON payload are escaped so the frame stays a single `data:` line per the SSE wire format.
type AgentDeps
Section titled “type AgentDeps”type AgentDeps struct { Runtime coordinator.AgentRuntime Dial coordinator.DialFunc}type HarnessAuthDeps
Section titled “type HarnessAuthDeps”type HarnessAuthDeps struct { Runtime harnessAuthRuntime}type HarnessAuthRuntime
Section titled “type HarnessAuthRuntime”type HarnessAuthRuntime = harnessAuthRuntimetype HarnessAuthStatusResponse
Section titled “type HarnessAuthStatusResponse”type HarnessAuthStatusResponse = harnessAuthStatusResptype LogsDeps
Section titled “type LogsDeps”type LogsDeps struct { App core.App Source dockerLogSource // nil -> dockerProxyLogSource{} Lister containerLister // nil -> dockerProxyContainerLister{}}type McpDeps
Section titled “type McpDeps”type McpDeps struct{ ResolveImage mcpserver.ImageResolver }type OllamaDeps
Section titled “type OllamaDeps”type OllamaDeps struct { Docker ollama.Docker HTTP *http.Client StreamHTTP *http.Client Config ollama.Config RuntimeMu *sync.Mutex}type ProxyDeps
Section titled “type ProxyDeps”type ProxyDeps struct { Transport http.RoundTripper TargetURL string}type ReleaseStatusDocument
Section titled “type ReleaseStatusDocument”type ReleaseStatusDocument struct { ReleaseDigest string `json:"releaseDigest"` SourceCommit string `json:"sourceCommit"` ServerVersion string `json:"serverVersion"` DataVersion int `json:"dataVersion"` DeploymentContractVersion int `json:"deploymentContractVersion"` SelectedHarnesses []string `json:"selectedHarnesses"`}func ReleaseStatus
Section titled “func ReleaseStatus”func ReleaseStatus() (ReleaseStatusDocument, map[string]any, error)type containerLister
Section titled “type containerLister”containerLister lists this deployment’s containers -- separate interface from dockerLogSource so tests can fake list and stream independently.
type containerLister interface { ListContainers(ctx context.Context) ([]dockerapi.ContainerSummary, error)}type dockerLogSource
Section titled “type dockerLogSource”dockerLogSource streams a container’s combined stdout/stderr log, multiplexed in Docker’s frame format, starting from the last 100 lines.
type dockerLogSource interface { StreamLogs(ctx context.Context, containerName string) (io.ReadCloser, error)}type dockerProxyContainerLister
Section titled “type dockerProxyContainerLister”dockerProxyContainerLister is the production containerLister, backed by the internal docker-socket-proxy.
type dockerProxyContainerLister struct{}func (dockerProxyContainerLister) ListContainers
Section titled “func (dockerProxyContainerLister) ListContainers”func (dockerProxyContainerLister) ListContainers(ctx context.Context) ([]dockerapi.ContainerSummary, error)type dockerProxyLogSource
Section titled “type dockerProxyLogSource”dockerProxyLogSource is the production dockerLogSource, backed by the internal docker-socket-proxy.
type dockerProxyLogSource struct{}func (dockerProxyLogSource) StreamLogs
Section titled “func (dockerProxyLogSource) StreamLogs”func (dockerProxyLogSource) StreamLogs(ctx context.Context, containerName string) (io.ReadCloser, error)type harnessAuthAttemptResp
Section titled “type harnessAuthAttemptResp”type harnessAuthAttemptResp struct { ID string `json:"id"` Status string `json:"status"` LastError string `json:"lastError,omitempty"`}type harnessAuthChallengeResp
Section titled “type harnessAuthChallengeResp”type harnessAuthChallengeResp struct { Type string `json:"type"` Text string `json:"text"` Target string `json:"target,omitempty"` Details string `json:"details,omitempty"` Kind string `json:"kind,omitempty"` VerificationURI string `json:"verificationUri,omitempty"` UserCode string `json:"userCode,omitempty"` CodeDestination string `json:"codeDestination,omitempty"` ExpiresAt string `json:"expiresAt,omitempty"` PollIntervalSeconds int `json:"pollIntervalSeconds,omitempty"`}func challengeResponse
Section titled “func challengeResponse”func challengeResponse(c *harnessauth.Challenge) *harnessAuthChallengeResptype harnessAuthRequest
Section titled “type harnessAuthRequest”type harnessAuthRequest struct { Harness string `json:"harness"` Provider string `json:"provider"` // pc_providers record id -- required on every operation now AccountID string `json:"accountId"` AccountName string `json:"accountName"` Visibility string `json:"visibility"` Mode string `json:"mode"` // "oauth" | "none" -- "api_key" is gone; keys are plain provider_api_keys CRUD (Task 13) AttemptID string `json:"attemptId"` Code string `json:"code"`}func authRequest
Section titled “func authRequest”func authRequest(app core.App, re *core.RequestEvent) (harnessAuthRequest, *core.Record, *core.Record, error)type harnessAuthRuntime
Section titled “type harnessAuthRuntime”type harnessAuthRuntime interface { Start(context.Context, string, harnessauth.AttemptContext) (*harnessauth.AttemptState, error) Poll(context.Context, string, harnessauth.AttemptContext) (*harnessauth.AttemptState, error) Submit(context.Context, string, harnessauth.AttemptContext, string) (*harnessauth.AttemptState, error) Cancel(context.Context, string, harnessauth.AttemptContext) (*harnessauth.AttemptState, error) Disconnect(context.Context, string, harnessauth.AttemptContext) (*harnessauth.AttemptState, error)}func AddHarnessAuthOperations
Section titled “func AddHarnessAuthOperations”func AddHarnessAuthOperations(app core.App, registry *operation.Registry, deps HarnessAuthDeps) harnessAuthRuntimetype harnessAuthStatusResp
Section titled “type harnessAuthStatusResp”type harnessAuthStatusResp struct { Harness string `json:"harness"` Provider string `json:"provider"` AccountID string `json:"accountId,omitempty"` AccountName string `json:"accountName,omitempty"` Visibility string `json:"visibility,omitempty"` Mode string `json:"mode"` Status string `json:"status"` LastError string `json:"lastError,omitempty"` Attempt *harnessAuthAttemptResp `json:"attempt,omitempty"` Challenge *harnessAuthChallengeResp `json:"challenge,omitempty"`}func CancelHarnessAuth
Section titled “func CancelHarnessAuth”func CancelHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)func DisconnectHarnessAuth
Section titled “func DisconnectHarnessAuth”func DisconnectHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)func GetHarnessAuthStatus
Section titled “func GetHarnessAuthStatus”func GetHarnessAuthStatus(app core.App, re *core.RequestEvent) (harnessAuthStatusResp, error)func PollHarnessAuth
Section titled “func PollHarnessAuth”func PollHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)func StartHarnessAuth
Section titled “func StartHarnessAuth”func StartHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)func SubmitHarnessAuth
Section titled “func SubmitHarnessAuth”func SubmitHarnessAuth(app core.App, runtime harnessAuthRuntime, re *core.RequestEvent) (harnessAuthStatusResp, error)func renderHarnessAuthStatus
Section titled “func renderHarnessAuthStatus”func renderHarnessAuthStatus(account *core.Record, attempt *core.Record, mode string) harnessAuthStatusResptype ollamaPullRequest
Section titled “type ollamaPullRequest”type ollamaPullRequest struct { Model string `json:"model"`}type releasePointerResponse
Section titled “type releasePointerResponse”type releasePointerResponse struct { ReleaseDigest string `json:"releaseDigest"` SourceCommit string `json:"sourceCommit"` ServerVersion string `json:"serverVersion"` DataVersion int `json:"dataVersion"` DeploymentContractVersion int `json:"deploymentContractVersion"` Compatibility json.RawMessage `json:"compatibility"` SelectedHarnesses []string `json:"selectedHarnesses"`}dockerapi
Section titled “dockerapi”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/dockerapi"@pocketcoder-core: Docker Engine API client for harness provisioning, talking only to docker-socket-proxy-write — never the raw socket. Follows the same fixed-dial-to-proxy pattern as hooks/docker.go’s restartContainer, extended to the handful of extra calls provisioning needs (inspect, pull, create, start, events).
- Constants
- Variables
- func DecodeLogFrame(r *bufio.Reader) (stream byte, payload []byte, err error)
- func decodeDockerLogStream(raw []byte) (string, error)
- type Client
- func New() *Client
- func (c *Client) CaptureExitDiagnostics(ctx context.Context, containerID string) (int, string, error)
- func (c *Client) CopyArchive(ctx context.Context, containerName, destination string, archive io.Reader) error
- func (c *Client) Create(ctx context.Context, name string, spec CreateSpec) (string, error)
- func (c *Client) Events(ctx context.Context) (<-chan Event, error)
- func (c *Client) GetArchive(ctx context.Context, containerName, path string) (io.ReadCloser, error)
- func (c *Client) ImageExists(ctx context.Context, image string) (bool, error)
- func (c *Client) Inspect(ctx context.Context, containerName string) (ContainerInspect, error)
- func (c *Client) ListAll(ctx context.Context) ([]ContainerSummary, error)
- func (c *Client) ListContainers(ctx context.Context) ([]ContainerSummary, error)
- func (c *Client) LoadImage(ctx context.Context, archive io.Reader) error
- func (c *Client) Logs(ctx context.Context, containerName string, tail int) (string, error)
- func (c *Client) PullImage(ctx context.Context, image string) error
- func (c *Client) Remove(ctx context.Context, containerName string) error
- func (c *Client) Start(ctx context.Context, containerName string) error
- func (c *Client) Stop(ctx context.Context, containerName string, timeout int) error
- func (c *Client) StreamLogs(ctx context.Context, containerName string, tail int) (io.ReadCloser, error)
- type ContainerInspect
- type ContainerSummary
- type CreateSpec
- type Event
- type Mount
- type NetworkEndpoint
Constants
Section titled “Constants”MaxLogFrameSize is the largest payload accepted from a Docker log frame.
const MaxLogFrameSize = 1 << 20const defaultDockerHost = "tcp://docker-socket-proxy-write:2375"Variables
Section titled “Variables”var ErrContainerNotFound = errors.New("container not found")func DecodeLogFrame
Section titled “func DecodeLogFrame”func DecodeLogFrame(r *bufio.Reader) (stream byte, payload []byte, err error)DecodeLogFrame reads one Docker multiplexed log frame.
func decodeDockerLogStream
Section titled “func decodeDockerLogStream”func decodeDockerLogStream(raw []byte) (string, error)type Client
Section titled “type Client”type Client struct { baseURL string http *http.Client}func New
Section titled “func New”func New() *Clientfunc (*Client) CaptureExitDiagnostics
Section titled “func (*Client) CaptureExitDiagnostics”func (c *Client) CaptureExitDiagnostics(ctx context.Context, containerID string) (int, string, error)CaptureExitDiagnostics captures a stopped container’s exit code and log tail before removal.
func (*Client) CopyArchive
Section titled “func (*Client) CopyArchive”func (c *Client) CopyArchive(ctx context.Context, containerName, destination string, archive io.Reader) errorCopyArchive writes a tar archive into a running container using Docker’s archive API. This deliberately avoids exec: PocketBase can materialize managed files without gaining a shell in user harnesses.
func (*Client) Create
Section titled “func (*Client) Create”func (c *Client) Create(ctx context.Context, name string, spec CreateSpec) (string, error)func (*Client) Events
Section titled “func (*Client) Events”func (c *Client) Events(ctx context.Context) (<-chan Event, error)func (*Client) GetArchive
Section titled “func (*Client) GetArchive”func (c *Client) GetArchive(ctx context.Context, containerName, path string) (io.ReadCloser, error)func (*Client) ImageExists
Section titled “func (*Client) ImageExists”func (c *Client) ImageExists(ctx context.Context, image string) (bool, error)ImageExists reports whether image is already present in the local Docker image store. First-party harness images are loaded from verified release artifacts, so pulling their commit tags from a registry would be both unnecessary and guaranteed to fail: PocketCoder does not publish those local image tags to a registry.
func (*Client) Inspect
Section titled “func (*Client) Inspect”func (c *Client) Inspect(ctx context.Context, containerName string) (ContainerInspect, error)func (*Client) ListAll
Section titled “func (*Client) ListAll”func (c *Client) ListAll(ctx context.Context) ([]ContainerSummary, error)ListAll is retained for callers that use the older name for the same Docker API operation.
func (*Client) ListContainers
Section titled “func (*Client) ListContainers”func (c *Client) ListContainers(ctx context.Context) ([]ContainerSummary, error)func (*Client) LoadImage
Section titled “func (*Client) LoadImage”func (c *Client) LoadImage(ctx context.Context, archive io.Reader) errorLoadImage streams a compressed docker-save archive into Docker. The normal API client has a short timeout for control operations; image loading is bounded by the caller’s context instead because large archives can take several minutes to import.
func (*Client) Logs
Section titled “func (*Client) Logs”func (c *Client) Logs(ctx context.Context, containerName string, tail int) (string, error)func (*Client) PullImage
Section titled “func (*Client) PullImage”func (c *Client) PullImage(ctx context.Context, image string) errorfunc (*Client) Remove
Section titled “func (*Client) Remove”func (c *Client) Remove(ctx context.Context, containerName string) errorRemove deletes a managed container after it has stopped. The socket proxy permits this narrow lifecycle operation for PocketCoder-owned containers.
func (*Client) Start
Section titled “func (*Client) Start”func (c *Client) Start(ctx context.Context, containerName string) errorfunc (*Client) Stop
Section titled “func (*Client) Stop”func (c *Client) Stop(ctx context.Context, containerName string, timeout int) errorfunc (*Client) StreamLogs
Section titled “func (*Client) StreamLogs”func (c *Client) StreamLogs(ctx context.Context, containerName string, tail int) (io.ReadCloser, error)StreamLogs opens a live Docker log stream without buffering it. The normal client timeout is unsuitable for follow=1; cancellation is controlled by the caller’s context instead.
type ContainerInspect
Section titled “type ContainerInspect”type ContainerInspect struct { Mounts []Mount Config struct { Image string Labels map[string]string } NetworkSettings struct { Networks map[string]NetworkEndpoint } State struct { Running bool Status string ExitCode int `json:"ExitCode"` }}type ContainerSummary
Section titled “type ContainerSummary”type ContainerSummary struct { ID string `json:"Id"` Names []string `json:"Names"` Image string `json:"Image"` State string `json:"State"` Status string `json:"Status"`}type CreateSpec
Section titled “type CreateSpec”type CreateSpec struct { Image string Entrypoint []string Cmd []string Env []string VolumeName, VolumeDest string VolumeBinds []string Labels map[string]string NetworkNames []string NetworkAliases map[string][]string RestartPolicy string}type Event
Section titled “type Event”type Event struct { Type, Action, ContainerName string}type Mount
Section titled “type Mount”type Mount struct { Destination, Name string}type NetworkEndpoint
Section titled “type NetworkEndpoint”type NetworkEndpoint struct{}errorutil
Section titled “errorutil”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/errorutil"func Internal
Section titled “func Internal”func Internal(context string, err error) errorInternal logs the underlying error server-side and returns a safe generic error to the client. Plain errors from strict handlers are otherwise converted by PocketBase into a misleading 400 response.
filesystem
Section titled “filesystem”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/filesystem"@pocketcoder-core: Files API. Secure endpoint for accessing workspace files.
- Variables
- func AddFileOperations(registry *operation.Registry, deps FileDeps)
- func fileTreeErrorResponse(re *core.RequestEvent, err error) error
- func readFileFromContainer(archive io.Reader) ([]byte, error)
- func resolveUserContainer(app core.App, userID string) (string, error)
- func resolveWorkspacePath(pathParam string) (cleanPath string, ok bool)
- type FileDeps
- type FileTreeEntry
- func ListWorkspaceFileTree(re *core.RequestEvent) (string, []FileTreeEntry, error)
- func buildFileTreeFromTar(r io.Reader, rootName string) ([]FileTreeEntry, error)
- func flattenFileTree(node *fileTreeNode) []FileTreeEntry
- func listWorkspaceFileTree(ctx context.Context, reader containerArchiveReader, app core.App, userID, pathParam string) (cleanPath string, entries []FileTreeEntry, err error)
- type containerArchiveReader
- type dockerArchiveReader
- type fileTreeNode
Variables
Section titled “Variables”var ( errPathEscape = errors.New("path escape attempt detected") errWorkspaceUnavailable = errors.New("workspace not available") errNotFound = errors.New("not found"))var workspaceRoot = "/workspace"func AddFileOperations
Section titled “func AddFileOperations”func AddFileOperations(registry *operation.Registry, deps FileDeps)func fileTreeErrorResponse
Section titled “func fileTreeErrorResponse”func fileTreeErrorResponse(re *core.RequestEvent, err error) errorfunc readFileFromContainer
Section titled “func readFileFromContainer”func readFileFromContainer(archive io.Reader) ([]byte, error)func resolveUserContainer
Section titled “func resolveUserContainer”func resolveUserContainer(app core.App, userID string) (string, error)Any of the user’s running instances works: they share one workspace volume.
func resolveWorkspacePath
Section titled “func resolveWorkspacePath”func resolveWorkspacePath(pathParam string) (cleanPath string, ok bool)resolveWorkspacePath cleans pathParam and rejects any path that would escape workspaceRoot syntactically. Symlink escapes are the target container’s own concern -- Docker’s archive API resolves them against that container’s real filesystem, not anything local to this process.
A target that doesn’t exist yet (or is a broken symlink) is allowed through: sanitization has already passed, so the archive fetch is left to report its own NotFound error.
type FileDeps
Section titled “type FileDeps”FileDeps wires the workspace file endpoints to the requesting user’s own running harness container -- each user has their own derived workspace volume, so there is no single local mount pocketbase itself can read.
type FileDeps struct { App core.App Reader containerArchiveReader // nil -> real Docker archive API}type FileTreeEntry
Section titled “type FileTreeEntry”FileTreeEntry is one node of a full recursive directory tree. Size/ModTime are only meaningful for files; Children is only populated for directories.
type FileTreeEntry struct { Name string `json:"name"` IsDir bool `json:"isDir"` Size int64 `json:"size,omitempty"` ModTime string `json:"modTime,omitempty"` Children []FileTreeEntry `json:"children,omitempty"`}func ListWorkspaceFileTree
Section titled “func ListWorkspaceFileTree”func ListWorkspaceFileTree(re *core.RequestEvent) (string, []FileTreeEntry, error)Always uses the real Docker archive API -- the strict-server dispatch path (operationapi/server.go) that calls this has no test-injected reader.
func buildFileTreeFromTar
Section titled “func buildFileTreeFromTar”func buildFileTreeFromTar(r io.Reader, rootName string) ([]FileTreeEntry, error)rootName is the requested directory’s own base name -- Docker’s archive API names every entry in the stream relative to it (e.g. requesting “/workspace/src” yields “src/main.go”), so it must be stripped here.
func flattenFileTree
Section titled “func flattenFileTree”func flattenFileTree(node *fileTreeNode) []FileTreeEntryfunc listWorkspaceFileTree
Section titled “func listWorkspaceFileTree”func listWorkspaceFileTree(ctx context.Context, reader containerArchiveReader, app core.App, userID, pathParam string) (cleanPath string, entries []FileTreeEntry, err error)type containerArchiveReader
Section titled “type containerArchiveReader”containerArchiveReader abstracts Docker’s archive-read API so tests can fake a container’s filesystem without a real Docker daemon.
type containerArchiveReader interface { GetArchive(ctx context.Context, containerName, path string) (io.ReadCloser, error)}type dockerArchiveReader
Section titled “type dockerArchiveReader”type dockerArchiveReader struct{ client *dockerapi.Client }func (dockerArchiveReader) GetArchive
Section titled “func (dockerArchiveReader) GetArchive”func (d dockerArchiveReader) GetArchive(ctx context.Context, containerName, path string) (io.ReadCloser, error)type fileTreeNode
Section titled “type fileTreeNode”order lets the final sort be deterministic regardless of the tar’s own entry order.
type fileTreeNode struct { entry FileTreeEntry children map[string]*fileTreeNode order []string}func newFileTreeNode
Section titled “func newFileTreeNode”func newFileTreeNode(name string) *fileTreeNodegitssh
Section titled “gitssh”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/gitssh"- Constants
- Variables
- func BuiltinKnownHosts(id string) []string
- func CanonicalRepository(provider, repository string) (string, error)
- func ProbeHostKey(ctx context.Context, host string, port int) (string, error)
- func RenderConfig(access []Access) (string, error)
- func RenderRemotesDoc(access []Access) string
- func SSHTarget(provider, repository string) (string, error)
- func ValidateFiles(files []File) error
- func generationHash(config string, knownHosts []string, newKeys map[string][]byte) string
- type Access
- type File
- type KeyMaterial
- type Manifest
- type Materializer
- type Provider
- type Queue
- type Reconciler
- func (r *Reconciler) ReconcileUser(ctx context.Context, app core.App, userID string) error
- func (r *Reconciler) generateKeysForPendingCredentials(app core.App, userID string) (map[string][]byte, error)
- func (r *Reconciler) linkGeneratedDeployCredentials(app core.App, userID string) error
- func (r *Reconciler) materialize(ctx context.Context, app core.App, userID string, newKeys map[string][]byte) error
- func (r *Reconciler) pinCustomHostKeys(ctx context.Context, app core.App, userID string) error
Constants
Section titled “Constants”const CustomProviderID = "custom"Variables
Section titled “Variables”var builtinKnownHosts = map[string][]string{ "github": { "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl", "github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=", "github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QQCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=", }, "gitlab": { "gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf", "gitlab.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY=", "gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9", }, "codeberg": { "codeberg.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2pDxWr18SoiDJCGZ5LmxPygTlPu+cCKSkpqkvCyQzl5xmIMeKNdfdBpfbCGDPoZQghePzFZkKJNR/v9Win3Sc=", "codeberg.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8hZi7K1/2E2uBX8gwPRJAHvRAob+3Sn+y2hxiEhN0buv1igjYFTgFO2qQD8vLfU/HT/P/rqvEeTvaDfY1y/vcvQ8+YuUYyTwE2UaVU5aJv89y6PEZBYycaJCPdGIfZlLMmjilh/Sk8IWSEK6dQr+g686lu5cSWrFW60ixWpHpEVB26eRWin3lKYWSQGMwwKv4LwmW3ouqqs4Z4vsqRFqXJ/eCi3yhpT+nOjljXvZKiYTpYajqUC48IHAxTWugrKe1vXWOPxVXXMQEPsaIRc2hpK+v1LmfB7GnEGvF1UAKnEZbUuiD9PBEeD5a1MZQIzcoPWCrTxipEpuXQ5Tni4mN", "codeberg.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIVIC02vnjFyL+I4RHfvIGNtOgJMe769VTF1VR4EB3ZB", },}var providers = map[string]Provider{ "github": {"github", "github.com", "git", 22}, "gitlab": {"gitlab", "gitlab.com", "git", 22}, "codeberg": {"codeberg", "codeberg.org", "git", 22},}var repoPattern = regexp.MustCompile(`^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$`)func BuiltinKnownHosts
Section titled “func BuiltinKnownHosts”func BuiltinKnownHosts(id string) []stringfunc CanonicalRepository
Section titled “func CanonicalRepository”func CanonicalRepository(provider, repository string) (string, error)func ProbeHostKey
Section titled “func ProbeHostKey”func ProbeHostKey(ctx context.Context, host string, port int) (string, error)func RenderConfig
Section titled “func RenderConfig”func RenderConfig(access []Access) (string, error)func RenderRemotesDoc
Section titled “func RenderRemotesDoc”func RenderRemotesDoc(access []Access) stringRenderRemotesDoc must use the `git@pcgit-<id>:…` alias form, not the provider’s real hostname -- a plain `git@github.com:…` URL bypasses the config’s IdentitiesOnly scoping entirely.
func SSHTarget
Section titled “func SSHTarget”func SSHTarget(provider, repository string) (string, error)func ValidateFiles
Section titled “func ValidateFiles”func ValidateFiles(files []File) errorValidateFiles is shared by the Docker materializer and its tests. It rejects traversal, links (represented by callers as non-regular entries), duplicate paths, and modes that could make key material world-readable.
func generationHash
Section titled “func generationHash”func generationHash(config string, knownHosts []string, newKeys map[string][]byte) stringtype Access
Section titled “type Access”type Access struct { ID, Provider, Repository, CredentialID string // Host and Port are only used (and required) when Provider == // CustomProviderID; built-in providers use their registry entry. Host string Port int}type File
Section titled “type File”type File struct { Path string Mode uint32 Data []byte}type KeyMaterial
Section titled “type KeyMaterial”type KeyMaterial struct { Private []byte Public string Fingerprint string}func GenerateKey
Section titled “func GenerateKey”func GenerateKey(comment string) (KeyMaterial, error)func ImportKey
Section titled “func ImportKey”func ImportKey(private []byte, comment string) (KeyMaterial, error)type Manifest
Section titled “type Manifest”type Manifest struct { Generation string Config []byte KnownHosts []byte Keys map[string][]byte}type Materializer
Section titled “type Materializer”Materializer is intentionally narrow: the reconciler owns desired-state decisions while the Docker-backed implementation owns secret-volume writes.
type Materializer interface { Materialize(context.Context, string, Manifest) error}type Provider
Section titled “type Provider”type Provider struct { ID, Host, User string Port int}func ProviderByID
Section titled “func ProviderByID”func ProviderByID(id string) (Provider, bool)type Queue
Section titled “type Queue”Queue coalesces rapid CRUD notifications by full PocketBase user id.
type Queue struct { mu sync.Mutex pending map[string]struct{}}func NewQueue
Section titled “func NewQueue”func NewQueue() *Queuefunc (*Queue) Drain
Section titled “func (*Queue) Drain”func (q *Queue) Drain() []stringfunc (*Queue) Enqueue
Section titled “func (*Queue) Enqueue”func (q *Queue) Enqueue(userID string)type Reconciler
Section titled “type Reconciler”type Reconciler struct { Materializer Materializer}func (*Reconciler) ReconcileUser
Section titled “func (*Reconciler) ReconcileUser”func (r *Reconciler) ReconcileUser(ctx context.Context, app core.App, userID string) errorfunc (*Reconciler) generateKeysForPendingCredentials
Section titled “func (*Reconciler) generateKeysForPendingCredentials”func (r *Reconciler) generateKeysForPendingCredentials(app core.App, userID string) (map[string][]byte, error)func (*Reconciler) linkGeneratedDeployCredentials
Section titled “func (*Reconciler) linkGeneratedDeployCredentials”func (r *Reconciler) linkGeneratedDeployCredentials(app core.App, userID string) errorfunc (*Reconciler) materialize
Section titled “func (*Reconciler) materialize”func (r *Reconciler) materialize(ctx context.Context, app core.App, userID string, newKeys map[string][]byte) errorfunc (*Reconciler) pinCustomHostKeys
Section titled “func (*Reconciler) pinCustomHostKeys”func (r *Reconciler) pinCustomHostKeys(ctx context.Context, app core.App, userID string) errorNever re-probes an already-pinned row: a transient network blip must not look like a changed/MITM host key.
gooseconfig
Section titled “gooseconfig”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/gooseconfig"@pocketcoder-core: Goose Config. Renders config.yaml and keys.env consumed by the c2 goose container.
Package gooseconfig renders PocketBase agent-definition records into Goose’s native config.yaml + keys env file. Pure (no I/O); the hook layer writes the bytes and owns file ownership/permissions.
func RenderConfigYAML
Section titled “func RenderConfigYAML”func RenderConfigYAML(in ConfigInput) ([]byte, error)RenderConfigYAML renders a Goose config.yaml: GOOSE_PROVIDER/MODEL/MODE only. No secrets (they live in keys.env). No extensions (Goose owns that key exclusively — see ConfigInput’s doc comment).
type ConfigInput
Section titled “type ConfigInput”ConfigInput captures the resolved default agent_profile fields needed to render a Goose config.yaml. The hook layer fills this from the default agent_profile; this package stays pure (no I/O, no PB types).
Deliberately does NOT carry tool permissions or extensions: Goose is the sole writer of config.yaml’s `extensions` key (via _goose/unstable/ config/extensions/add, called by hooks.RegisterMcpGatewayExtension). Permission policy is enforced centrally by the ACP coordinator so peer harnesses and Goose share the same PocketBase decision point.
type ConfigInput struct { Provider, Model, Mode string}harnessaccount
Section titled “harnessaccount”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/harnessaccount"Package harnessaccount resolves and selects the OAuth-account side of a user’s harness credentials -- see harness_oauth_accounts, provider_api_keys, and credential_selections in schema.json.
- Constants
- func CanAccess(account *core.Record, userID string) bool
- func RegisterHooks(app core.App)
- func Resolve(app core.App, userID, harnessID, providerID, accountID string) (*core.Record, error)
- func SelectOrCreate(app core.App, userID, harnessID, providerID, accountID, accountName, visibility string) (*core.Record, error)
- func SetSelection(app core.App, userID, harnessID, providerID string, account *core.Record) error
Constants
Section titled “Constants”const ( StatusDisconnected = "disconnected"
VisibilityPersonal = "personal" VisibilityDeployment = "deployment")func CanAccess
Section titled “func CanAccess”func CanAccess(account *core.Record, userID string) boolCanAccess reports whether a PocketBase user may use an account. Personal accounts are owner-only; deployment accounts are available to every authenticated user of this single-owner deployment.
func RegisterHooks
Section titled “func RegisterHooks”func RegisterHooks(app core.App)func Resolve
Section titled “func Resolve”func Resolve(app core.App, userID, harnessID, providerID, accountID string) (*core.Record, error)Resolve returns either an explicitly requested accessible account or the user’s selected OAuth account for (harness, provider). A missing selection, or a selection whose mode isn’t “oauth”, is not an error -- both return (nil, nil).
func SelectOrCreate
Section titled “func SelectOrCreate”func SelectOrCreate(app core.App, userID, harnessID, providerID, accountID, accountName, visibility string) (*core.Record, error)SelectOrCreate selects an existing account or creates the conventional deployment/personal account for this (harness, provider) pair, then records the user’s selection as mode=oauth. visibility must be personal or deployment.
func SetSelection
Section titled “func SetSelection”func SetSelection(app core.App, userID, harnessID, providerID string, account *core.Record) errorSetSelection records mode=oauth with this account for (user, harness, provider). The collection’s unique(user, harness, provider) index enforces the cardinality invariant.
harnessauth
Section titled “harnessauth”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/harnessauth"- Constants
- Variables
- func ActiveAttempt(app core.App, accountID string) (*core.Record, error)
- func CreateAttempt(app core.App, accountID string) (*core.Record, error)
- func LatestAttempt(app core.App, accountID string) (*core.Record, error)
- func ResolveAccountAndAttempt(app core.App, userID, harness, provider, accountID, attemptID string) (*core.Record, *core.Record, error)
- func ResolveAuthenticatorKey(app core.App, account *core.Record) (string, error)
- func StatusForAttempt(attemptStatus string) string
- func UpdateAttempt(app core.App, attempt *core.Record, status, errorText string) error
- func buildClaudeStartCommand(AttemptContext) string
- func buildCodexStartCommand(AttemptContext) string
- func firstMatch(re *regexp.Regexp, text string) string
- func firstURL(text string) string
- func helperContainerName(attemptID string) string
- func helperSubmitContainerName(attemptID string) string
- func isAuthSuccess(logs string) bool
- func newUnknownProviderError(provider string) error
- func parseFailure(logs string) string
- func resolveAuthVolume(ctx context.Context, client *dockerapi.Client, userID, harnessCLI, accountID string) (string, error)
- func scrubLogText(logs string) string
- func validateAttemptContext(attempt AttemptContext) error
- func writeClaudeCode(ctx context.Context, attempt AttemptContext, code string) error
- type AttemptContext
- type AttemptState
- type Authenticator
- type Challenge
- type Runtime
- func NewDefaultRuntime() *Runtime
- func NewRuntime(providers map[string]Authenticator) *Runtime
- func (r *Runtime) Cancel(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)
- func (r *Runtime) Disconnect(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)
- func (r *Runtime) Poll(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)
- func (r *Runtime) Start(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)
- func (r *Runtime) Submit(ctx context.Context, provider string, attempt AttemptContext, code string) (*AttemptState, error)
- func (r *Runtime) provider(provider string) (Authenticator, error)
- type commandAuthenticator
- func (c *commandAuthenticator) Cancel(ctx context.Context, attempt AttemptContext) (*AttemptState, error)
- func (c *commandAuthenticator) Disconnect(ctx context.Context, attempt AttemptContext) (*AttemptState, error)
- func (c *commandAuthenticator) Poll(ctx context.Context, attempt AttemptContext) (*AttemptState, error)
- func (c *commandAuthenticator) Provider() string
- func (c *commandAuthenticator) Start(ctx context.Context, attempt AttemptContext) (*AttemptState, error)
- func (c *commandAuthenticator) Submit(ctx context.Context, attempt AttemptContext, code string) (*AttemptState, error)
- func (c *commandAuthenticator) ensureRunningHelper(ctx context.Context, attempt AttemptContext) error
- func (c *commandAuthenticator) helperLogs(ctx context.Context, attempt AttemptContext) (string, error)
- func (c *commandAuthenticator) stopHelper(ctx context.Context, attemptID string) error
- type unknownProviderError
Constants
Section titled “Constants”const ( ModeAccount = "account" ModeAPIKey = "api_key" ModeNone = "none" StatusDisconnected = "disconnected" StatusConnecting = "connecting" StatusConnected = "connected" StatusError = "error" StatusNeedsAPIKey = "needs_api_key")const ( ProviderCodex = "codex" ProviderClaude = "claude"
ChallengeKindDeviceCode = "device_code" ChallengeKindBrowserCode = "browser_code" ChallengeDestinationBrowser = "browser" ChallengeDestinationApp = "app" ChallengeDestinationNone = "none"
AttemptStatusStarting = "starting" AttemptStatusAwaiting = "awaiting_input" AttemptStatusSucceeded = "succeeded" AttemptStatusFailed = "failed" AttemptStatusExpired = "expired" AttemptStatusCancelled = "cancelled")const ( helperMountPath = harnessvolume.AuthHomeMount helperCodeFile = helperMountPath + "/pocketcoder_claude_auth_code.txt" helperContainerPrefix = "pocketcoder-auth-helper" helperLogTail = 200
selfContainerIDEnv = "HOSTNAME" defaultSelfContainerName = "pocketcoder-pocketbase")Variables
Section titled “Variables”Sentinel errors ResolveAccountAndAttempt returns for the two genuinely “not found” cases, so callers can return a real 404 instead of blanket- converting every error from this function into a 400. Live-confirmed 2026-08-27: internal/api/harness_auth.go’s poll/submit/cancel/authRequest all did `return re.BadRequestError(err.Error(), nil)` unconditionally, so a caller with no account at all got a 400 “account not found” instead of the 404 that both the wording and REST convention call for.
var ( ErrAccountNotFound = errors.New("account not found") ErrAttemptNotFound = errors.New("attempt not found"))var ( errMissingAttemptContext = errors.New("attempt context is incomplete") errMissingHarnessImage = errors.New("attempt context missing harness image")
urlRegex = regexp.MustCompile(`(?i)https?://[^\s"'<>` + "`" + `]+`) ansiEscapeRegex = regexp.MustCompile("\\x1b\\[[0-?]*[ -/]*[@-~]") codexCodeRegex = regexp.MustCompile(`(?i:(?:code|device code|verification code))\s*[:=]?\s*([A-Z0-9]{4,}(?:-[A-Z0-9]{4,})*)`) codexDeviceCodeRegex = regexp.MustCompile(`\b([A-Z0-9]{4,}-[A-Z0-9]{4,})\b`) // Claude can emit several short forms; this is intentionally permissive. claudeCodeRegex = regexp.MustCompile(`(?i)(?:code|verification code|one-time code)\s*[:=]?\s*([A-Za-z0-9_-]{4,})`) expiryRegex = regexp.MustCompile(`(?i)(?:for|in)\s+(\d+\s*(?:second|minute|hour|day|week)s?)`) successRegex = regexp.MustCompile(`(?i)(logged in|login successful|authentication (?:succeeded|successful|complete)|auth(entication)? complete|session ready|connected)`) failureRegex = regexp.MustCompile(`(?i)(error|failed|denied|invalid|expired|timeout|timed out|unable|unable to)`))var ErrAttemptExpired = errors.New("attempt expired")func ActiveAttempt
Section titled “func ActiveAttempt”func ActiveAttempt(app core.App, accountID string) (*core.Record, error)func CreateAttempt
Section titled “func CreateAttempt”func CreateAttempt(app core.App, accountID string) (*core.Record, error)func LatestAttempt
Section titled “func LatestAttempt”func LatestAttempt(app core.App, accountID string) (*core.Record, error)func ResolveAccountAndAttempt
Section titled “func ResolveAccountAndAttempt”func ResolveAccountAndAttempt(app core.App, userID, harness, provider, accountID, attemptID string) (*core.Record, *core.Record, error)func ResolveAuthenticatorKey
Section titled “func ResolveAuthenticatorKey”func ResolveAuthenticatorKey(app core.App, account *core.Record) (string, error)func StatusForAttempt
Section titled “func StatusForAttempt”func StatusForAttempt(attemptStatus string) stringfunc UpdateAttempt
Section titled “func UpdateAttempt”func UpdateAttempt(app core.App, attempt *core.Record, status, errorText string) errorfunc buildClaudeStartCommand
Section titled “func buildClaudeStartCommand”func buildClaudeStartCommand(AttemptContext) stringfunc buildCodexStartCommand
Section titled “func buildCodexStartCommand”func buildCodexStartCommand(AttemptContext) stringfunc firstMatch
Section titled “func firstMatch”func firstMatch(re *regexp.Regexp, text string) stringfunc firstURL
Section titled “func firstURL”func firstURL(text string) stringfunc helperContainerName
Section titled “func helperContainerName”func helperContainerName(attemptID string) stringfunc helperSubmitContainerName
Section titled “func helperSubmitContainerName”func helperSubmitContainerName(attemptID string) stringfunc isAuthSuccess
Section titled “func isAuthSuccess”func isAuthSuccess(logs string) boolfunc newUnknownProviderError
Section titled “func newUnknownProviderError”func newUnknownProviderError(provider string) errorfunc parseFailure
Section titled “func parseFailure”func parseFailure(logs string) stringfunc resolveAuthVolume
Section titled “func resolveAuthVolume”func resolveAuthVolume(ctx context.Context, client *dockerapi.Client, userID, harnessCLI, accountID string) (string, error)func scrubLogText
Section titled “func scrubLogText”func scrubLogText(logs string) stringfunc validateAttemptContext
Section titled “func validateAttemptContext”func validateAttemptContext(attempt AttemptContext) errorfunc writeClaudeCode
Section titled “func writeClaudeCode”func writeClaudeCode(ctx context.Context, attempt AttemptContext, code string) errortype AttemptContext
Section titled “type AttemptContext”type AttemptContext struct { AttemptID string UserID string AccountID string HarnessCLI string HarnessImage string}func BuildAttemptContext
Section titled “func BuildAttemptContext”func BuildAttemptContext(app core.App, attempt *core.Record, userID string) (AttemptContext, error)type AttemptState
Section titled “type AttemptState”AttemptState mirrors the fields persisted in harness_oauth_attempts and is used as an in-memory runtime state before syncing back into PocketBase.
type AttemptState struct { Status string `json:"status"` Challenge *Challenge `json:"challenge,omitempty"` LastError string `json:"lastError,omitempty"`}type Authenticator
Section titled “type Authenticator”Authenticator encapsulates the provider-specific helper lifecycle.
type Authenticator interface { Provider() string Start(context.Context, AttemptContext) (*AttemptState, error) Poll(context.Context, AttemptContext) (*AttemptState, error) Submit(context.Context, AttemptContext, string) (*AttemptState, error) Cancel(context.Context, AttemptContext) (*AttemptState, error) Disconnect(context.Context, AttemptContext) (*AttemptState, error)}func NewClaudeAuthenticator
Section titled “func NewClaudeAuthenticator”func NewClaudeAuthenticator() Authenticatorfunc NewCodexAuthenticator
Section titled “func NewCodexAuthenticator”func NewCodexAuthenticator() Authenticatortype Challenge
Section titled “type Challenge”Challenge is returned to UI layers when a provider requires user action.
type Challenge struct { Type string `json:"type"` Text string `json:"text"` Target string `json:"target,omitempty"` Details string `json:"details,omitempty"` Kind string `json:"kind,omitempty"` VerificationURI string `json:"verificationUri,omitempty"` UserCode string `json:"userCode,omitempty"` CodeDestination string `json:"codeDestination,omitempty"` ExpiresAt string `json:"expiresAt,omitempty"` PollIntervalSeconds int `json:"pollIntervalSeconds,omitempty"`}func parseClaudeChallenge
Section titled “func parseClaudeChallenge”func parseClaudeChallenge(logs string) *Challengefunc parseCodexChallenge
Section titled “func parseCodexChallenge”func parseCodexChallenge(logs string) *Challengetype Runtime
Section titled “type Runtime”Runtime dispatches start/poll/submit/cancel/disconnect calls to provider implementations selected by attempt input.
type Runtime struct { providers map[string]Authenticator}func NewDefaultRuntime
Section titled “func NewDefaultRuntime”func NewDefaultRuntime() *Runtimefunc NewRuntime
Section titled “func NewRuntime”func NewRuntime(providers map[string]Authenticator) *Runtimefunc (*Runtime) Cancel
Section titled “func (*Runtime) Cancel”func (r *Runtime) Cancel(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)func (*Runtime) Disconnect
Section titled “func (*Runtime) Disconnect”func (r *Runtime) Disconnect(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)func (*Runtime) Poll
Section titled “func (*Runtime) Poll”func (r *Runtime) Poll(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)func (*Runtime) Start
Section titled “func (*Runtime) Start”func (r *Runtime) Start(ctx context.Context, provider string, attempt AttemptContext) (*AttemptState, error)func (*Runtime) Submit
Section titled “func (*Runtime) Submit”func (r *Runtime) Submit(ctx context.Context, provider string, attempt AttemptContext, code string) (*AttemptState, error)func (*Runtime) provider
Section titled “func (*Runtime) provider”func (r *Runtime) provider(provider string) (Authenticator, error)type commandAuthenticator
Section titled “type commandAuthenticator”type commandAuthenticator struct { provider string docker *dockerapi.Client startCommandBuilder func(AttemptContext) string parseChallenge func(string) *Challenge submitCode func(context.Context, AttemptContext, string) error}func (*commandAuthenticator) Cancel
Section titled “func (*commandAuthenticator) Cancel”func (c *commandAuthenticator) Cancel(ctx context.Context, attempt AttemptContext) (*AttemptState, error)func (*commandAuthenticator) Disconnect
Section titled “func (*commandAuthenticator) Disconnect”func (c *commandAuthenticator) Disconnect(ctx context.Context, attempt AttemptContext) (*AttemptState, error)func (*commandAuthenticator) Poll
Section titled “func (*commandAuthenticator) Poll”func (c *commandAuthenticator) Poll(ctx context.Context, attempt AttemptContext) (*AttemptState, error)func (*commandAuthenticator) Provider
Section titled “func (*commandAuthenticator) Provider”func (c *commandAuthenticator) Provider() stringfunc (*commandAuthenticator) Start
Section titled “func (*commandAuthenticator) Start”func (c *commandAuthenticator) Start(ctx context.Context, attempt AttemptContext) (*AttemptState, error)func (*commandAuthenticator) Submit
Section titled “func (*commandAuthenticator) Submit”func (c *commandAuthenticator) Submit(ctx context.Context, attempt AttemptContext, code string) (*AttemptState, error)func (*commandAuthenticator) ensureRunningHelper
Section titled “func (*commandAuthenticator) ensureRunningHelper”func (c *commandAuthenticator) ensureRunningHelper(ctx context.Context, attempt AttemptContext) errorfunc (*commandAuthenticator) helperLogs
Section titled “func (*commandAuthenticator) helperLogs”func (c *commandAuthenticator) helperLogs(ctx context.Context, attempt AttemptContext) (string, error)func (*commandAuthenticator) stopHelper
Section titled “func (*commandAuthenticator) stopHelper”func (c *commandAuthenticator) stopHelper(ctx context.Context, attemptID string) errortype unknownProviderError
Section titled “type unknownProviderError”type unknownProviderError struct { provider string}func (unknownProviderError) Error
Section titled “func (unknownProviderError) Error”func (e unknownProviderError) Error() stringharnessvolume
Section titled “harnessvolume”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/harnessvolume"Package harnessvolume owns the deterministic Docker volume names used by dynamically provisioned harnesses and their authentication helpers.
- Constants
- Variables
- func GitSSHVolumeName(base, userID string) (string, error)
- func namespaceOf(base string) (string, error)
- type Names
Constants
Section titled “Constants”const AuthHomeMount = "/workspace/.pocketcoder_auth"GitSSHMount is nested under AuthHomeMount (harness_provision.go sets HOME=AuthHomeMount) so ssh/git find the materialized config at the conventional $HOME/.ssh/config -- no GIT_SSH_COMMAND override needed, and it’s where an agent introspecting “do I have an SSH key” would actually look.
const GitSSHMount = AuthHomeMount + "/.ssh"Variables
Section titled “Variables”var nameComponent = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`)func GitSSHVolumeName
Section titled “func GitSSHVolumeName”func GitSSHVolumeName(base, userID string) (string, error)func namespaceOf
Section titled “func namespaceOf”func namespaceOf(base string) (string, error)type Names
Section titled “type Names”Names describes the durable workspace and authentication storage mounted into a harness container. Workspaces belong to PocketBase users. Login state belongs to a named harness account, which may be shared by multiple users.
type Names struct { Workspace string Auth string GitSSH string}func Resolve
Section titled “func Resolve”func Resolve(base, userID, harnessCLI, accountID string) (Names, error)Resolve derives durable sibling volume names from the generic Compose workspace volume used as this deployment’s namespace. The Compose volume’s trailing “_workspace” is structural rather than part of the namespace.
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/hooks"@pocketcoder-core: Docker Utilities. Shared container restart logic via Docker Socket Proxy.
@pocketcoder-core: Harness Provisioning. Turns a harnesses catalog row into a running, dialable container on demand.
@pocketcoder-core: MCP Hooks. Handles MCP server lifecycle, config rendering, and gateway restart.
@pocketcoder-core: Notification Dispatcher. Sends push notifications based on record events and user presence.
@pocketcoder-core: Timestamp Hooks. Manages created/updated/last_active fields globally.
- Constants
- Variables
- func AddProDataOperations(app core.App, registry *operation.Registry)
- func AddPushOperations(app core.App, registry *operation.Registry)
- func DeleteProDataOperation(userID string) error
- func EnvVarNamesForCredential(edge, provider *core.Record) []string
- func FindHarnessInstance(app core.App, harnessID, launchKey, userID, oauthAccountID string) (*core.Record, error)
- func IsUserOnline(app core.App, userID string) bool
- func MaterializeUserHarnessFiles(ctx context.Context, app core.App, client archiveCopier, instance *core.Record) error
- func McpGatewayHttpServer() *acpsdk.McpServer
- func MemoryMcpServer(accountID, agentProfileID, agentName string) (*acpsdk.McpServer, error)
- func NotifyRunFinished(app core.App, chatID, outcome string) error
- func NotifyRunStarted(app core.App, chatID string) error
- func ProvisionHarnessInstance(ctx context.Context, app core.App, client dockerProvisioner, harnessID, launchKey, userID string) (*core.Record, error)
- func RegisterAgentFileHooks(app core.App)
- func RegisterChatsHarnessPinHook(app core.App)
- func RegisterGitSSHHooks(app core.App, queue *gitssh.Queue)
- func RegisterGlobalTimestamps(app core.App)
- func RegisterHarnessLifecycle(app core.App, client harnessRemover)
- func RegisterLiveActivityHooks(app core.App)
- func RegisterMcpHooks(app core.App)
- func RegisterNotificationHooks(app core.App)
- func ResolveOAuthAccountForLaunch(app core.App, userID, harnessID, providerID string) (*core.Record, error)
- func ResolveWorkspaceVolumeAndNetwork(ctx context.Context, client inspector) (volumeName, networkName string, err error)
- func RestartContainer(containerName string, timeout time.Duration) error
- func SendLiveActivityUpdate(token, fcmToken, userID string, state LiveActivityContentState, version int, event, attributesType string, attributes any) error
- func SendPushNotification(app core.App, userID, title, message, notifType, chatID string) error
- func SendPushNotificationWithExtra(app core.App, userID, title, message, notifType, chatID string, extra map[string]string) error
- func SendPushOperation(app core.App, re *core.RequestEvent) error
- func StartGitSSHReconcileLoop(ctx context.Context, app core.App, queue *gitssh.Queue, reconciler gitSSHReconciler, interval time.Duration) <-chan struct{}
- func StartHarnessWatcher(ctx context.Context, app core.App, client eventSource) <-chan struct{}
- func activeActivities(app core.App, chatID string) ([]*core.Record, error)
- func applyStatus(app core.App, containerName, status string)
- func chatHasAgentSession(app core.App, chatID string) (bool, error)
- func dispatchLiveActivityUpdate(app core.App, activity *core.Record, state LiveActivityContentState) error
- func dispatchToDevices(app core.App, userID, title, message, notifType, chatID string, extra map[string]string) error
- func dockerEventToStatus(action string) string
- func gitRemotesDoc(app core.App, userID string) (string, error)
- func isNotificationTypeEnabled(app core.App, userID, notifType string) bool
- func isRecordNotFound(err error) bool
- func manifestArchive(manifest gitssh.Manifest) ([]byte, error)
- func maybeStartLiveActivities(app core.App, chatID string) error
- func mintSecret() (string, error)
- func ollamaRunning(ctx context.Context, client inspector) (bool, error)
- func providersForLaunch(app core.App, harness *core.Record, providerID string) ([]*core.Record, error)
- func purgeRelayData(userID string) error
- func reconcile(ctx context.Context, app core.App, client eventSource)
- func registerCrudHooks(app core.App, collection string, handler func(*core.RecordEvent) error)
- func relaySecretFor(rootSecret, userID string) string
- func renderAndRestart(prefix string, renderFn func() error, container string, e *core.RecordEvent) error
- func renderEnv(app core.App, envTemplate map[string]string, secret string, harness *core.Record, userID string, providerID string, modelID string) ([]string, error)
- func renderMcpConfig(app core.App) error
- func requireOwner(rec *core.Record) error
- func skillMaterializationRoot(skill *core.Record) (string, error)
- func tarArchive(files map[string]string) (*bytes.Reader, error)
- func validSkillName(name string) bool
- func validateWorkspaceOverride(rec *core.Record) error
- type DockerGitSSHMaterializer
- type FcmRelayProvider
- type LiveActivityContentState
- type NtfyDirectProvider
- type PushProvider
- type archiveCopier
- type dockerProvisioner
- type dockerRemover
- type eventSource
- type gitMaterializerDocker
- type gitSSHReconciler
- type harnessRemover
- type inspector
Constants
Section titled “Constants”const ( mcpGatewayExtensionName = "gateway" mcpGatewayURL = "http://mcp-gateway:8811/mcp" memoryExtensionName = "memory" memoryURL = "http://pocket-memory:8000/mcp" memoryContextHeaderName = "X-PocketCoder-Memory-Context")const ( GatewayContainer = "pocketcoder-mcp-gateway")HarnessEgressNetwork is shared by every harness. A harness being the catalog default must not grant it a different Docker network trust tier.
const HarnessEgressNetwork = "pocketcoder-harness-egress"LiveActivityAttributesType is the exact ActivityAttributes Swift type name the future widget extension must declare -- fixed here as part of the wire contract between server and client.
const LiveActivityAttributesType = "PocketCoderChatActivityAttributes"const MaxConcurrentLiveActivities = 5ModelNetwork is a compose-pinned name rather than a database value. Every dynamically provisioned peer joins it during the initial Docker create call so it can reach the local Ollama service -- but only when Ollama is actually running (see ollamaRunning): the compose file’s own `ollama` service is gated behind the `local-models` profile, off by default, and Docker Compose never creates a network unless at least one active service references it. Unconditionally requesting this network on every harness create failed 100% of default (no-local-models) deployments -- confirmed live: `failed to set up container networking: network pocketcoder-model not found`, leaving every harness container stuck at Created, never started.
const ModelNetwork = "pocketcoder-model"const defaultDockerHost = "tcp://docker-socket-proxy-write:2375"const ( // mcpDockerHost is the compose-pinned address of the socket proxy scoped // for mcp-gateway's own use (docker-compose.yml's docker-socket-proxy-mcp // service, NETWORKS=1 for per-session isolation) -- deliberately not the // same proxy PocketBase itself talks to (docker-socket-proxy-write). See // renderMcpConfig's DOCKER_HOST injection below for why this has to be // written into each approved server's catalog entry rather than read // from this process's own env. mcpDockerHost = "tcp://docker-socket-proxy-mcp:2375")ollamaContainerName mirrors ollama.ollamaContainerName (unexported in that package) -- both are the same compose-pinned container_name, kept as a local constant here rather than an import to avoid a dependency this package otherwise has no reason to take on.
const ollamaContainerName = "pocketcoder-ollama"const selfContainerName = "pocketcoder-pocketbase"const workspaceRoot = "/workspace" // duplicated from internal/api/profile.go's identical check deliberately — these are two different packages and this hook must not import internal/apiVariables
Section titled “Variables”var ensureReleaseHarnessImage = func(ctx context.Context, client dockerProvisioner, harnessID, image string) error { return releaseartifact.EnsureHarnessImage(ctx, client, harnessID, image)}mcpConfigDir is a var, not a const, so tests can point renderMcpConfig at a t.TempDir() instead of the real /mcp_config volume.
var mcpConfigDir = "/mcp_config"raceHookForTests, when non-nil, is invoked by ProvisionHarnessInstance immediately before it saves its own pending harness_instances row solely so a test can deterministically simulate another caller’s row landing first for the same (harness, launch_key) pair, reproducing the unique-index race the Save-error branch below handles. Always nil outside tests.
var raceHookForTests func()func AddProDataOperations
Section titled “func AddProDataOperations”func AddProDataOperations(app core.App, registry *operation.Registry)func AddPushOperations
Section titled “func AddPushOperations”func AddPushOperations(app core.App, registry *operation.Registry)func DeleteProDataOperation
Section titled “func DeleteProDataOperation”func DeleteProDataOperation(userID string) errorDeleteProDataOperation never touches this deployment’s own local PocketBase data -- only push-relay’s D1 rows and the RevenueCat customer record. userID always comes from the caller’s own auth token, never a request parameter.
func EnvVarNamesForCredential
Section titled “func EnvVarNamesForCredential”func EnvVarNamesForCredential(edge, provider *core.Record) []stringEnvVarNamesForCredential returns every env var name a provider_api_keys value should be delivered under: harness_providers.api_key_env_override if set (an escape hatch for a harness reading a nonstandard name), else every name providers.api_key_envs lists.
func FindHarnessInstance
Section titled “func FindHarnessInstance”func FindHarnessInstance(app core.App, harnessID, launchKey, userID, oauthAccountID string) (*core.Record, error)FindHarnessInstance looks up the harness_instances row for (harness, oauth account, launchKey) scoped to a user. oauth_account and launch_key are both matched in Go, not in the PocketBase filter: an empty string for either is the common case (an API-key-only launch has no oauth_account; every supports_live_config harness has no launch_key), and PocketBase’s filter evaluator does not reliably match an empty-string field value inside an `&&` expression. Exported so internal/sessionprofile’s sessionprofile.Build can share this exact lookup instead of maintaining its own copy of the same workaround.
func IsUserOnline
Section titled “func IsUserOnline”func IsUserOnline(app core.App, userID string) boolIsUserOnline checks if the user has an active Realtime (SSE) connection.
func MaterializeUserHarnessFiles
Section titled “func MaterializeUserHarnessFiles”func MaterializeUserHarnessFiles(ctx context.Context, app core.App, client archiveCopier, instance *core.Record) errorMaterializeUserHarnessFiles copies PocketBase-owned skills and the user’s default prompt into a running harness container. The container’s workspace is already a user-scoped Docker volume; Docker’s archive API writes into it without granting PocketBase exec access.
func McpGatewayHttpServer
Section titled “func McpGatewayHttpServer”func McpGatewayHttpServer() *acpsdk.McpServerMcpGatewayHttpServer returns the gateway in the standard ACP shape used by every harness’s session/new request.
func MemoryMcpServer
Section titled “func MemoryMcpServer”func MemoryMcpServer(accountID, agentProfileID, agentName string) (*acpsdk.McpServer, error)MemoryMcpServer returns the account/profile-attributed memory service in the same standard ACP shape used by every harness session.
func NotifyRunFinished
Section titled “func NotifyRunFinished”func NotifyRunFinished(app core.App, chatID, outcome string) errorfunc NotifyRunStarted
Section titled “func NotifyRunStarted”func NotifyRunStarted(app core.App, chatID string) errorfunc ProvisionHarnessInstance
Section titled “func ProvisionHarnessInstance”func ProvisionHarnessInstance(ctx context.Context, app core.App, client dockerProvisioner, harnessID, launchKey, userID string) (*core.Record, error)ProvisionHarnessInstance turns a harnesses catalog row into a running, dialable container idempotent per (harnessID, oauthAccountID, launchKey, userID), minting a per-instance secret, rendering launch_template.env_template against the user’s resolved provider credentials, ensuring the release image, and creating+starting the container.
func RegisterAgentFileHooks
Section titled “func RegisterAgentFileHooks”func RegisterAgentFileHooks(app core.App)RegisterAgentFileHooks refreshes every running harness for a user whenever PocketBase-owned prompt, profile, or skill content changes.
func RegisterChatsHarnessPinHook
Section titled “func RegisterChatsHarnessPinHook”func RegisterChatsHarnessPinHook(app core.App)RegisterChatsHarnessPinHook registers a fast-fail UX check for two of the design spec’s §5.6/§5.8 invariants. It is NOT the source of truth for either — establishSession’s own check (coordinator package) is what actually prevents a mismatched dial. Uses the non-Request hook variants specifically (per hooks/timestamps.go’s precedent) so backend app.Save calls — including the agent role’s own writes — are not skipped.
func RegisterGitSSHHooks
Section titled “func RegisterGitSSHHooks”func RegisterGitSSHHooks(app core.App, queue *gitssh.Queue)func RegisterGlobalTimestamps
Section titled “func RegisterGlobalTimestamps”func RegisterGlobalTimestamps(app core.App)RegisterGlobalTimestamps registers hooks for created, updated, and last_active timestamps.
func RegisterHarnessLifecycle
Section titled “func RegisterHarnessLifecycle”func RegisterHarnessLifecycle(app core.App, client harnessRemover)RegisterHarnessLifecycle installs the owner for managed harness cleanup. Stopped and failed containers are retained briefly for diagnostics, then their Docker container and harness_instances row are reclaimed. A running instance is never removed by this job; last_used is refreshed by profile resolution and is the future extension point for idle-running reaping.
func RegisterLiveActivityHooks
Section titled “func RegisterLiveActivityHooks”func RegisterLiveActivityHooks(app core.App)func RegisterMcpHooks
Section titled “func RegisterMcpHooks”func RegisterMcpHooks(app core.App)RegisterMcpHooks registers hooks for MCP server lifecycle management. When a user approves or revokes an MCP server in the Flutter UI, this hook re-renders the gateway config and restarts the MCP gateway container. The interface receives status updates via PocketBase realtime subscriptions.
func RegisterNotificationHooks
Section titled “func RegisterNotificationHooks”func RegisterNotificationHooks(app core.App)RegisterNotificationHooks registers hooks for triggering push notifications and the /api/push custom endpoint.
func ResolveOAuthAccountForLaunch
Section titled “func ResolveOAuthAccountForLaunch”func ResolveOAuthAccountForLaunch(app core.App, userID, harnessID, providerID string) (*core.Record, error)func ResolveWorkspaceVolumeAndNetwork
Section titled “func ResolveWorkspaceVolumeAndNetwork”func ResolveWorkspaceVolumeAndNetwork(ctx context.Context, client inspector) (volumeName, networkName string, err error)ResolveWorkspaceVolumeAndNetwork finds the real, possibly compose-project- prefixed names of the shared workspace volume and agent network by inspecting PocketBase’s own container by inspecting the mount destination and network-name suffix, not by guessing a prefix.
func RestartContainer
Section titled “func RestartContainer”func RestartContainer(containerName string, timeout time.Duration) errorRestartContainer sends a restart command to the named container via the Docker Socket Proxy.
func SendLiveActivityUpdate
Section titled “func SendLiveActivityUpdate”func SendLiveActivityUpdate(token, fcmToken, userID string, state LiveActivityContentState, version int, event, attributesType string, attributes any) errorSendLiveActivityUpdate posts the live-activity payload directly to push-relay. fcmToken is the device’s normal FCM registration token (devices.push_token) -- FCM’s v1 API requires it alongside the activity’s own push token in the same request to deliver an ActivityKit update (see the push-relay Worker’s push_type == “live_activity” branch).
func SendPushNotification
Section titled “func SendPushNotification”func SendPushNotification(app core.App, userID, title, message, notifType, chatID string) errorSendPushNotification is the unified dispatch function. Flow: rules check -> presence check -> device dispatch
func SendPushNotificationWithExtra
Section titled “func SendPushNotificationWithExtra”func SendPushNotificationWithExtra(app core.App, userID, title, message, notifType, chatID string, extra map[string]string) errorSendPushNotificationWithExtra is SendPushNotification plus structured type-specific data (e.g. a pending permission’s request_id and offered options) merged into the outgoing payload -- see PushProvider.Send.
func SendPushOperation
Section titled “func SendPushOperation”func SendPushOperation(app core.App, re *core.RequestEvent) errorfunc StartGitSSHReconcileLoop
Section titled “func StartGitSSHReconcileLoop”func StartGitSSHReconcileLoop(ctx context.Context, app core.App, queue *gitssh.Queue, reconciler gitSSHReconciler, interval time.Duration) <-chan struct{}A user’s reconcile error never blocks another user or the next tick -- their next enqueue simply retries.
func StartHarnessWatcher
Section titled “func StartHarnessWatcher”func StartHarnessWatcher(ctx context.Context, app core.App, client eventSource) <-chan struct{}StartHarnessWatcher subscribes to the Docker event stream BEFORE running the startup reconciliation sweep — deliberately, so a container that changes state in the gap between the sweep’s snapshot and the subscription taking effect isn’t missed (§5.3). It keeps harness_instances.status in sync with real container state for the lifetime of ctx and never touches a managed = false row (the compose-managed default Goose instance).
It returns a “done” channel that is closed once the watcher’s loop has fully exited (after observing ctx.Done() or the events channel closing), so a caller tearing down the app on shutdown can wait for any in-flight applyStatus/reconcile Save call to finish before the DB is torn down — mirroring how internal/api/agent.go’s OnTerminate handler blocks (bounded by a timeout) until its own goroutine confirms shutdown.
func activeActivities
Section titled “func activeActivities”func activeActivities(app core.App, chatID string) ([]*core.Record, error)func applyStatus
Section titled “func applyStatus”func applyStatus(app core.App, containerName, status string)func chatHasAgentSession
Section titled “func chatHasAgentSession”func chatHasAgentSession(app core.App, chatID string) (bool, error)func dispatchLiveActivityUpdate
Section titled “func dispatchLiveActivityUpdate”func dispatchLiveActivityUpdate(app core.App, activity *core.Record, state LiveActivityContentState) errorfunc dispatchToDevices
Section titled “func dispatchToDevices”func dispatchToDevices(app core.App, userID, title, message, notifType, chatID string, extra map[string]string) errordispatchToDevices sends notifications to every active device registered to the user.
func dockerEventToStatus
Section titled “func dockerEventToStatus”func dockerEventToStatus(action string) stringfunc gitRemotesDoc
Section titled “func gitRemotesDoc”func gitRemotesDoc(app core.App, userID string) (string, error)gitRemotesDoc only includes “ready” access -- pending/error rows have no usable credential materialized yet.
func isNotificationTypeEnabled
Section titled “func isNotificationTypeEnabled”func isNotificationTypeEnabled(app core.App, userID, notifType string) boolisNotificationTypeEnabled checks the user’s notification_rules record. Returns true if the type is enabled or if no rules exist (opt-out model).
func isRecordNotFound
Section titled “func isRecordNotFound”func isRecordNotFound(err error) boolisRecordNotFound reports whether err is PocketBase’s “record not found” signal (FindRecordById/FindFirstRecordByFilter both return sql.ErrNoRows verbatim -- see dbx.SelectQuery.One and core.FindFirstRecordByFilter), as opposed to any other DB/lookup failure, which callers must treat as a hard error rather than “nothing selected”.
func manifestArchive
Section titled “func manifestArchive”func manifestArchive(manifest gitssh.Manifest) ([]byte, error)Layout must match what cmd/git-materializer expects under /inbox/manifest.tar.
func maybeStartLiveActivities
Section titled “func maybeStartLiveActivities”func maybeStartLiveActivities(app core.App, chatID string) errorfunc mintSecret
Section titled “func mintSecret”func mintSecret() (string, error)mintSecret generates the per-instance credential the bundled adapter enforces on its WS upgrade (.4.1) this, not an empty string, is what populates Target.Secret once this row is resolved.
func ollamaRunning
Section titled “func ollamaRunning”func ollamaRunning(ctx context.Context, client inspector) (bool, error)ollamaRunning reports whether the local Ollama service is actually up, used to decide whether a harness should request ModelNetwork at all. Deliberately checked via Inspect (CONTAINERS=1 on docker-socket-proxy- write) rather than a network-existence call: that proxy has NETWORKS=0 set deliberately (“PocketBase’s own proxy… only ever restarts/ inspects containers it already trusts” -- see docker-compose.yml), so a direct network inspect would be rejected by the proxy itself.
func providersForLaunch
Section titled “func providersForLaunch”func providersForLaunch(app core.App, harness *core.Record, providerID string) ([]*core.Record, error)func purgeRelayData
Section titled “func purgeRelayData”func purgeRelayData(userID string) errorpurgeRelayData tells push-relay to delete this user’s D1 rows (relay_bindings, push_quota) and RevenueCat customer record. Unlike the notification-send path, this is NOT best-effort: there is no local fallback state here, so a failed purge must be reported as a failed deletion rather than silently swallowed.
func reconcile
Section titled “func reconcile”func reconcile(ctx context.Context, app core.App, client eventSource)func registerCrudHooks
Section titled “func registerCrudHooks”func registerCrudHooks(app core.App, collection string, handler func(*core.RecordEvent) error)registerCrudHooks binds the same handler to Create, Update, and Delete success events.
func relaySecretFor
Section titled “func relaySecretFor”func relaySecretFor(rootSecret, userID string) stringrelaySecretFor derives a per-user relay secret from this deployment’s shared PN_RELAY_SECRET, so push-relay’s tenant-binding check (workers/push-relay’s checkTenantBinding) sees a distinct secret_hash per PocketBase account instead of one shared value every account on this deployment would otherwise collide on. Forging a valid secret for an arbitrary userID still requires knowing this deployment’s real rootSecret -- see the plan’s Background section for the honest before/after accounting of what this does and doesn’t change about the binding’s anti-spoofing property.
func renderAndRestart
Section titled “func renderAndRestart”func renderAndRestart(prefix string, renderFn func() error, container string, e *core.RecordEvent) errorrenderAndRestart runs a config render function and restarts the given container. On render failure it logs and continues the hook chain without restarting.
func renderEnv
Section titled “func renderEnv”func renderEnv(app core.App, envTemplate map[string]string, secret string, harness *core.Record, userID string, providerID string, modelID string) ([]string, error)renderEnv builds a harness container’s env, following the single resolution path spec §6 describes: for every provider this launch may use (its harness_providers edges, filtered to the one pinned edge matching providerID when the harness is NOT supports_live_config), resolve the user’s credential for that provider -- defaulting to a connected OAuth account before an API key when there is no explicit credential_selections row (spec §6’s stated default-preference order) -- and merge. An OAuth-mode provider contributes no env vars (the credential lives on the mounted auth-home volume, resolved separately by ProvisionHarnessInstance before this function is even called). There is no branch on harness identity, and no branch on provider_fanout, anywhere in this function -- provider_fanout is a sync-time-only concept internal_modelcatalog owns; the field this function actually branches on is supports_live_config.
func renderMcpConfig
Section titled “func renderMcpConfig”func renderMcpConfig(app core.App) errorrenderMcpConfig queries approved MCP servers and writes docker-mcp.yaml and mcp.env to the shared /mcp_config volume. The gateway reads these on startup.
func requireOwner
Section titled “func requireOwner”func requireOwner(rec *core.Record) errorfunc skillMaterializationRoot
Section titled “func skillMaterializationRoot”func skillMaterializationRoot(skill *core.Record) (string, error)func tarArchive
Section titled “func tarArchive”func tarArchive(files map[string]string) (*bytes.Reader, error)func validSkillName
Section titled “func validSkillName”func validSkillName(name string) boolfunc validateWorkspaceOverride
Section titled “func validateWorkspaceOverride”func validateWorkspaceOverride(rec *core.Record) errortype DockerGitSSHMaterializer
Section titled “type DockerGitSSHMaterializer”type DockerGitSSHMaterializer struct { Client gitMaterializerDocker}func (DockerGitSSHMaterializer) Materialize
Section titled “func (DockerGitSSHMaterializer) Materialize”func (m DockerGitSSHMaterializer) Materialize(ctx context.Context, userID string, manifest gitssh.Manifest) errortype FcmRelayProvider
Section titled “type FcmRelayProvider”FcmRelayProvider routes notifications through a Cloudflare Worker relay. The Worker handles subscription verification (RevenueCat), rate limiting (Supabase), and FCM v1 delivery — PocketBase just fires and forgets.
type FcmRelayProvider struct { RelayURL string UserID string ChatID string Type string}func (*FcmRelayProvider) Send
Section titled “func (*FcmRelayProvider) Send”func (p *FcmRelayProvider) Send(token, title, body string, extra map[string]string) errortype LiveActivityContentState
Section titled “type LiveActivityContentState”type LiveActivityContentState struct { Status string `json:"status"` Title string `json:"title"` UpdatedAt int64 `json:"updated_at"`}type NtfyDirectProvider
Section titled “type NtfyDirectProvider”NtfyDirectProvider sends notifications directly to a UnifiedPush (ntfy) endpoint. This preserves the “Zero-Trust” sovereign architecture.
type NtfyDirectProvider struct { ChatID string Type string}func (*NtfyDirectProvider) Send
Section titled “func (*NtfyDirectProvider) Send”func (p *NtfyDirectProvider) Send(endpoint, title, body string, extra map[string]string) errorextra is ignored here: ntfy’s direct path has no structured-action support yet -- that’s out of scope for this slice.
type PushProvider
Section titled “type PushProvider”PushProvider defines the interface for different notification services. extra carries notification-type-specific structured data (e.g. a pending permission’s request_id and offered options) that a provider merges into its payload if it can; a provider with no such support just ignores it.
type PushProvider interface { Send(token, title, body string, extra map[string]string) error}type archiveCopier
Section titled “type archiveCopier”archiveCopier is intentionally smaller than dockerapi.Client so the materializer remains unit-testable without a Docker daemon.
type archiveCopier interface { CopyArchive(context.Context, string, string, io.Reader) error}var _ archiveCopier = (*dockerapi.Client)(nil)type dockerProvisioner
Section titled “type dockerProvisioner”dockerProvisioner is the subset of *dockerapi.Client ProvisionHarnessInstance needs satisfied by the real client and by a test double.
type dockerProvisioner interface { inspector ImageExists(ctx context.Context, image string) (bool, error) PullImage(ctx context.Context, image string) error LoadImage(ctx context.Context, archive io.Reader) error Create(ctx context.Context, name string, spec dockerapi.CreateSpec) (string, error) Start(ctx context.Context, containerName string) error}type dockerRemover
Section titled “type dockerRemover”type dockerRemover interface { Remove(context.Context, string) error}type eventSource
Section titled “type eventSource”eventSource is the subset of *dockerapi.Client the watcher depends on, narrowed so tests can substitute a fake.
type eventSource interface { Events(ctx context.Context) (<-chan dockerapi.Event, error) ListAll(ctx context.Context) ([]dockerapi.ContainerSummary, error)}type gitMaterializerDocker
Section titled “type gitMaterializerDocker”type gitMaterializerDocker interface { inspector Create(ctx context.Context, name string, spec dockerapi.CreateSpec) (string, error) CopyArchive(ctx context.Context, containerName, destination string, archive io.Reader) error Start(ctx context.Context, containerName string) error Remove(ctx context.Context, containerName string) error}type gitSSHReconciler
Section titled “type gitSSHReconciler”type gitSSHReconciler interface { ReconcileUser(ctx context.Context, app core.App, userID string) error}type harnessRemover
Section titled “type harnessRemover”type harnessRemover interface { Remove(context.Context, string) error}type inspector
Section titled “type inspector”inspector is the minimal interface ResolveWorkspaceVolumeAndNetwork needs
satisfied by *dockerapi.Client, and by a small test double.type inspector interface { Inspect(ctx context.Context, containerName string) (dockerapi.ContainerInspect, error)}mcpserver
Section titled “mcpserver”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/mcpserver"Package mcpserver contains the MCP server request use case.
- func ResolveImageDigest(ctx context.Context, name, image string) (string, error)
- func normalizeImageRef(name, image string) string
- func requestServerError(kind RequestServerErrorKind, format string, args …any) error
- type ImageResolver
- type Request
- type RequestServerError
- type RequestServerErrorKind
- type Result
- type Store
func ResolveImageDigest
Section titled “func ResolveImageDigest”func ResolveImageDigest(ctx context.Context, name, image string) (string, error)func normalizeImageRef
Section titled “func normalizeImageRef”func normalizeImageRef(name, image string) stringfunc requestServerError
Section titled “func requestServerError”func requestServerError(kind RequestServerErrorKind, format string, args ...any) errortype ImageResolver
Section titled “type ImageResolver”type ImageResolver func(context.Context, string, string) (string, error)type Request
Section titled “type Request”type Request struct { ServerName string `json:"server_name"` Reason string `json:"reason"` SessionID string `json:"session_id"` Image string `json:"image"` ConfigSchema map[string]any `json:"config_schema"`}type RequestServerError
Section titled “type RequestServerError”type RequestServerError struct { Kind RequestServerErrorKind Err error}func (*RequestServerError) Error
Section titled “func (*RequestServerError) Error”func (e *RequestServerError) Error() stringfunc (*RequestServerError) Unwrap
Section titled “func (*RequestServerError) Unwrap”func (e *RequestServerError) Unwrap() errortype RequestServerErrorKind
Section titled “type RequestServerErrorKind”type RequestServerErrorKind intconst ( ErrKindInternal RequestServerErrorKind = iota ErrKindInvalidRequest ErrKindImageResolution ErrKindSaveSync ErrKindSaveCreate)type Result
Section titled “type Result”type Result struct { ID string Status string Synced bool}func RequestServer
Section titled “func RequestServer”func RequestServer(ctx context.Context, store Store, resolve ImageResolver, req Request) (Result, error)type Store
Section titled “type Store”type Store interface { FindCollectionByNameOrId(nameOrId string) (*core.Collection, error) FindRecordsByFilter(collectionModelOrIdentifier any, filter, sort string, limit, offset int, params ...dbx.Params) ([]*core.Record, error) Save(core.Model) error}modelcatalog
Section titled “modelcatalog”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/modelcatalog"@pocketcoder-core: Model Catalog Sync. Both Goose and OpenCode build their own provider/model catalogs from models.dev at runtime or compile time, so it’s the natural shared source of truth for PocketCoder’s own “providers”, “models”, and “harness_models” catalog rows -- rather than requiring an admin to hand-populate them, or PocketCoder guessing an API key’s env var name by naively uppercasing a provider id (wrong for e.g. Google, which accepts GOOGLE_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, or GEMINI_API_KEY -- this package keeps and injects all three instead of guessing which one a given harness actually reads).
Sync is strictly additive: it only ever creates or updates rows, never deletes. A model or provider disappearing upstream must not cascade into deleting a harness_models row a user’s chat.harness_model_override still points at -- a stale row lingering forever is harmless; deleting it out from under existing user data is not.
- Constants
- Variables
- func Fetch(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)
- func RegisterCredentialHooks(app core.App, client *http.Client, url string)
- func RegisterSync(app core.App)
- func Sync(ctx context.Context, app core.App, client *http.Client, url string) error
- func SyncProviderForFanoutHarnesses(ctx context.Context, app core.App, client *http.Client, url string, providerID string) error
- func fetchAndCache(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)
- func fetchCached(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)
- func harnessModelID(harness *core.Record, providerID, modelID string) string
- func keyedProviderIDs(app core.App) (map[string]bool, error)
- func recordUnchanged(rec *core.Record, fields map[string]any) bool
- func syncHarnessProvider(txApp core.App, h, providerRec *core.Record, p ProviderInfo, syncModels bool)
- func upsertHarnessModel(app core.App, harness, model *core.Record, harnessModelID string) error
- func upsertHarnessProviderEdge(app core.App, harness, provider *core.Record) error
- func upsertModel(app core.App, providerRec *core.Record, p ProviderInfo, m ModelInfo) (*core.Record, error)
- func upsertProvider(app core.App, p ProviderInfo) error
- type ModelInfo
- type ProviderInfo
- type rawCatalog
- type rawModel
- type rawProvider
Constants
Section titled “Constants”DefaultCatalogURL is models.dev’s published catalog endpoint -- the same one OpenCode fetches at startup and Goose’s Canonical Model Registry is compiled from.
const DefaultCatalogURL = "https://models.dev/api.json"cronJobID is the app.Cron() job name for the periodic resync.
const cronJobID = "pocketcoder-model-catalog-sync"const opencodeCliID = "opencode"syncEvery6Hours runs the resync at :00 past every 6th hour.
const syncEvery6Hours = "0 */6 * * *"Variables
Section titled “Variables”var ( catalogCacheMu sync.RWMutex catalogCache = map[string]map[string]ProviderInfo{})func Fetch
Section titled “func Fetch”func Fetch(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)Fetch retrieves and parses the models.dev provider catalog from url.
func RegisterCredentialHooks
Section titled “func RegisterCredentialHooks”func RegisterCredentialHooks(app core.App, client *http.Client, url string)func RegisterSync
Section titled “func RegisterSync”func RegisterSync(app core.App)RegisterSync runs Sync once eagerly (detached: a slow or unreachable models.dev must never block startup) and schedules a resync every 6 hours via app.Cron(), mirroring internal/schedule’s own Cron().Add usage. Call once from main’s OnServe, after the app is otherwise ready to accept the resulting Saves.
func Sync
Section titled “func Sync”func Sync(ctx context.Context, app core.App, client *http.Client, url string) errorSync fetches the catalog from url and upserts PocketCoder’s own catalog collections from it:
- providers: every fetched provider, so the Provider Keys screen always has an up-to-date list to build its provider dropdown from.
- models + harness_models: for each harnesses row, either its pinned harness_providers edge (provider_fanout == false) or every fetched provider (provider_fanout == true, e.g. Goose/OpenCode -- both already let a user pick from models.dev’s full catalog themselves, so there is no principled place to cut it down; the resulting few thousand rows are trivial for SQLite, and the client’s own picker is expected to offer search/filtering rather than PocketCoder pre-curating the list). A self-scoped harness with no harness_providers edge is left untouched -- nothing to sync it from.
A single malformed upstream row is logged and skipped, not fatal to the rest of the sync: models.dev is an external, community-edited registry, and one bad entry must not leave every provider after it (in nondeterministic map-iteration order) unsynced. ctx is checked between each unit of work so a cancelled sync actually stops promptly instead of grinding through the full catalog regardless.
func SyncProviderForFanoutHarnesses
Section titled “func SyncProviderForFanoutHarnesses”func SyncProviderForFanoutHarnesses(ctx context.Context, app core.App, client *http.Client, url string, providerID string) errorfunc fetchAndCache
Section titled “func fetchAndCache”func fetchAndCache(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)func fetchCached
Section titled “func fetchCached”func fetchCached(ctx context.Context, client *http.Client, url string) (map[string]ProviderInfo, error)func harnessModelID
Section titled “func harnessModelID”func harnessModelID(harness *core.Record, providerID, modelID string) stringharnessModelID computes the model identifier a given harness’s ACP session/set_config_option call actually needs. OpenCode always addresses a model as “<providerID>/<modelID>”; other harnesses use the bare models.dev id directly.
func keyedProviderIDs
Section titled “func keyedProviderIDs”func keyedProviderIDs(app core.App) (map[string]bool, error)keyedProviderIDs is unscoped by owner: a deployment belongs to exactly one user.
func recordUnchanged
Section titled “func recordUnchanged”func recordUnchanged(rec *core.Record, fields map[string]any) boolrecordUnchanged reports whether every (key, value) in fields already matches rec’s current stored value, so upsert* can skip a no-op Save. With curation removed, a full sync now touches several thousand rows; unconditionally re-Saving all of them on every run (startup + every 6h) would mean that many writes against SQLite’s single writer for no reason on every sync where models.dev simply hasn’t changed.
Comparison goes through json.Marshal rather than fmt.Sprintf(“%v”, …): a freshly computed Go value (e.g. int(1000000)) and the same value fetched back from PocketBase’s storage layer (e.g. float64(1000000) for a “number” field) format completely differently under %v (“1000000” vs “1e+06”), which made this always report “changed” for numeric and JSON fields specifically -- json.Marshal normalizes both to the same bytes regardless of which concrete Go type carries the value.
func syncHarnessProvider
Section titled “func syncHarnessProvider”func syncHarnessProvider(txApp core.App, h, providerRec *core.Record, p ProviderInfo, syncModels bool)func upsertHarnessModel
Section titled “func upsertHarnessModel”func upsertHarnessModel(app core.App, harness, model *core.Record, harnessModelID string) errorfunc upsertHarnessProviderEdge
Section titled “func upsertHarnessProviderEdge”func upsertHarnessProviderEdge(app core.App, harness, provider *core.Record) errorfunc upsertModel
Section titled “func upsertModel”func upsertModel(app core.App, providerRec *core.Record, p ProviderInfo, m ModelInfo) (*core.Record, error)func upsertProvider
Section titled “func upsertProvider”func upsertProvider(app core.App, p ProviderInfo) errortype ModelInfo
Section titled “type ModelInfo”ModelInfo is the trimmed shape of one models.dev model entry.
type ModelInfo struct { ID string Name string Description string ContextWindow int}type ProviderInfo
Section titled “type ProviderInfo”ProviderInfo is the trimmed shape of one models.dev provider entry -- only the fields PocketCoder actually needs, decoded defensively so unrelated upstream schema growth (pricing, capability flags, etc.) never breaks this sync.
type ProviderInfo struct { ID string Name string // APIKeyEnvs lists every env var name models.dev says this provider's // SDK accepts (its raw "env" array), e.g. Google's three alternates. // Which one a given *harness* actually reads is not something // models.dev encodes -- renderEnv (harness_provision.go) sets all of // them to the same value rather than guess a single "the" name. APIKeyEnvs []string Models map[string]ModelInfo}func (ProviderInfo) PrimaryAPIKeyEnv
Section titled “func (ProviderInfo) PrimaryAPIKeyEnv”func (p ProviderInfo) PrimaryAPIKeyEnv() stringPrimaryAPIKeyEnv is APIKeyEnvs[0] (models.dev’s own preferred name), empty if the provider declares no env var at all (e.g. a local-only backend like Ollama or a project-scoped credential like Vertex).
type rawCatalog
Section titled “type rawCatalog”type rawCatalog map[string]rawProvidertype rawModel
Section titled “type rawModel”type rawModel struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Limit struct { Context int `json:"context"` } `json:"limit"`}type rawProvider
Section titled “type rawProvider”type rawProvider struct { ID string `json:"id"` Name string `json:"name"` Env []string `json:"env"` Models map[string]rawModel `json:"models"`}ollama
Section titled “ollama”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/ollama"Package ollama contains the Ollama runtime control logic: tag listing, model-install checks, and container lifecycle management.
- Constants
- Variables
- func EnsureRuntime(ctx context.Context, docker Docker, client *http.Client, cfg Config, acquire ReleaseImageAcquirer, runtimeMu *sync.Mutex) error
- func HTTPClient() *http.Client
- func ModelInstalled(ctx context.Context, client *http.Client, baseURL, name string) (bool, error)
- func ModelNameValid(name string) bool
- func ResolveBaseURL() string
- func ResolveRelease() string
- func StreamingHTTPClient() *http.Client
- func WaitForReady(ctx context.Context, client *http.Client, baseURL string) error
- type Config
- type Docker
- type Model
- type ReleaseImageAcquirer
- type tagsResponse
Constants
Section titled “Constants”const DefaultURL = "http://ollama:11434"const ollamaContainerName = "pocketcoder-ollama"const ollamaModelsVolumeName = "pocketcoder_ollama_models"Variables
Section titled “Variables”var modelName = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._/-]*(?::[A-Za-z0-9][A-Za-z0-9._-]*)?$`)func EnsureRuntime
Section titled “func EnsureRuntime”func EnsureRuntime(ctx context.Context, docker Docker, client *http.Client, cfg Config, acquire ReleaseImageAcquirer, runtimeMu *sync.Mutex) errorfunc HTTPClient
Section titled “func HTTPClient”func HTTPClient() *http.Clientfunc ModelInstalled
Section titled “func ModelInstalled”func ModelInstalled(ctx context.Context, client *http.Client, baseURL, name string) (bool, error)func ModelNameValid
Section titled “func ModelNameValid”func ModelNameValid(name string) boolfunc ResolveBaseURL
Section titled “func ResolveBaseURL”func ResolveBaseURL() stringfunc ResolveRelease
Section titled “func ResolveRelease”func ResolveRelease() stringResolveRelease reads POCKETCODER_RELEASE once. Empty or “development” selects the local-models runtime path in EnsureRuntime.
func StreamingHTTPClient
Section titled “func StreamingHTTPClient”func StreamingHTTPClient() *http.Clientfunc WaitForReady
Section titled “func WaitForReady”func WaitForReady(ctx context.Context, client *http.Client, baseURL string) errortype Config
Section titled “type Config”type Config struct { BaseURL string Release string}type Docker
Section titled “type Docker”type Docker interface { releaseartifact.DockerLoader Inspect(context.Context, string) (dockerapi.ContainerInspect, error) Create(context.Context, string, dockerapi.CreateSpec) (string, error) Start(context.Context, string) error Remove(context.Context, string) error}type Model
Section titled “type Model”type Model struct { Name string `json:"name"` Size int64 `json:"size"`}func FetchTags
Section titled “func FetchTags”func FetchTags(ctx context.Context, client *http.Client, baseURL string) ([]Model, error)type ReleaseImageAcquirer
Section titled “type ReleaseImageAcquirer”type ReleaseImageAcquirer func(context.Context, releaseartifact.DockerLoader, string) (string, error)type tagsResponse
Section titled “type tagsResponse”type tagsResponse struct { Models []Model `json:"models"`}openapi
Section titled “openapi”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/openapi"Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.2 DO NOT EDIT.
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- type AcceptedResponse
- type AgentEvent
- type BadGateway
- type BadGatewayJSONResponse
- type BadRequest
- type BadRequestJSONResponse
- type CancelChatSession202Response
- type CancelChatSession401JSONResponse
- type CancelChatSession404JSONResponse
- type CancelChatSessionRequestObject
- type CancelChatSessionResponseObject
- type CancelHarnessAuth200JSONResponse
- type CancelHarnessAuth400JSONResponse
- type CancelHarnessAuth401JSONResponse
- type CancelHarnessAuth404JSONResponse
- type CancelHarnessAuth500JSONResponse
- type CancelHarnessAuthJSONRequestBody
- type CancelHarnessAuthRequestObject
- type CancelHarnessAuthResponseObject
- type ChatId
- type ConfigOptionRequest
- type ContainerListResponse
- type ContainerName
- type ContainerSummary
- type ContentBlock
- type Cursor
- type DecisionRequest
- type DeleteProData204Response
- type DeleteProData401JSONResponse
- type DeleteProData502JSONResponse
- type DeleteProDataRequestObject
- type DeleteProDataResponseObject
- type DirectoryPath
- type DisconnectHarnessAuth200JSONResponse
- type DisconnectHarnessAuth400JSONResponse
- type DisconnectHarnessAuth401JSONResponse
- type DisconnectHarnessAuth404JSONResponse
- type DisconnectHarnessAuth500JSONResponse
- type DisconnectHarnessAuthJSONRequestBody
- type DisconnectHarnessAuthRequestObject
- type DisconnectHarnessAuthResponseObject
- type EndLiveActivity200JSONResponse
- type EndLiveActivity400JSONResponse
- type EndLiveActivity401JSONResponse
- type EndLiveActivity404JSONResponse
- type EndLiveActivity409Response
- type EndLiveActivityRequestObject
- type EndLiveActivityResponseObject
- type ErrorResponse
- type ExecuteMcpRequest200JSONResponse
- type ExecuteMcpRequest400JSONResponse
- type ExecuteMcpRequest401JSONResponse
- type ExecuteMcpRequest403JSONResponse
- type ExecuteMcpRequest404JSONResponse
- type ExecuteMcpRequest422JSONResponse
- type ExecuteMcpRequest500JSONResponse
- type ExecuteMcpRequestJSONRequestBody
- type ExecuteMcpRequestRequestObject
- type ExecuteMcpRequestResponse
- type ExecuteMcpRequestResponseObject
- type FilePath
- type FileTreeEntry
- type FileTreeResponse
- type Forbidden
- type ForbiddenJSONResponse
- type GetHarnessAuthStatus200JSONResponse
- type GetHarnessAuthStatus400JSONResponse
- type GetHarnessAuthStatus401JSONResponse
- type GetHarnessAuthStatus404JSONResponse
- type GetHarnessAuthStatus500JSONResponse
- type GetHarnessAuthStatusJSONRequestBody
- type GetHarnessAuthStatusRequestObject
- type GetHarnessAuthStatusResponseObject
- type GetHarnessInstanceLogs200JSONResponse
- type GetHarnessInstanceLogs401JSONResponse
- type GetHarnessInstanceLogs404JSONResponse
- type GetHarnessInstanceLogsRequestObject
- type GetHarnessInstanceLogsResponseObject
- type GetReleaseCompatibility200JSONResponse
- type GetReleaseCompatibility400JSONResponse
- type GetReleaseCompatibility401JSONResponse
- type GetReleaseCompatibility404JSONResponse
- type GetReleaseCompatibility500JSONResponse
- type GetReleaseCompatibilityRequestObject
- type GetReleaseCompatibilityResponseObject
- type GetReleaseStatus200JSONResponse
- type GetReleaseStatus400JSONResponse
- type GetReleaseStatus401JSONResponse
- type GetReleaseStatus404JSONResponse
- type GetReleaseStatus500JSONResponse
- type GetReleaseStatusRequestObject
- type GetReleaseStatusResponseObject
- type GetWorkspaceFile200ApplicationoctetStreamResponse
- type GetWorkspaceFile401JSONResponse
- type GetWorkspaceFile404JSONResponse
- type GetWorkspaceFileParams
- type GetWorkspaceFileRequestObject
- type GetWorkspaceFileResponseObject
- type HarnessAuthAttempt
- type HarnessAuthChallenge
- type HarnessAuthChallengeCodeDestination
- type HarnessAuthChallengeKind
- type HarnessAuthStatus
- type HarnessAuthStatusMode
- type HarnessInstanceLogResponse
- type HarnessRequest
- type HarnessRequestMode
- type InternalError
- type InternalErrorJSONResponse
- type InvalidParamFormatError
- type ListContainers200JSONResponse
- type ListContainers401JSONResponse
- type ListContainers403JSONResponse
- type ListContainersRequestObject
- type ListContainersResponseObject
- type ListOllamaModels200JSONResponse
- type ListOllamaModels400JSONResponse
- type ListOllamaModels401JSONResponse
- type ListOllamaModels403JSONResponse
- type ListOllamaModels404JSONResponse
- type ListOllamaModels500JSONResponse
- type ListOllamaModelsRequestObject
- type ListOllamaModelsResponseObject
- type ListWorkspaceFileTree200JSONResponse
- type ListWorkspaceFileTree401JSONResponse
- type ListWorkspaceFileTree404JSONResponse
- type ListWorkspaceFileTreeParams
- type ListWorkspaceFileTreeRequestObject
- type ListWorkspaceFileTreeResponseObject
- type LogEvent
- type McpOAuthRequest
- type McpRequest
- type MiddlewareFunc
- type ModeRequest
- type ModelRequest
- type NotFound
- type NotFoundJSONResponse
- type OkResponse
- type OllamaModelsResponse
- type OllamaProgress
- type PollHarnessAuth200JSONResponse
- type PollHarnessAuth400JSONResponse
- type PollHarnessAuth401JSONResponse
- type PollHarnessAuth404JSONResponse
- type PollHarnessAuth500JSONResponse
- type PollHarnessAuthJSONRequestBody
- type PollHarnessAuthRequestObject
- type PollHarnessAuthResponseObject
- type PromptChat202JSONResponse
- type PromptChat400JSONResponse
- type PromptChat401JSONResponse
- type PromptChat404JSONResponse
- type PromptChat503JSONResponse
- type PromptChatJSONRequestBody
- type PromptChatRequestObject
- type PromptChatResponseObject
- type PromptRequest
- type ProxyObservability200AsteriskResponse
- type ProxyObservability401JSONResponse
- type ProxyObservability403JSONResponse
- type ProxyObservabilityRequestObject
- type ProxyObservabilityResponseObject
- type PullOllamaModel200ApplicationxNdjsonResponse
- type PullOllamaModel400JSONResponse
- type PullOllamaModel401JSONResponse
- type PullOllamaModel403JSONResponse
- type PullOllamaModel502JSONResponse
- type PullOllamaModel503JSONResponse
- type PullOllamaModelJSONRequestBody
- type PullOllamaModelRequestObject
- type PullOllamaModelResponseObject
- type PushRequest
- type ReleaseCompatibilityResponse
- type ReleaseStatusResponse
- type RequestId
- type RequiredHeaderError
- type RequiredParamError
- type RespondToElicitation202Response
- type RespondToElicitation400JSONResponse
- type RespondToElicitation401JSONResponse
- type RespondToElicitation404JSONResponse
- type RespondToElicitation502JSONResponse
- type RespondToElicitation503JSONResponse
- type RespondToElicitationJSONRequestBody
- type RespondToElicitationRequestObject
- type RespondToElicitationResponseObject
- type RespondToPermission202Response
- type RespondToPermission400JSONResponse
- type RespondToPermission401JSONResponse
- type RespondToPermission404JSONResponse
- type RespondToPermission502JSONResponse
- type RespondToPermission503JSONResponse
- type RespondToPermissionJSONRequestBody
- type RespondToPermissionRequestObject
- type RespondToPermissionResponseObject
- type RunScheduleNow202JSONResponse
- type RunScheduleNow400JSONResponse
- type RunScheduleNow401JSONResponse
- type RunScheduleNow404JSONResponse
- type RunScheduleNowRequestObject
- type RunScheduleNowResponseObject
- type ScheduleRunAcceptedResponse
- type ScheduleRunAcceptedResponseStatus
- type SendPushNotification200JSONResponse
- type SendPushNotification204Response
- type SendPushNotification400JSONResponse
- type SendPushNotification401JSONResponse
- type SendPushNotification404JSONResponse
- type SendPushNotificationJSONRequestBody
- type SendPushNotificationRequestObject
- type SendPushNotificationResponseObject
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CancelChatSession(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteProData(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DisconnectHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) EndLiveActivity(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ExecuteMcpRequest(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHarnessAuthStatus(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHarnessInstanceLogs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReleaseCompatibility(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReleaseStatus(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWorkspaceFile(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListContainers(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListOllamaModels(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListWorkspaceFileTree(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PollHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PromptChat(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ProxyObservability(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PullOllamaModel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RespondToElicitation(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RespondToPermission(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RunScheduleNow(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SendPushNotification(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SetChatConfigOption(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SetChatMode(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SetLiveActivityToken(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StartHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StreamChatEvents(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StreamContainerLogs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)
- type SetChatConfigOption202Response
- type SetChatConfigOption400JSONResponse
- type SetChatConfigOption401JSONResponse
- type SetChatConfigOption404JSONResponse
- type SetChatConfigOption502JSONResponse
- type SetChatConfigOption503JSONResponse
- type SetChatConfigOptionJSONRequestBody
- type SetChatConfigOptionRequestObject
- type SetChatConfigOptionResponseObject
- type SetChatMode202Response
- type SetChatMode400JSONResponse
- type SetChatMode401JSONResponse
- type SetChatMode404JSONResponse
- type SetChatMode502JSONResponse
- type SetChatMode503JSONResponse
- type SetChatModeJSONRequestBody
- type SetChatModeRequestObject
- type SetChatModeResponseObject
- type SetLiveActivityToken200JSONResponse
- type SetLiveActivityToken400JSONResponse
- type SetLiveActivityToken401JSONResponse
- type SetLiveActivityToken404JSONResponse
- type SetLiveActivityToken409Response
- type SetLiveActivityTokenJSONRequestBody
- type SetLiveActivityTokenRequest
- type SetLiveActivityTokenRequestObject
- type SetLiveActivityTokenResponseObject
- type StartHarnessAuth200JSONResponse
- type StartHarnessAuth400JSONResponse
- type StartHarnessAuth401JSONResponse
- type StartHarnessAuth404JSONResponse
- type StartHarnessAuth500JSONResponse
- type StartHarnessAuthJSONRequestBody
- type StartHarnessAuthRequestObject
- type StartHarnessAuthResponseObject
- type StdHTTPServerOptions
- type StoreMcpOAuthToken200JSONResponse
- type StoreMcpOAuthToken400JSONResponse
- type StoreMcpOAuthToken401JSONResponse
- type StoreMcpOAuthToken404JSONResponse
- type StoreMcpOAuthToken500JSONResponse
- type StoreMcpOAuthTokenJSONRequestBody
- type StoreMcpOAuthTokenRequestObject
- type StoreMcpOAuthTokenResponse
- type StoreMcpOAuthTokenResponseObject
- type StreamChatEvents200TexteventStreamResponse
- type StreamChatEvents401JSONResponse
- type StreamChatEvents404JSONResponse
- type StreamChatEventsParams
- type StreamChatEventsRequestObject
- type StreamChatEventsResponseObject
- type StreamContainerLogs200TexteventStreamResponse
- type StreamContainerLogs401JSONResponse
- type StreamContainerLogs404JSONResponse
- type StreamContainerLogsRequestObject
- type StreamContainerLogsResponseObject
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type SubmitHarnessAuth200JSONResponse
- type SubmitHarnessAuth400JSONResponse
- type SubmitHarnessAuth401JSONResponse
- type SubmitHarnessAuth404JSONResponse
- type SubmitHarnessAuth500JSONResponse
- type SubmitHarnessAuthJSONRequestBody
- type SubmitHarnessAuthRequestObject
- type SubmitHarnessAuthResponseObject
- type TooManyValuesForParamError
- type Unauthorized
- type UnauthorizedJSONResponse
- type Unavailable
- type UnavailableJSONResponse
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type Unprocessable
- type UnprocessableJSONResponse
- type pocketbaseTokenContextKey
- type strictHandler
- func (sh *strictHandler) CancelChatSession(w http.ResponseWriter, r *http.Request, chatId ChatId)
- func (sh *strictHandler) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) DeleteProData(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) DisconnectHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) EndLiveActivity(w http.ResponseWriter, r *http.Request, id RequestId)
- func (sh *strictHandler) ExecuteMcpRequest(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) GetHarnessAuthStatus(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) GetHarnessInstanceLogs(w http.ResponseWriter, r *http.Request, id string)
- func (sh *strictHandler) GetReleaseCompatibility(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) GetReleaseStatus(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) GetWorkspaceFile(w http.ResponseWriter, r *http.Request, params GetWorkspaceFileParams)
- func (sh *strictHandler) ListContainers(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) ListOllamaModels(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) ListWorkspaceFileTree(w http.ResponseWriter, r *http.Request, params ListWorkspaceFileTreeParams)
- func (sh *strictHandler) PollHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) PromptChat(w http.ResponseWriter, r *http.Request, chatId ChatId)
- func (sh *strictHandler) ProxyObservability(w http.ResponseWriter, r *http.Request, path string)
- func (sh *strictHandler) PullOllamaModel(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) RespondToElicitation(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)
- func (sh *strictHandler) RespondToPermission(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)
- func (sh *strictHandler) RunScheduleNow(w http.ResponseWriter, r *http.Request, scheduleId string)
- func (sh *strictHandler) SendPushNotification(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) SetChatConfigOption(w http.ResponseWriter, r *http.Request, chatId ChatId)
- func (sh *strictHandler) SetChatMode(w http.ResponseWriter, r *http.Request, chatId ChatId)
- func (sh *strictHandler) SetLiveActivityToken(w http.ResponseWriter, r *http.Request, id RequestId)
- func (sh *strictHandler) StartHarnessAuth(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)
- func (sh *strictHandler) StreamChatEvents(w http.ResponseWriter, r *http.Request, chatId ChatId, params StreamChatEventsParams)
- func (sh *strictHandler) StreamContainerLogs(w http.ResponseWriter, r *http.Request, containerName ContainerName)
- func (sh *strictHandler) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)
func Handler
Section titled “func Handler”func Handler(si ServerInterface) http.HandlerHandler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux
Section titled “func HandlerFromMux”func HandlerFromMux(si ServerInterface, m ServeMux) http.HandlerHandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL
Section titled “func HandlerFromMuxWithBaseURL”func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handlerfunc HandlerWithOptions
Section titled “func HandlerWithOptions”func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.HandlerHandlerWithOptions creates http.Handler with additional options
type AcceptedResponse
Section titled “type AcceptedResponse”AcceptedResponse defines model for AcceptedResponse.
type AcceptedResponse struct { RunId string `json:"runId"`}type AgentEvent
Section titled “type AgentEvent”AgentEvent defines model for AgentEvent.
type AgentEvent map[string]interface{}type BadGateway
Section titled “type BadGateway”BadGateway defines model for BadGateway.
type BadGateway = ErrorResponsetype BadGatewayJSONResponse
Section titled “type BadGatewayJSONResponse”type BadGatewayJSONResponse ErrorResponsetype BadRequest
Section titled “type BadRequest”BadRequest defines model for BadRequest.
type BadRequest = ErrorResponsetype BadRequestJSONResponse
Section titled “type BadRequestJSONResponse”type BadRequestJSONResponse ErrorResponsetype CancelChatSession202Response
Section titled “type CancelChatSession202Response”type CancelChatSession202Response struct {}func (CancelChatSession202Response) VisitCancelChatSessionResponse
Section titled “func (CancelChatSession202Response) VisitCancelChatSessionResponse”func (response CancelChatSession202Response) VisitCancelChatSessionResponse(w http.ResponseWriter) errortype CancelChatSession401JSONResponse
Section titled “type CancelChatSession401JSONResponse”type CancelChatSession401JSONResponse struct{ UnauthorizedJSONResponse }func (CancelChatSession401JSONResponse) VisitCancelChatSessionResponse
Section titled “func (CancelChatSession401JSONResponse) VisitCancelChatSessionResponse”func (response CancelChatSession401JSONResponse) VisitCancelChatSessionResponse(w http.ResponseWriter) errortype CancelChatSession404JSONResponse
Section titled “type CancelChatSession404JSONResponse”type CancelChatSession404JSONResponse struct{ NotFoundJSONResponse }func (CancelChatSession404JSONResponse) VisitCancelChatSessionResponse
Section titled “func (CancelChatSession404JSONResponse) VisitCancelChatSessionResponse”func (response CancelChatSession404JSONResponse) VisitCancelChatSessionResponse(w http.ResponseWriter) errortype CancelChatSessionRequestObject
Section titled “type CancelChatSessionRequestObject”type CancelChatSessionRequestObject struct { ChatId ChatId `json:"chatId"`}type CancelChatSessionResponseObject
Section titled “type CancelChatSessionResponseObject”type CancelChatSessionResponseObject interface { VisitCancelChatSessionResponse(w http.ResponseWriter) error}type CancelHarnessAuth200JSONResponse
Section titled “type CancelHarnessAuth200JSONResponse”type CancelHarnessAuth200JSONResponse HarnessAuthStatusfunc (CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse
Section titled “func (CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse”func (response CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) errortype CancelHarnessAuth400JSONResponse
Section titled “type CancelHarnessAuth400JSONResponse”type CancelHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }func (CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse
Section titled “func (CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse”func (response CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) errortype CancelHarnessAuth401JSONResponse
Section titled “type CancelHarnessAuth401JSONResponse”type CancelHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }func (CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse
Section titled “func (CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse”func (response CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) errortype CancelHarnessAuth404JSONResponse
Section titled “type CancelHarnessAuth404JSONResponse”type CancelHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }func (CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse
Section titled “func (CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse”func (response CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) errortype CancelHarnessAuth500JSONResponse
Section titled “type CancelHarnessAuth500JSONResponse”type CancelHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }func (CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse
Section titled “func (CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse”func (response CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) errortype CancelHarnessAuthJSONRequestBody
Section titled “type CancelHarnessAuthJSONRequestBody”CancelHarnessAuthJSONRequestBody defines body for CancelHarnessAuth for application/json ContentType.
type CancelHarnessAuthJSONRequestBody = HarnessRequesttype CancelHarnessAuthRequestObject
Section titled “type CancelHarnessAuthRequestObject”type CancelHarnessAuthRequestObject struct { Body *CancelHarnessAuthJSONRequestBody}type CancelHarnessAuthResponseObject
Section titled “type CancelHarnessAuthResponseObject”type CancelHarnessAuthResponseObject interface { VisitCancelHarnessAuthResponse(w http.ResponseWriter) error}type ChatId
Section titled “type ChatId”ChatId defines model for ChatId.
type ChatId = stringtype ConfigOptionRequest
Section titled “type ConfigOptionRequest”ConfigOptionRequest defines model for ConfigOptionRequest.
type ConfigOptionRequest struct { ConfigId string `json:"configId"` Value string `json:"value"`}type ContainerListResponse
Section titled “type ContainerListResponse”ContainerListResponse defines model for ContainerListResponse.
type ContainerListResponse struct { Containers []ContainerSummary `json:"containers"`}type ContainerName
Section titled “type ContainerName”ContainerName defines model for ContainerName.
type ContainerName = stringtype ContainerSummary
Section titled “type ContainerSummary”ContainerSummary defines model for ContainerSummary.
type ContainerSummary struct { Name string `json:"name"` State string `json:"state"` Status string `json:"status"`}type ContentBlock
Section titled “type ContentBlock”ContentBlock defines model for ContentBlock.
type ContentBlock struct { Text *string `json:"text,omitempty"` Type string `json:"type"` AdditionalProperties map[string]interface{} `json:"-"`}func (ContentBlock) Get
Section titled “func (ContentBlock) Get”func (a ContentBlock) Get(fieldName string) (value interface{}, found bool)Getter for additional properties for ContentBlock. Returns the specified element and whether it was found
func (ContentBlock) MarshalJSON
Section titled “func (ContentBlock) MarshalJSON”func (a ContentBlock) MarshalJSON() ([]byte, error)Override default JSON handling for ContentBlock to handle AdditionalProperties
func (*ContentBlock) Set
Section titled “func (*ContentBlock) Set”func (a *ContentBlock) Set(fieldName string, value interface{})Setter for additional properties for ContentBlock
func (*ContentBlock) UnmarshalJSON
Section titled “func (*ContentBlock) UnmarshalJSON”func (a *ContentBlock) UnmarshalJSON(b []byte) errorOverride default JSON handling for ContentBlock to handle AdditionalProperties
type Cursor
Section titled “type Cursor”Cursor defines model for Cursor.
type Cursor = inttype DecisionRequest
Section titled “type DecisionRequest”DecisionRequest defines model for DecisionRequest.
type DecisionRequest map[string]interface{}type DeleteProData204Response
Section titled “type DeleteProData204Response”type DeleteProData204Response struct {}func (DeleteProData204Response) VisitDeleteProDataResponse
Section titled “func (DeleteProData204Response) VisitDeleteProDataResponse”func (response DeleteProData204Response) VisitDeleteProDataResponse(w http.ResponseWriter) errortype DeleteProData401JSONResponse
Section titled “type DeleteProData401JSONResponse”type DeleteProData401JSONResponse struct{ UnauthorizedJSONResponse }func (DeleteProData401JSONResponse) VisitDeleteProDataResponse
Section titled “func (DeleteProData401JSONResponse) VisitDeleteProDataResponse”func (response DeleteProData401JSONResponse) VisitDeleteProDataResponse(w http.ResponseWriter) errortype DeleteProData502JSONResponse
Section titled “type DeleteProData502JSONResponse”type DeleteProData502JSONResponse struct{ BadGatewayJSONResponse }func (DeleteProData502JSONResponse) VisitDeleteProDataResponse
Section titled “func (DeleteProData502JSONResponse) VisitDeleteProDataResponse”func (response DeleteProData502JSONResponse) VisitDeleteProDataResponse(w http.ResponseWriter) errortype DeleteProDataRequestObject
Section titled “type DeleteProDataRequestObject”type DeleteProDataRequestObject struct {}type DeleteProDataResponseObject
Section titled “type DeleteProDataResponseObject”type DeleteProDataResponseObject interface { VisitDeleteProDataResponse(w http.ResponseWriter) error}type DirectoryPath
Section titled “type DirectoryPath”DirectoryPath defines model for DirectoryPath.
type DirectoryPath = stringtype DisconnectHarnessAuth200JSONResponse
Section titled “type DisconnectHarnessAuth200JSONResponse”type DisconnectHarnessAuth200JSONResponse HarnessAuthStatusfunc (DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse
Section titled “func (DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse”func (response DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) errortype DisconnectHarnessAuth400JSONResponse
Section titled “type DisconnectHarnessAuth400JSONResponse”type DisconnectHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }func (DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse
Section titled “func (DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse”func (response DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) errortype DisconnectHarnessAuth401JSONResponse
Section titled “type DisconnectHarnessAuth401JSONResponse”type DisconnectHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }func (DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse
Section titled “func (DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse”func (response DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) errortype DisconnectHarnessAuth404JSONResponse
Section titled “type DisconnectHarnessAuth404JSONResponse”type DisconnectHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }func (DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse
Section titled “func (DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse”func (response DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) errortype DisconnectHarnessAuth500JSONResponse
Section titled “type DisconnectHarnessAuth500JSONResponse”type DisconnectHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }func (DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse
Section titled “func (DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse”func (response DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) errortype DisconnectHarnessAuthJSONRequestBody
Section titled “type DisconnectHarnessAuthJSONRequestBody”DisconnectHarnessAuthJSONRequestBody defines body for DisconnectHarnessAuth for application/json ContentType.
type DisconnectHarnessAuthJSONRequestBody = HarnessRequesttype DisconnectHarnessAuthRequestObject
Section titled “type DisconnectHarnessAuthRequestObject”type DisconnectHarnessAuthRequestObject struct { Body *DisconnectHarnessAuthJSONRequestBody}type DisconnectHarnessAuthResponseObject
Section titled “type DisconnectHarnessAuthResponseObject”type DisconnectHarnessAuthResponseObject interface { VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error}type EndLiveActivity200JSONResponse
Section titled “type EndLiveActivity200JSONResponse”type EndLiveActivity200JSONResponse OkResponsefunc (EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse
Section titled “func (EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse”func (response EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) errortype EndLiveActivity400JSONResponse
Section titled “type EndLiveActivity400JSONResponse”type EndLiveActivity400JSONResponse struct{ BadRequestJSONResponse }func (EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse
Section titled “func (EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse”func (response EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) errortype EndLiveActivity401JSONResponse
Section titled “type EndLiveActivity401JSONResponse”type EndLiveActivity401JSONResponse struct{ UnauthorizedJSONResponse }func (EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse
Section titled “func (EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse”func (response EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) errortype EndLiveActivity404JSONResponse
Section titled “type EndLiveActivity404JSONResponse”type EndLiveActivity404JSONResponse struct{ NotFoundJSONResponse }func (EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse
Section titled “func (EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse”func (response EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) errortype EndLiveActivity409Response
Section titled “type EndLiveActivity409Response”type EndLiveActivity409Response struct {}func (EndLiveActivity409Response) VisitEndLiveActivityResponse
Section titled “func (EndLiveActivity409Response) VisitEndLiveActivityResponse”func (response EndLiveActivity409Response) VisitEndLiveActivityResponse(w http.ResponseWriter) errortype EndLiveActivityRequestObject
Section titled “type EndLiveActivityRequestObject”type EndLiveActivityRequestObject struct { Id RequestId `json:"id"`}type EndLiveActivityResponseObject
Section titled “type EndLiveActivityResponseObject”type EndLiveActivityResponseObject interface { VisitEndLiveActivityResponse(w http.ResponseWriter) error}type ErrorResponse
Section titled “type ErrorResponse”ErrorResponse defines model for ErrorResponse.
type ErrorResponse struct { Data map[string]interface{} `json:"data"` Message string `json:"message"` Status int `json:"status"`}type ExecuteMcpRequest200JSONResponse
Section titled “type ExecuteMcpRequest200JSONResponse”type ExecuteMcpRequest200JSONResponse ExecuteMcpRequestResponsefunc (ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest400JSONResponse
Section titled “type ExecuteMcpRequest400JSONResponse”type ExecuteMcpRequest400JSONResponse struct{ BadRequestJSONResponse }func (ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest401JSONResponse
Section titled “type ExecuteMcpRequest401JSONResponse”type ExecuteMcpRequest401JSONResponse struct{ UnauthorizedJSONResponse }func (ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest403JSONResponse
Section titled “type ExecuteMcpRequest403JSONResponse”type ExecuteMcpRequest403JSONResponse struct{ ForbiddenJSONResponse }func (ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest404JSONResponse
Section titled “type ExecuteMcpRequest404JSONResponse”type ExecuteMcpRequest404JSONResponse struct{ NotFoundJSONResponse }func (ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest422JSONResponse
Section titled “type ExecuteMcpRequest422JSONResponse”type ExecuteMcpRequest422JSONResponse struct{ UnprocessableJSONResponse }func (ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequest500JSONResponse
Section titled “type ExecuteMcpRequest500JSONResponse”type ExecuteMcpRequest500JSONResponse struct{ InternalErrorJSONResponse }func (ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse
Section titled “func (ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse”func (response ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) errortype ExecuteMcpRequestJSONRequestBody
Section titled “type ExecuteMcpRequestJSONRequestBody”ExecuteMcpRequestJSONRequestBody defines body for ExecuteMcpRequest for application/json ContentType.
type ExecuteMcpRequestJSONRequestBody = McpRequesttype ExecuteMcpRequestRequestObject
Section titled “type ExecuteMcpRequestRequestObject”type ExecuteMcpRequestRequestObject struct { Body *ExecuteMcpRequestJSONRequestBody}type ExecuteMcpRequestResponse
Section titled “type ExecuteMcpRequestResponse”ExecuteMcpRequestResponse defines model for ExecuteMcpRequestResponse.
type ExecuteMcpRequestResponse struct { Id string `json:"id"` Status string `json:"status"` Synced *bool `json:"synced,omitempty"`}type ExecuteMcpRequestResponseObject
Section titled “type ExecuteMcpRequestResponseObject”type ExecuteMcpRequestResponseObject interface { VisitExecuteMcpRequestResponse(w http.ResponseWriter) error}type FilePath
Section titled “type FilePath”FilePath defines model for FilePath.
type FilePath = stringtype FileTreeEntry
Section titled “type FileTreeEntry”FileTreeEntry defines model for FileTreeEntry.
type FileTreeEntry struct { Children *[]FileTreeEntry `json:"children,omitempty"` IsDir bool `json:"isDir"` ModTime *string `json:"modTime,omitempty"` Name string `json:"name"` Size *int64 `json:"size,omitempty"`}type FileTreeResponse
Section titled “type FileTreeResponse”FileTreeResponse defines model for FileTreeResponse.
type FileTreeResponse struct { Entries []FileTreeEntry `json:"entries"` Path string `json:"path"`}type Forbidden
Section titled “type Forbidden”Forbidden defines model for Forbidden.
type Forbidden = ErrorResponsetype ForbiddenJSONResponse
Section titled “type ForbiddenJSONResponse”type ForbiddenJSONResponse ErrorResponsetype GetHarnessAuthStatus200JSONResponse
Section titled “type GetHarnessAuthStatus200JSONResponse”type GetHarnessAuthStatus200JSONResponse HarnessAuthStatusfunc (GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse
Section titled “func (GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse”func (response GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) errortype GetHarnessAuthStatus400JSONResponse
Section titled “type GetHarnessAuthStatus400JSONResponse”type GetHarnessAuthStatus400JSONResponse struct{ BadRequestJSONResponse }func (GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse
Section titled “func (GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse”func (response GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) errortype GetHarnessAuthStatus401JSONResponse
Section titled “type GetHarnessAuthStatus401JSONResponse”type GetHarnessAuthStatus401JSONResponse struct{ UnauthorizedJSONResponse }func (GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse
Section titled “func (GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse”func (response GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) errortype GetHarnessAuthStatus404JSONResponse
Section titled “type GetHarnessAuthStatus404JSONResponse”type GetHarnessAuthStatus404JSONResponse struct{ NotFoundJSONResponse }func (GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse
Section titled “func (GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse”func (response GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) errortype GetHarnessAuthStatus500JSONResponse
Section titled “type GetHarnessAuthStatus500JSONResponse”type GetHarnessAuthStatus500JSONResponse struct{ InternalErrorJSONResponse }func (GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse
Section titled “func (GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse”func (response GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) errortype GetHarnessAuthStatusJSONRequestBody
Section titled “type GetHarnessAuthStatusJSONRequestBody”GetHarnessAuthStatusJSONRequestBody defines body for GetHarnessAuthStatus for application/json ContentType.
type GetHarnessAuthStatusJSONRequestBody = HarnessRequesttype GetHarnessAuthStatusRequestObject
Section titled “type GetHarnessAuthStatusRequestObject”type GetHarnessAuthStatusRequestObject struct { Body *GetHarnessAuthStatusJSONRequestBody}type GetHarnessAuthStatusResponseObject
Section titled “type GetHarnessAuthStatusResponseObject”type GetHarnessAuthStatusResponseObject interface { VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error}type GetHarnessInstanceLogs200JSONResponse
Section titled “type GetHarnessInstanceLogs200JSONResponse”type GetHarnessInstanceLogs200JSONResponse HarnessInstanceLogResponsefunc (GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse
Section titled “func (GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse”func (response GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) errortype GetHarnessInstanceLogs401JSONResponse
Section titled “type GetHarnessInstanceLogs401JSONResponse”type GetHarnessInstanceLogs401JSONResponse struct{ UnauthorizedJSONResponse }func (GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse
Section titled “func (GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse”func (response GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) errortype GetHarnessInstanceLogs404JSONResponse
Section titled “type GetHarnessInstanceLogs404JSONResponse”type GetHarnessInstanceLogs404JSONResponse struct{ NotFoundJSONResponse }func (GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse
Section titled “func (GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse”func (response GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) errortype GetHarnessInstanceLogsRequestObject
Section titled “type GetHarnessInstanceLogsRequestObject”type GetHarnessInstanceLogsRequestObject struct { Id string `json:"id"`}type GetHarnessInstanceLogsResponseObject
Section titled “type GetHarnessInstanceLogsResponseObject”type GetHarnessInstanceLogsResponseObject interface { VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) error}type GetReleaseCompatibility200JSONResponse
Section titled “type GetReleaseCompatibility200JSONResponse”type GetReleaseCompatibility200JSONResponse ReleaseCompatibilityResponsefunc (GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse
Section titled “func (GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse”func (response GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) errortype GetReleaseCompatibility400JSONResponse
Section titled “type GetReleaseCompatibility400JSONResponse”type GetReleaseCompatibility400JSONResponse struct{ BadRequestJSONResponse }func (GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse
Section titled “func (GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse”func (response GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) errortype GetReleaseCompatibility401JSONResponse
Section titled “type GetReleaseCompatibility401JSONResponse”type GetReleaseCompatibility401JSONResponse struct{ UnauthorizedJSONResponse }func (GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse
Section titled “func (GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse”func (response GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) errortype GetReleaseCompatibility404JSONResponse
Section titled “type GetReleaseCompatibility404JSONResponse”type GetReleaseCompatibility404JSONResponse struct{ NotFoundJSONResponse }func (GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse
Section titled “func (GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse”func (response GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) errortype GetReleaseCompatibility500JSONResponse
Section titled “type GetReleaseCompatibility500JSONResponse”type GetReleaseCompatibility500JSONResponse struct{ InternalErrorJSONResponse }func (GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse
Section titled “func (GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse”func (response GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) errortype GetReleaseCompatibilityRequestObject
Section titled “type GetReleaseCompatibilityRequestObject”type GetReleaseCompatibilityRequestObject struct {}type GetReleaseCompatibilityResponseObject
Section titled “type GetReleaseCompatibilityResponseObject”type GetReleaseCompatibilityResponseObject interface { VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error}type GetReleaseStatus200JSONResponse
Section titled “type GetReleaseStatus200JSONResponse”type GetReleaseStatus200JSONResponse ReleaseStatusResponsefunc (GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse
Section titled “func (GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse”func (response GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) errortype GetReleaseStatus400JSONResponse
Section titled “type GetReleaseStatus400JSONResponse”type GetReleaseStatus400JSONResponse struct{ BadRequestJSONResponse }func (GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse
Section titled “func (GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse”func (response GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) errortype GetReleaseStatus401JSONResponse
Section titled “type GetReleaseStatus401JSONResponse”type GetReleaseStatus401JSONResponse struct{ UnauthorizedJSONResponse }func (GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse
Section titled “func (GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse”func (response GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) errortype GetReleaseStatus404JSONResponse
Section titled “type GetReleaseStatus404JSONResponse”type GetReleaseStatus404JSONResponse struct{ NotFoundJSONResponse }func (GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse
Section titled “func (GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse”func (response GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) errortype GetReleaseStatus500JSONResponse
Section titled “type GetReleaseStatus500JSONResponse”type GetReleaseStatus500JSONResponse struct{ InternalErrorJSONResponse }func (GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse
Section titled “func (GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse”func (response GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) errortype GetReleaseStatusRequestObject
Section titled “type GetReleaseStatusRequestObject”type GetReleaseStatusRequestObject struct {}type GetReleaseStatusResponseObject
Section titled “type GetReleaseStatusResponseObject”type GetReleaseStatusResponseObject interface { VisitGetReleaseStatusResponse(w http.ResponseWriter) error}type GetWorkspaceFile200ApplicationoctetStreamResponse
Section titled “type GetWorkspaceFile200ApplicationoctetStreamResponse”type GetWorkspaceFile200ApplicationoctetStreamResponse struct { Body io.Reader ContentLength int64}func (GetWorkspaceFile200ApplicationoctetStreamResponse) VisitGetWorkspaceFileResponse
Section titled “func (GetWorkspaceFile200ApplicationoctetStreamResponse) VisitGetWorkspaceFileResponse”func (response GetWorkspaceFile200ApplicationoctetStreamResponse) VisitGetWorkspaceFileResponse(w http.ResponseWriter) errortype GetWorkspaceFile401JSONResponse
Section titled “type GetWorkspaceFile401JSONResponse”type GetWorkspaceFile401JSONResponse struct{ UnauthorizedJSONResponse }func (GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse
Section titled “func (GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse”func (response GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse(w http.ResponseWriter) errortype GetWorkspaceFile404JSONResponse
Section titled “type GetWorkspaceFile404JSONResponse”type GetWorkspaceFile404JSONResponse struct{ NotFoundJSONResponse }func (GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse
Section titled “func (GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse”func (response GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse(w http.ResponseWriter) errortype GetWorkspaceFileParams
Section titled “type GetWorkspaceFileParams”GetWorkspaceFileParams defines parameters for GetWorkspaceFile.
type GetWorkspaceFileParams struct { Path FilePath `form:"path" json:"path"`}type GetWorkspaceFileRequestObject
Section titled “type GetWorkspaceFileRequestObject”type GetWorkspaceFileRequestObject struct { Params GetWorkspaceFileParams}type GetWorkspaceFileResponseObject
Section titled “type GetWorkspaceFileResponseObject”type GetWorkspaceFileResponseObject interface { VisitGetWorkspaceFileResponse(w http.ResponseWriter) error}type HarnessAuthAttempt
Section titled “type HarnessAuthAttempt”HarnessAuthAttempt defines model for HarnessAuthAttempt.
type HarnessAuthAttempt struct { Id string `json:"id"` LastError *string `json:"lastError,omitempty"` Status string `json:"status"`}type HarnessAuthChallenge
Section titled “type HarnessAuthChallenge”HarnessAuthChallenge defines model for HarnessAuthChallenge.
type HarnessAuthChallenge struct { CodeDestination *HarnessAuthChallengeCodeDestination `json:"codeDestination,omitempty"` // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set Details *string `json:"details,omitempty"` ExpiresAt *time.Time `json:"expiresAt,omitempty"` Kind *HarnessAuthChallengeKind `json:"kind,omitempty"` PollIntervalSeconds *int `json:"pollIntervalSeconds,omitempty"` // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set Target *string `json:"target,omitempty"` // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set Text *string `json:"text,omitempty"` Type string `json:"type"` UserCode *string `json:"userCode,omitempty"` VerificationUri *string `json:"verificationUri,omitempty"`}type HarnessAuthChallengeCodeDestination
Section titled “type HarnessAuthChallengeCodeDestination”HarnessAuthChallengeCodeDestination defines model for HarnessAuthChallenge.CodeDestination.
type HarnessAuthChallengeCodeDestination stringDefines values for HarnessAuthChallengeCodeDestination.
const ( HarnessAuthChallengeCodeDestinationApp HarnessAuthChallengeCodeDestination = "app" HarnessAuthChallengeCodeDestinationBrowser HarnessAuthChallengeCodeDestination = "browser" HarnessAuthChallengeCodeDestinationNone HarnessAuthChallengeCodeDestination = "none")func (HarnessAuthChallengeCodeDestination) Valid
Section titled “func (HarnessAuthChallengeCodeDestination) Valid”func (e HarnessAuthChallengeCodeDestination) Valid() boolValid indicates whether the value is a known member of the HarnessAuthChallengeCodeDestination enum.
type HarnessAuthChallengeKind
Section titled “type HarnessAuthChallengeKind”HarnessAuthChallengeKind defines model for HarnessAuthChallenge.Kind.
type HarnessAuthChallengeKind stringDefines values for HarnessAuthChallengeKind.
const ( BrowserCode HarnessAuthChallengeKind = "browser_code" DeviceCode HarnessAuthChallengeKind = "device_code")func (HarnessAuthChallengeKind) Valid
Section titled “func (HarnessAuthChallengeKind) Valid”func (e HarnessAuthChallengeKind) Valid() boolValid indicates whether the value is a known member of the HarnessAuthChallengeKind enum.
type HarnessAuthStatus
Section titled “type HarnessAuthStatus”HarnessAuthStatus defines model for HarnessAuthStatus.
type HarnessAuthStatus struct { AccountId *string `json:"accountId,omitempty"` AccountName *string `json:"accountName,omitempty"` Attempt *HarnessAuthAttempt `json:"attempt,omitempty"` Challenge *HarnessAuthChallenge `json:"challenge,omitempty"` Harness string `json:"harness"` LastError *string `json:"lastError,omitempty"` Mode HarnessAuthStatusMode `json:"mode"` Provider string `json:"provider"` Status string `json:"status"` Visibility *string `json:"visibility,omitempty"`}type HarnessAuthStatusMode
Section titled “type HarnessAuthStatusMode”HarnessAuthStatusMode defines model for HarnessAuthStatus.Mode.
type HarnessAuthStatusMode stringDefines values for HarnessAuthStatusMode.
const ( HarnessAuthStatusModeNone HarnessAuthStatusMode = "none" HarnessAuthStatusModeOauth HarnessAuthStatusMode = "oauth")func (HarnessAuthStatusMode) Valid
Section titled “func (HarnessAuthStatusMode) Valid”func (e HarnessAuthStatusMode) Valid() boolValid indicates whether the value is a known member of the HarnessAuthStatusMode enum.
type HarnessInstanceLogResponse
Section titled “type HarnessInstanceLogResponse”HarnessInstanceLogResponse defines model for HarnessInstanceLogResponse.
type HarnessInstanceLogResponse struct { Lines []string `json:"lines"` Truncated bool `json:"truncated"`}type HarnessRequest
Section titled “type HarnessRequest”HarnessRequest defines model for HarnessRequest.
type HarnessRequest struct { AccountId *string `json:"accountId,omitempty"` AccountName *string `json:"accountName,omitempty"` AttemptId *string `json:"attemptId,omitempty"` Code *string `json:"code,omitempty"` Harness string `json:"harness"` Mode *HarnessRequestMode `json:"mode,omitempty"`
// Provider PocketBase providers record id Provider string `json:"provider"` Visibility *string `json:"visibility,omitempty"`}type HarnessRequestMode
Section titled “type HarnessRequestMode”HarnessRequestMode defines model for HarnessRequest.Mode.
type HarnessRequestMode stringDefines values for HarnessRequestMode.
const ( None HarnessRequestMode = "none" Oauth HarnessRequestMode = "oauth")func (HarnessRequestMode) Valid
Section titled “func (HarnessRequestMode) Valid”func (e HarnessRequestMode) Valid() boolValid indicates whether the value is a known member of the HarnessRequestMode enum.
type InternalError
Section titled “type InternalError”InternalError defines model for InternalError.
type InternalError = ErrorResponsetype InternalErrorJSONResponse
Section titled “type InternalErrorJSONResponse”type InternalErrorJSONResponse ErrorResponsetype InvalidParamFormatError
Section titled “type InvalidParamFormatError”type InvalidParamFormatError struct { ParamName string Err error}func (*InvalidParamFormatError) Error
Section titled “func (*InvalidParamFormatError) Error”func (e *InvalidParamFormatError) Error() stringfunc (*InvalidParamFormatError) Unwrap
Section titled “func (*InvalidParamFormatError) Unwrap”func (e *InvalidParamFormatError) Unwrap() errortype ListContainers200JSONResponse
Section titled “type ListContainers200JSONResponse”type ListContainers200JSONResponse ContainerListResponsefunc (ListContainers200JSONResponse) VisitListContainersResponse
Section titled “func (ListContainers200JSONResponse) VisitListContainersResponse”func (response ListContainers200JSONResponse) VisitListContainersResponse(w http.ResponseWriter) errortype ListContainers401JSONResponse
Section titled “type ListContainers401JSONResponse”type ListContainers401JSONResponse struct{ UnauthorizedJSONResponse }func (ListContainers401JSONResponse) VisitListContainersResponse
Section titled “func (ListContainers401JSONResponse) VisitListContainersResponse”func (response ListContainers401JSONResponse) VisitListContainersResponse(w http.ResponseWriter) errortype ListContainers403JSONResponse
Section titled “type ListContainers403JSONResponse”type ListContainers403JSONResponse struct{ ForbiddenJSONResponse }func (ListContainers403JSONResponse) VisitListContainersResponse
Section titled “func (ListContainers403JSONResponse) VisitListContainersResponse”func (response ListContainers403JSONResponse) VisitListContainersResponse(w http.ResponseWriter) errortype ListContainersRequestObject
Section titled “type ListContainersRequestObject”type ListContainersRequestObject struct {}type ListContainersResponseObject
Section titled “type ListContainersResponseObject”type ListContainersResponseObject interface { VisitListContainersResponse(w http.ResponseWriter) error}type ListOllamaModels200JSONResponse
Section titled “type ListOllamaModels200JSONResponse”type ListOllamaModels200JSONResponse OllamaModelsResponsefunc (ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModels400JSONResponse
Section titled “type ListOllamaModels400JSONResponse”type ListOllamaModels400JSONResponse struct{ BadRequestJSONResponse }func (ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModels401JSONResponse
Section titled “type ListOllamaModels401JSONResponse”type ListOllamaModels401JSONResponse struct{ UnauthorizedJSONResponse }func (ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModels403JSONResponse
Section titled “type ListOllamaModels403JSONResponse”type ListOllamaModels403JSONResponse struct{ ForbiddenJSONResponse }func (ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModels404JSONResponse
Section titled “type ListOllamaModels404JSONResponse”type ListOllamaModels404JSONResponse struct{ NotFoundJSONResponse }func (ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModels500JSONResponse
Section titled “type ListOllamaModels500JSONResponse”type ListOllamaModels500JSONResponse struct{ InternalErrorJSONResponse }func (ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse
Section titled “func (ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse”func (response ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) errortype ListOllamaModelsRequestObject
Section titled “type ListOllamaModelsRequestObject”type ListOllamaModelsRequestObject struct {}type ListOllamaModelsResponseObject
Section titled “type ListOllamaModelsResponseObject”type ListOllamaModelsResponseObject interface { VisitListOllamaModelsResponse(w http.ResponseWriter) error}type ListWorkspaceFileTree200JSONResponse
Section titled “type ListWorkspaceFileTree200JSONResponse”type ListWorkspaceFileTree200JSONResponse FileTreeResponsefunc (ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse
Section titled “func (ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse”func (response ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) errortype ListWorkspaceFileTree401JSONResponse
Section titled “type ListWorkspaceFileTree401JSONResponse”type ListWorkspaceFileTree401JSONResponse struct{ UnauthorizedJSONResponse }func (ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse
Section titled “func (ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse”func (response ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) errortype ListWorkspaceFileTree404JSONResponse
Section titled “type ListWorkspaceFileTree404JSONResponse”type ListWorkspaceFileTree404JSONResponse struct{ NotFoundJSONResponse }func (ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse
Section titled “func (ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse”func (response ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) errortype ListWorkspaceFileTreeParams
Section titled “type ListWorkspaceFileTreeParams”ListWorkspaceFileTreeParams defines parameters for ListWorkspaceFileTree.
type ListWorkspaceFileTreeParams struct { Path *DirectoryPath `form:"path,omitempty" json:"path,omitempty"`}type ListWorkspaceFileTreeRequestObject
Section titled “type ListWorkspaceFileTreeRequestObject”type ListWorkspaceFileTreeRequestObject struct { Params ListWorkspaceFileTreeParams}type ListWorkspaceFileTreeResponseObject
Section titled “type ListWorkspaceFileTreeResponseObject”type ListWorkspaceFileTreeResponseObject interface { VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) error}type LogEvent
Section titled “type LogEvent”LogEvent defines model for LogEvent.
type LogEvent map[string]interface{}type McpOAuthRequest
Section titled “type McpOAuthRequest”McpOAuthRequest defines model for McpOAuthRequest.
type McpOAuthRequest struct { AccessToken string `json:"access_token"` RefreshToken *string `json:"refresh_token,omitempty"` ServerName string `json:"server_name"`}type McpRequest
Section titled “type McpRequest”McpRequest defines model for McpRequest.
type McpRequest map[string]interface{}type MiddlewareFunc
Section titled “type MiddlewareFunc”type MiddlewareFunc func(http.Handler) http.Handlertype ModeRequest
Section titled “type ModeRequest”ModeRequest defines model for ModeRequest.
type ModeRequest struct { ModeId string `json:"modeId"`}type ModelRequest
Section titled “type ModelRequest”ModelRequest defines model for ModelRequest.
type ModelRequest struct { Model string `json:"model"`}type NotFound
Section titled “type NotFound”NotFound defines model for NotFound.
type NotFound = ErrorResponsetype NotFoundJSONResponse
Section titled “type NotFoundJSONResponse”type NotFoundJSONResponse ErrorResponsetype OkResponse
Section titled “type OkResponse”OkResponse defines model for OkResponse.
type OkResponse struct { Ok bool `json:"ok"`}type OllamaModelsResponse
Section titled “type OllamaModelsResponse”OllamaModelsResponse defines model for OllamaModelsResponse.
type OllamaModelsResponse struct { Enabled bool `json:"enabled"` Models []map[string]interface{} `json:"models"`}type OllamaProgress
Section titled “type OllamaProgress”OllamaProgress defines model for OllamaProgress.
type OllamaProgress map[string]interface{}type PollHarnessAuth200JSONResponse
Section titled “type PollHarnessAuth200JSONResponse”type PollHarnessAuth200JSONResponse HarnessAuthStatusfunc (PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse
Section titled “func (PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse”func (response PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) errortype PollHarnessAuth400JSONResponse
Section titled “type PollHarnessAuth400JSONResponse”type PollHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }func (PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse
Section titled “func (PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse”func (response PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) errortype PollHarnessAuth401JSONResponse
Section titled “type PollHarnessAuth401JSONResponse”type PollHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }func (PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse
Section titled “func (PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse”func (response PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) errortype PollHarnessAuth404JSONResponse
Section titled “type PollHarnessAuth404JSONResponse”type PollHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }func (PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse
Section titled “func (PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse”func (response PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) errortype PollHarnessAuth500JSONResponse
Section titled “type PollHarnessAuth500JSONResponse”type PollHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }func (PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse
Section titled “func (PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse”func (response PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) errortype PollHarnessAuthJSONRequestBody
Section titled “type PollHarnessAuthJSONRequestBody”PollHarnessAuthJSONRequestBody defines body for PollHarnessAuth for application/json ContentType.
type PollHarnessAuthJSONRequestBody = HarnessRequesttype PollHarnessAuthRequestObject
Section titled “type PollHarnessAuthRequestObject”type PollHarnessAuthRequestObject struct { Body *PollHarnessAuthJSONRequestBody}type PollHarnessAuthResponseObject
Section titled “type PollHarnessAuthResponseObject”type PollHarnessAuthResponseObject interface { VisitPollHarnessAuthResponse(w http.ResponseWriter) error}type PromptChat202JSONResponse
Section titled “type PromptChat202JSONResponse”type PromptChat202JSONResponse AcceptedResponsefunc (PromptChat202JSONResponse) VisitPromptChatResponse
Section titled “func (PromptChat202JSONResponse) VisitPromptChatResponse”func (response PromptChat202JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) errortype PromptChat400JSONResponse
Section titled “type PromptChat400JSONResponse”type PromptChat400JSONResponse struct{ BadRequestJSONResponse }func (PromptChat400JSONResponse) VisitPromptChatResponse
Section titled “func (PromptChat400JSONResponse) VisitPromptChatResponse”func (response PromptChat400JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) errortype PromptChat401JSONResponse
Section titled “type PromptChat401JSONResponse”type PromptChat401JSONResponse struct{ UnauthorizedJSONResponse }func (PromptChat401JSONResponse) VisitPromptChatResponse
Section titled “func (PromptChat401JSONResponse) VisitPromptChatResponse”func (response PromptChat401JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) errortype PromptChat404JSONResponse
Section titled “type PromptChat404JSONResponse”type PromptChat404JSONResponse struct{ NotFoundJSONResponse }func (PromptChat404JSONResponse) VisitPromptChatResponse
Section titled “func (PromptChat404JSONResponse) VisitPromptChatResponse”func (response PromptChat404JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) errortype PromptChat503JSONResponse
Section titled “type PromptChat503JSONResponse”type PromptChat503JSONResponse struct{ UnavailableJSONResponse }func (PromptChat503JSONResponse) VisitPromptChatResponse
Section titled “func (PromptChat503JSONResponse) VisitPromptChatResponse”func (response PromptChat503JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) errortype PromptChatJSONRequestBody
Section titled “type PromptChatJSONRequestBody”PromptChatJSONRequestBody defines body for PromptChat for application/json ContentType.
type PromptChatJSONRequestBody = PromptRequesttype PromptChatRequestObject
Section titled “type PromptChatRequestObject”type PromptChatRequestObject struct { ChatId ChatId `json:"chatId"` Body *PromptChatJSONRequestBody}type PromptChatResponseObject
Section titled “type PromptChatResponseObject”type PromptChatResponseObject interface { VisitPromptChatResponse(w http.ResponseWriter) error}type PromptRequest
Section titled “type PromptRequest”PromptRequest defines model for PromptRequest.
type PromptRequest struct { // MessageId Client-generated unique identifier for this user message, echoed back into the AG-UI event stream so it survives reconnect/cache-replay. Optional for backward compatibility with older clients. MessageId *openapi_types.UUID `json:"messageId,omitempty"` Prompt []ContentBlock `json:"prompt"`}type ProxyObservability200AsteriskResponse
Section titled “type ProxyObservability200AsteriskResponse”type ProxyObservability200AsteriskResponse struct { Body io.Reader ContentType string ContentLength int64}func (ProxyObservability200AsteriskResponse) VisitProxyObservabilityResponse
Section titled “func (ProxyObservability200AsteriskResponse) VisitProxyObservabilityResponse”func (response ProxyObservability200AsteriskResponse) VisitProxyObservabilityResponse(w http.ResponseWriter) errortype ProxyObservability401JSONResponse
Section titled “type ProxyObservability401JSONResponse”type ProxyObservability401JSONResponse struct{ UnauthorizedJSONResponse }func (ProxyObservability401JSONResponse) VisitProxyObservabilityResponse
Section titled “func (ProxyObservability401JSONResponse) VisitProxyObservabilityResponse”func (response ProxyObservability401JSONResponse) VisitProxyObservabilityResponse(w http.ResponseWriter) errortype ProxyObservability403JSONResponse
Section titled “type ProxyObservability403JSONResponse”type ProxyObservability403JSONResponse struct{ ForbiddenJSONResponse }func (ProxyObservability403JSONResponse) VisitProxyObservabilityResponse
Section titled “func (ProxyObservability403JSONResponse) VisitProxyObservabilityResponse”func (response ProxyObservability403JSONResponse) VisitProxyObservabilityResponse(w http.ResponseWriter) errortype ProxyObservabilityRequestObject
Section titled “type ProxyObservabilityRequestObject”type ProxyObservabilityRequestObject struct { Path string `json:"path"`}type ProxyObservabilityResponseObject
Section titled “type ProxyObservabilityResponseObject”type ProxyObservabilityResponseObject interface { VisitProxyObservabilityResponse(w http.ResponseWriter) error}type PullOllamaModel200ApplicationxNdjsonResponse
Section titled “type PullOllamaModel200ApplicationxNdjsonResponse”type PullOllamaModel200ApplicationxNdjsonResponse struct { Body io.Reader ContentLength int64}func (PullOllamaModel200ApplicationxNdjsonResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel200ApplicationxNdjsonResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel200ApplicationxNdjsonResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModel400JSONResponse
Section titled “type PullOllamaModel400JSONResponse”type PullOllamaModel400JSONResponse struct{ BadRequestJSONResponse }func (PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModel401JSONResponse
Section titled “type PullOllamaModel401JSONResponse”type PullOllamaModel401JSONResponse struct{ UnauthorizedJSONResponse }func (PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModel403JSONResponse
Section titled “type PullOllamaModel403JSONResponse”type PullOllamaModel403JSONResponse struct{ ForbiddenJSONResponse }func (PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModel502JSONResponse
Section titled “type PullOllamaModel502JSONResponse”type PullOllamaModel502JSONResponse struct{ BadGatewayJSONResponse }func (PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModel503JSONResponse
Section titled “type PullOllamaModel503JSONResponse”type PullOllamaModel503JSONResponse struct{ UnavailableJSONResponse }func (PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse
Section titled “func (PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse”func (response PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) errortype PullOllamaModelJSONRequestBody
Section titled “type PullOllamaModelJSONRequestBody”PullOllamaModelJSONRequestBody defines body for PullOllamaModel for application/json ContentType.
type PullOllamaModelJSONRequestBody = ModelRequesttype PullOllamaModelRequestObject
Section titled “type PullOllamaModelRequestObject”type PullOllamaModelRequestObject struct { Body *PullOllamaModelJSONRequestBody}type PullOllamaModelResponseObject
Section titled “type PullOllamaModelResponseObject”type PullOllamaModelResponseObject interface { VisitPullOllamaModelResponse(w http.ResponseWriter) error}type PushRequest
Section titled “type PushRequest”PushRequest defines model for PushRequest.
type PushRequest struct { Chat *string `json:"chat,omitempty"` Message *string `json:"message,omitempty"` Title *string `json:"title,omitempty"` Type string `json:"type"` UserId string `json:"user_id"`}type ReleaseCompatibilityResponse
Section titled “type ReleaseCompatibilityResponse”ReleaseCompatibilityResponse defines model for ReleaseCompatibilityResponse.
type ReleaseCompatibilityResponse struct { Compatibility map[string]interface{} `json:"compatibility"` DataVersion int `json:"dataVersion"` SchemaVersion int `json:"schemaVersion"`}type ReleaseStatusResponse
Section titled “type ReleaseStatusResponse”ReleaseStatusResponse defines model for ReleaseStatusResponse.
type ReleaseStatusResponse struct { Current struct { Compatibility *map[string]interface{} `json:"compatibility,omitempty"` DataVersion *int `json:"dataVersion,omitempty"` DeploymentContractVersion *int `json:"deploymentContractVersion,omitempty"` ReleaseDigest *string `json:"releaseDigest,omitempty"` SelectedHarnesses *[]string `json:"selectedHarnesses,omitempty"` ServerVersion *string `json:"serverVersion,omitempty"` SourceCommit *string `json:"sourceCommit,omitempty"` } `json:"current"` MetadataStatus map[string]interface{} `json:"metadataStatus"` SchemaVersion int `json:"schemaVersion"`}type RequestId
Section titled “type RequestId”RequestId defines model for RequestId.
type RequestId = stringtype RequiredHeaderError
Section titled “type RequiredHeaderError”type RequiredHeaderError struct { ParamName string Err error}func (*RequiredHeaderError) Error
Section titled “func (*RequiredHeaderError) Error”func (e *RequiredHeaderError) Error() stringfunc (*RequiredHeaderError) Unwrap
Section titled “func (*RequiredHeaderError) Unwrap”func (e *RequiredHeaderError) Unwrap() errortype RequiredParamError
Section titled “type RequiredParamError”type RequiredParamError struct { ParamName string}func (*RequiredParamError) Error
Section titled “func (*RequiredParamError) Error”func (e *RequiredParamError) Error() stringtype RespondToElicitation202Response
Section titled “type RespondToElicitation202Response”type RespondToElicitation202Response struct {}func (RespondToElicitation202Response) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation202Response) VisitRespondToElicitationResponse”func (response RespondToElicitation202Response) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitation400JSONResponse
Section titled “type RespondToElicitation400JSONResponse”type RespondToElicitation400JSONResponse struct{ BadRequestJSONResponse }func (RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse”func (response RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitation401JSONResponse
Section titled “type RespondToElicitation401JSONResponse”type RespondToElicitation401JSONResponse struct{ UnauthorizedJSONResponse }func (RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse”func (response RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitation404JSONResponse
Section titled “type RespondToElicitation404JSONResponse”type RespondToElicitation404JSONResponse struct{ NotFoundJSONResponse }func (RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse”func (response RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitation502JSONResponse
Section titled “type RespondToElicitation502JSONResponse”type RespondToElicitation502JSONResponse struct{ BadGatewayJSONResponse }func (RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse”func (response RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitation503JSONResponse
Section titled “type RespondToElicitation503JSONResponse”type RespondToElicitation503JSONResponse struct{ UnavailableJSONResponse }func (RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse
Section titled “func (RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse”func (response RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) errortype RespondToElicitationJSONRequestBody
Section titled “type RespondToElicitationJSONRequestBody”RespondToElicitationJSONRequestBody defines body for RespondToElicitation for application/json ContentType.
type RespondToElicitationJSONRequestBody = DecisionRequesttype RespondToElicitationRequestObject
Section titled “type RespondToElicitationRequestObject”type RespondToElicitationRequestObject struct { ChatId ChatId `json:"chatId"` Id RequestId `json:"id"` Body *RespondToElicitationJSONRequestBody}type RespondToElicitationResponseObject
Section titled “type RespondToElicitationResponseObject”type RespondToElicitationResponseObject interface { VisitRespondToElicitationResponse(w http.ResponseWriter) error}type RespondToPermission202Response
Section titled “type RespondToPermission202Response”type RespondToPermission202Response struct {}func (RespondToPermission202Response) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission202Response) VisitRespondToPermissionResponse”func (response RespondToPermission202Response) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermission400JSONResponse
Section titled “type RespondToPermission400JSONResponse”type RespondToPermission400JSONResponse struct{ BadRequestJSONResponse }func (RespondToPermission400JSONResponse) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission400JSONResponse) VisitRespondToPermissionResponse”func (response RespondToPermission400JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermission401JSONResponse
Section titled “type RespondToPermission401JSONResponse”type RespondToPermission401JSONResponse struct{ UnauthorizedJSONResponse }func (RespondToPermission401JSONResponse) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission401JSONResponse) VisitRespondToPermissionResponse”func (response RespondToPermission401JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermission404JSONResponse
Section titled “type RespondToPermission404JSONResponse”type RespondToPermission404JSONResponse struct{ NotFoundJSONResponse }func (RespondToPermission404JSONResponse) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission404JSONResponse) VisitRespondToPermissionResponse”func (response RespondToPermission404JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermission502JSONResponse
Section titled “type RespondToPermission502JSONResponse”type RespondToPermission502JSONResponse struct{ BadGatewayJSONResponse }func (RespondToPermission502JSONResponse) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission502JSONResponse) VisitRespondToPermissionResponse”func (response RespondToPermission502JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermission503JSONResponse
Section titled “type RespondToPermission503JSONResponse”type RespondToPermission503JSONResponse struct{ UnavailableJSONResponse }func (RespondToPermission503JSONResponse) VisitRespondToPermissionResponse
Section titled “func (RespondToPermission503JSONResponse) VisitRespondToPermissionResponse”func (response RespondToPermission503JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) errortype RespondToPermissionJSONRequestBody
Section titled “type RespondToPermissionJSONRequestBody”RespondToPermissionJSONRequestBody defines body for RespondToPermission for application/json ContentType.
type RespondToPermissionJSONRequestBody = DecisionRequesttype RespondToPermissionRequestObject
Section titled “type RespondToPermissionRequestObject”type RespondToPermissionRequestObject struct { ChatId ChatId `json:"chatId"` Id RequestId `json:"id"` Body *RespondToPermissionJSONRequestBody}type RespondToPermissionResponseObject
Section titled “type RespondToPermissionResponseObject”type RespondToPermissionResponseObject interface { VisitRespondToPermissionResponse(w http.ResponseWriter) error}type RunScheduleNow202JSONResponse
Section titled “type RunScheduleNow202JSONResponse”type RunScheduleNow202JSONResponse ScheduleRunAcceptedResponsefunc (RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse
Section titled “func (RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse”func (response RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) errortype RunScheduleNow400JSONResponse
Section titled “type RunScheduleNow400JSONResponse”type RunScheduleNow400JSONResponse struct{ BadRequestJSONResponse }func (RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse
Section titled “func (RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse”func (response RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) errortype RunScheduleNow401JSONResponse
Section titled “type RunScheduleNow401JSONResponse”type RunScheduleNow401JSONResponse struct{ UnauthorizedJSONResponse }func (RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse
Section titled “func (RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse”func (response RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) errortype RunScheduleNow404JSONResponse
Section titled “type RunScheduleNow404JSONResponse”type RunScheduleNow404JSONResponse struct{ NotFoundJSONResponse }func (RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse
Section titled “func (RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse”func (response RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) errortype RunScheduleNowRequestObject
Section titled “type RunScheduleNowRequestObject”type RunScheduleNowRequestObject struct { ScheduleId string `json:"scheduleId"`}type RunScheduleNowResponseObject
Section titled “type RunScheduleNowResponseObject”type RunScheduleNowResponseObject interface { VisitRunScheduleNowResponse(w http.ResponseWriter) error}type ScheduleRunAcceptedResponse
Section titled “type ScheduleRunAcceptedResponse”ScheduleRunAcceptedResponse defines model for ScheduleRunAcceptedResponse.
type ScheduleRunAcceptedResponse struct { Status ScheduleRunAcceptedResponseStatus `json:"status"`}type ScheduleRunAcceptedResponseStatus
Section titled “type ScheduleRunAcceptedResponseStatus”ScheduleRunAcceptedResponseStatus defines model for ScheduleRunAcceptedResponse.Status.
type ScheduleRunAcceptedResponseStatus stringDefines values for ScheduleRunAcceptedResponseStatus.
const ( Started ScheduleRunAcceptedResponseStatus = "started")func (ScheduleRunAcceptedResponseStatus) Valid
Section titled “func (ScheduleRunAcceptedResponseStatus) Valid”func (e ScheduleRunAcceptedResponseStatus) Valid() boolValid indicates whether the value is a known member of the ScheduleRunAcceptedResponseStatus enum.
type SendPushNotification200JSONResponse
Section titled “type SendPushNotification200JSONResponse”type SendPushNotification200JSONResponse OkResponsefunc (SendPushNotification200JSONResponse) VisitSendPushNotificationResponse
Section titled “func (SendPushNotification200JSONResponse) VisitSendPushNotificationResponse”func (response SendPushNotification200JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) errortype SendPushNotification204Response
Section titled “type SendPushNotification204Response”type SendPushNotification204Response struct {}func (SendPushNotification204Response) VisitSendPushNotificationResponse
Section titled “func (SendPushNotification204Response) VisitSendPushNotificationResponse”func (response SendPushNotification204Response) VisitSendPushNotificationResponse(w http.ResponseWriter) errortype SendPushNotification400JSONResponse
Section titled “type SendPushNotification400JSONResponse”type SendPushNotification400JSONResponse struct{ BadRequestJSONResponse }func (SendPushNotification400JSONResponse) VisitSendPushNotificationResponse
Section titled “func (SendPushNotification400JSONResponse) VisitSendPushNotificationResponse”func (response SendPushNotification400JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) errortype SendPushNotification401JSONResponse
Section titled “type SendPushNotification401JSONResponse”type SendPushNotification401JSONResponse struct{ UnauthorizedJSONResponse }func (SendPushNotification401JSONResponse) VisitSendPushNotificationResponse
Section titled “func (SendPushNotification401JSONResponse) VisitSendPushNotificationResponse”func (response SendPushNotification401JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) errortype SendPushNotification404JSONResponse
Section titled “type SendPushNotification404JSONResponse”type SendPushNotification404JSONResponse struct{ NotFoundJSONResponse }func (SendPushNotification404JSONResponse) VisitSendPushNotificationResponse
Section titled “func (SendPushNotification404JSONResponse) VisitSendPushNotificationResponse”func (response SendPushNotification404JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) errortype SendPushNotificationJSONRequestBody
Section titled “type SendPushNotificationJSONRequestBody”SendPushNotificationJSONRequestBody defines body for SendPushNotification for application/json ContentType.
type SendPushNotificationJSONRequestBody = PushRequesttype SendPushNotificationRequestObject
Section titled “type SendPushNotificationRequestObject”type SendPushNotificationRequestObject struct { Body *SendPushNotificationJSONRequestBody}type SendPushNotificationResponseObject
Section titled “type SendPushNotificationResponseObject”type SendPushNotificationResponseObject interface { VisitSendPushNotificationResponse(w http.ResponseWriter) error}type ServeMux
Section titled “type ServeMux”ServeMux is an abstraction of http.ServeMux.
type ServeMux interface { HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) http.Handler}type ServerInterface
Section titled “type ServerInterface”ServerInterface represents all server handlers.
type ServerInterface interface {
// (POST /api/pocketcoder/v1/chats/{chatId}/session/cancel) CancelChatSession(w http.ResponseWriter, r *http.Request, chatId ChatId)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/elicitation/{id}) RespondToElicitation(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/prompt) PromptChat(w http.ResponseWriter, r *http.Request, chatId ChatId)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/request-permission/{id}) RespondToPermission(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/set-config-option) SetChatConfigOption(w http.ResponseWriter, r *http.Request, chatId ChatId)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/set-mode) SetChatMode(w http.ResponseWriter, r *http.Request, chatId ChatId)
// (GET /api/pocketcoder/v1/chats/{chatId}/stream) StreamChatEvents(w http.ResponseWriter, r *http.Request, chatId ChatId, params StreamChatEventsParams)
// (GET /api/pocketcoder/v1/compatibility) GetReleaseCompatibility(w http.ResponseWriter, r *http.Request)
// (GET /api/pocketcoder/v1/containers) ListContainers(w http.ResponseWriter, r *http.Request)
// (GET /api/pocketcoder/v1/files) GetWorkspaceFile(w http.ResponseWriter, r *http.Request, params GetWorkspaceFileParams)
// (GET /api/pocketcoder/v1/files-tree) ListWorkspaceFileTree(w http.ResponseWriter, r *http.Request, params ListWorkspaceFileTreeParams)
// (POST /api/pocketcoder/v1/harness-auth/cancel) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/harness-auth/disconnect) DisconnectHarnessAuth(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/harness-auth/poll) PollHarnessAuth(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/harness-auth/start) StartHarnessAuth(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/harness-auth/status) GetHarnessAuthStatus(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/harness-auth/submit) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/live-activities/{id}/end) EndLiveActivity(w http.ResponseWriter, r *http.Request, id RequestId)
// (POST /api/pocketcoder/v1/live-activities/{id}/token) SetLiveActivityToken(w http.ResponseWriter, r *http.Request, id RequestId)
// (GET /api/pocketcoder/v1/logs/instance/{id}) GetHarnessInstanceLogs(w http.ResponseWriter, r *http.Request, id string)
// (GET /api/pocketcoder/v1/logs/{containerName}) StreamContainerLogs(w http.ResponseWriter, r *http.Request, containerName ContainerName)
// (POST /api/pocketcoder/v1/mcp/oauth/store) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/mcp/request) ExecuteMcpRequest(w http.ResponseWriter, r *http.Request)
// (GET /api/pocketcoder/v1/ollama/models) ListOllamaModels(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/ollama/pull) PullOllamaModel(w http.ResponseWriter, r *http.Request)
// (DELETE /api/pocketcoder/v1/pro-data) DeleteProData(w http.ResponseWriter, r *http.Request)
// (GET /api/pocketcoder/v1/proxy/observability/{path}) ProxyObservability(w http.ResponseWriter, r *http.Request, path string)
// (POST /api/pocketcoder/v1/push) SendPushNotification(w http.ResponseWriter, r *http.Request)
// (GET /api/pocketcoder/v1/release/status) GetReleaseStatus(w http.ResponseWriter, r *http.Request)
// (POST /api/pocketcoder/v1/schedules/{scheduleId}/run) RunScheduleNow(w http.ResponseWriter, r *http.Request, scheduleId string)}func NewStrictHandler
Section titled “func NewStrictHandler”func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterfacefunc NewStrictHandlerWithOptions
Section titled “func NewStrictHandlerWithOptions”func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterfacetype ServerInterfaceWrapper
Section titled “type ServerInterfaceWrapper”ServerInterfaceWrapper converts contexts to parameters.
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)}func (*ServerInterfaceWrapper) CancelChatSession
Section titled “func (*ServerInterfaceWrapper) CancelChatSession”func (siw *ServerInterfaceWrapper) CancelChatSession(w http.ResponseWriter, r *http.Request)CancelChatSession operation middleware
func (*ServerInterfaceWrapper) CancelHarnessAuth
Section titled “func (*ServerInterfaceWrapper) CancelHarnessAuth”func (siw *ServerInterfaceWrapper) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)CancelHarnessAuth operation middleware
func (*ServerInterfaceWrapper) DeleteProData
Section titled “func (*ServerInterfaceWrapper) DeleteProData”func (siw *ServerInterfaceWrapper) DeleteProData(w http.ResponseWriter, r *http.Request)DeleteProData operation middleware
func (*ServerInterfaceWrapper) DisconnectHarnessAuth
Section titled “func (*ServerInterfaceWrapper) DisconnectHarnessAuth”func (siw *ServerInterfaceWrapper) DisconnectHarnessAuth(w http.ResponseWriter, r *http.Request)DisconnectHarnessAuth operation middleware
func (*ServerInterfaceWrapper) EndLiveActivity
Section titled “func (*ServerInterfaceWrapper) EndLiveActivity”func (siw *ServerInterfaceWrapper) EndLiveActivity(w http.ResponseWriter, r *http.Request)EndLiveActivity operation middleware
func (*ServerInterfaceWrapper) ExecuteMcpRequest
Section titled “func (*ServerInterfaceWrapper) ExecuteMcpRequest”func (siw *ServerInterfaceWrapper) ExecuteMcpRequest(w http.ResponseWriter, r *http.Request)ExecuteMcpRequest operation middleware
func (*ServerInterfaceWrapper) GetHarnessAuthStatus
Section titled “func (*ServerInterfaceWrapper) GetHarnessAuthStatus”func (siw *ServerInterfaceWrapper) GetHarnessAuthStatus(w http.ResponseWriter, r *http.Request)GetHarnessAuthStatus operation middleware
func (*ServerInterfaceWrapper) GetHarnessInstanceLogs
Section titled “func (*ServerInterfaceWrapper) GetHarnessInstanceLogs”func (siw *ServerInterfaceWrapper) GetHarnessInstanceLogs(w http.ResponseWriter, r *http.Request)GetHarnessInstanceLogs operation middleware
func (*ServerInterfaceWrapper) GetReleaseCompatibility
Section titled “func (*ServerInterfaceWrapper) GetReleaseCompatibility”func (siw *ServerInterfaceWrapper) GetReleaseCompatibility(w http.ResponseWriter, r *http.Request)GetReleaseCompatibility operation middleware
func (*ServerInterfaceWrapper) GetReleaseStatus
Section titled “func (*ServerInterfaceWrapper) GetReleaseStatus”func (siw *ServerInterfaceWrapper) GetReleaseStatus(w http.ResponseWriter, r *http.Request)GetReleaseStatus operation middleware
func (*ServerInterfaceWrapper) GetWorkspaceFile
Section titled “func (*ServerInterfaceWrapper) GetWorkspaceFile”func (siw *ServerInterfaceWrapper) GetWorkspaceFile(w http.ResponseWriter, r *http.Request)GetWorkspaceFile operation middleware
func (*ServerInterfaceWrapper) ListContainers
Section titled “func (*ServerInterfaceWrapper) ListContainers”func (siw *ServerInterfaceWrapper) ListContainers(w http.ResponseWriter, r *http.Request)ListContainers operation middleware
func (*ServerInterfaceWrapper) ListOllamaModels
Section titled “func (*ServerInterfaceWrapper) ListOllamaModels”func (siw *ServerInterfaceWrapper) ListOllamaModels(w http.ResponseWriter, r *http.Request)ListOllamaModels operation middleware
func (*ServerInterfaceWrapper) ListWorkspaceFileTree
Section titled “func (*ServerInterfaceWrapper) ListWorkspaceFileTree”func (siw *ServerInterfaceWrapper) ListWorkspaceFileTree(w http.ResponseWriter, r *http.Request)ListWorkspaceFileTree operation middleware
func (*ServerInterfaceWrapper) PollHarnessAuth
Section titled “func (*ServerInterfaceWrapper) PollHarnessAuth”func (siw *ServerInterfaceWrapper) PollHarnessAuth(w http.ResponseWriter, r *http.Request)PollHarnessAuth operation middleware
func (*ServerInterfaceWrapper) PromptChat
Section titled “func (*ServerInterfaceWrapper) PromptChat”func (siw *ServerInterfaceWrapper) PromptChat(w http.ResponseWriter, r *http.Request)PromptChat operation middleware
func (*ServerInterfaceWrapper) ProxyObservability
Section titled “func (*ServerInterfaceWrapper) ProxyObservability”func (siw *ServerInterfaceWrapper) ProxyObservability(w http.ResponseWriter, r *http.Request)ProxyObservability operation middleware
func (*ServerInterfaceWrapper) PullOllamaModel
Section titled “func (*ServerInterfaceWrapper) PullOllamaModel”func (siw *ServerInterfaceWrapper) PullOllamaModel(w http.ResponseWriter, r *http.Request)PullOllamaModel operation middleware
func (*ServerInterfaceWrapper) RespondToElicitation
Section titled “func (*ServerInterfaceWrapper) RespondToElicitation”func (siw *ServerInterfaceWrapper) RespondToElicitation(w http.ResponseWriter, r *http.Request)RespondToElicitation operation middleware
func (*ServerInterfaceWrapper) RespondToPermission
Section titled “func (*ServerInterfaceWrapper) RespondToPermission”func (siw *ServerInterfaceWrapper) RespondToPermission(w http.ResponseWriter, r *http.Request)RespondToPermission operation middleware
func (*ServerInterfaceWrapper) RunScheduleNow
Section titled “func (*ServerInterfaceWrapper) RunScheduleNow”func (siw *ServerInterfaceWrapper) RunScheduleNow(w http.ResponseWriter, r *http.Request)RunScheduleNow operation middleware
func (*ServerInterfaceWrapper) SendPushNotification
Section titled “func (*ServerInterfaceWrapper) SendPushNotification”func (siw *ServerInterfaceWrapper) SendPushNotification(w http.ResponseWriter, r *http.Request)SendPushNotification operation middleware
func (*ServerInterfaceWrapper) SetChatConfigOption
Section titled “func (*ServerInterfaceWrapper) SetChatConfigOption”func (siw *ServerInterfaceWrapper) SetChatConfigOption(w http.ResponseWriter, r *http.Request)SetChatConfigOption operation middleware
func (*ServerInterfaceWrapper) SetChatMode
Section titled “func (*ServerInterfaceWrapper) SetChatMode”func (siw *ServerInterfaceWrapper) SetChatMode(w http.ResponseWriter, r *http.Request)SetChatMode operation middleware
func (*ServerInterfaceWrapper) SetLiveActivityToken
Section titled “func (*ServerInterfaceWrapper) SetLiveActivityToken”func (siw *ServerInterfaceWrapper) SetLiveActivityToken(w http.ResponseWriter, r *http.Request)SetLiveActivityToken operation middleware
func (*ServerInterfaceWrapper) StartHarnessAuth
Section titled “func (*ServerInterfaceWrapper) StartHarnessAuth”func (siw *ServerInterfaceWrapper) StartHarnessAuth(w http.ResponseWriter, r *http.Request)StartHarnessAuth operation middleware
func (*ServerInterfaceWrapper) StoreMcpOAuthToken
Section titled “func (*ServerInterfaceWrapper) StoreMcpOAuthToken”func (siw *ServerInterfaceWrapper) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)StoreMcpOAuthToken operation middleware
func (*ServerInterfaceWrapper) StreamChatEvents
Section titled “func (*ServerInterfaceWrapper) StreamChatEvents”func (siw *ServerInterfaceWrapper) StreamChatEvents(w http.ResponseWriter, r *http.Request)StreamChatEvents operation middleware
func (*ServerInterfaceWrapper) StreamContainerLogs
Section titled “func (*ServerInterfaceWrapper) StreamContainerLogs”func (siw *ServerInterfaceWrapper) StreamContainerLogs(w http.ResponseWriter, r *http.Request)StreamContainerLogs operation middleware
func (*ServerInterfaceWrapper) SubmitHarnessAuth
Section titled “func (*ServerInterfaceWrapper) SubmitHarnessAuth”func (siw *ServerInterfaceWrapper) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)SubmitHarnessAuth operation middleware
type SetChatConfigOption202Response
Section titled “type SetChatConfigOption202Response”type SetChatConfigOption202Response struct {}func (SetChatConfigOption202Response) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption202Response) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption202Response) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOption400JSONResponse
Section titled “type SetChatConfigOption400JSONResponse”type SetChatConfigOption400JSONResponse struct{ BadRequestJSONResponse }func (SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOption401JSONResponse
Section titled “type SetChatConfigOption401JSONResponse”type SetChatConfigOption401JSONResponse struct{ UnauthorizedJSONResponse }func (SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOption404JSONResponse
Section titled “type SetChatConfigOption404JSONResponse”type SetChatConfigOption404JSONResponse struct{ NotFoundJSONResponse }func (SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOption502JSONResponse
Section titled “type SetChatConfigOption502JSONResponse”type SetChatConfigOption502JSONResponse struct{ BadGatewayJSONResponse }func (SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOption503JSONResponse
Section titled “type SetChatConfigOption503JSONResponse”type SetChatConfigOption503JSONResponse struct{ UnavailableJSONResponse }func (SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse
Section titled “func (SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse”func (response SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) errortype SetChatConfigOptionJSONRequestBody
Section titled “type SetChatConfigOptionJSONRequestBody”SetChatConfigOptionJSONRequestBody defines body for SetChatConfigOption for application/json ContentType.
type SetChatConfigOptionJSONRequestBody = ConfigOptionRequesttype SetChatConfigOptionRequestObject
Section titled “type SetChatConfigOptionRequestObject”type SetChatConfigOptionRequestObject struct { ChatId ChatId `json:"chatId"` Body *SetChatConfigOptionJSONRequestBody}type SetChatConfigOptionResponseObject
Section titled “type SetChatConfigOptionResponseObject”type SetChatConfigOptionResponseObject interface { VisitSetChatConfigOptionResponse(w http.ResponseWriter) error}type SetChatMode202Response
Section titled “type SetChatMode202Response”type SetChatMode202Response struct {}func (SetChatMode202Response) VisitSetChatModeResponse
Section titled “func (SetChatMode202Response) VisitSetChatModeResponse”func (response SetChatMode202Response) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatMode400JSONResponse
Section titled “type SetChatMode400JSONResponse”type SetChatMode400JSONResponse struct{ BadRequestJSONResponse }func (SetChatMode400JSONResponse) VisitSetChatModeResponse
Section titled “func (SetChatMode400JSONResponse) VisitSetChatModeResponse”func (response SetChatMode400JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatMode401JSONResponse
Section titled “type SetChatMode401JSONResponse”type SetChatMode401JSONResponse struct{ UnauthorizedJSONResponse }func (SetChatMode401JSONResponse) VisitSetChatModeResponse
Section titled “func (SetChatMode401JSONResponse) VisitSetChatModeResponse”func (response SetChatMode401JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatMode404JSONResponse
Section titled “type SetChatMode404JSONResponse”type SetChatMode404JSONResponse struct{ NotFoundJSONResponse }func (SetChatMode404JSONResponse) VisitSetChatModeResponse
Section titled “func (SetChatMode404JSONResponse) VisitSetChatModeResponse”func (response SetChatMode404JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatMode502JSONResponse
Section titled “type SetChatMode502JSONResponse”type SetChatMode502JSONResponse struct{ BadGatewayJSONResponse }func (SetChatMode502JSONResponse) VisitSetChatModeResponse
Section titled “func (SetChatMode502JSONResponse) VisitSetChatModeResponse”func (response SetChatMode502JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatMode503JSONResponse
Section titled “type SetChatMode503JSONResponse”type SetChatMode503JSONResponse struct{ UnavailableJSONResponse }func (SetChatMode503JSONResponse) VisitSetChatModeResponse
Section titled “func (SetChatMode503JSONResponse) VisitSetChatModeResponse”func (response SetChatMode503JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) errortype SetChatModeJSONRequestBody
Section titled “type SetChatModeJSONRequestBody”SetChatModeJSONRequestBody defines body for SetChatMode for application/json ContentType.
type SetChatModeJSONRequestBody = ModeRequesttype SetChatModeRequestObject
Section titled “type SetChatModeRequestObject”type SetChatModeRequestObject struct { ChatId ChatId `json:"chatId"` Body *SetChatModeJSONRequestBody}type SetChatModeResponseObject
Section titled “type SetChatModeResponseObject”type SetChatModeResponseObject interface { VisitSetChatModeResponse(w http.ResponseWriter) error}type SetLiveActivityToken200JSONResponse
Section titled “type SetLiveActivityToken200JSONResponse”type SetLiveActivityToken200JSONResponse OkResponsefunc (SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse
Section titled “func (SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse”func (response SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) errortype SetLiveActivityToken400JSONResponse
Section titled “type SetLiveActivityToken400JSONResponse”type SetLiveActivityToken400JSONResponse struct{ BadRequestJSONResponse }func (SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse
Section titled “func (SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse”func (response SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) errortype SetLiveActivityToken401JSONResponse
Section titled “type SetLiveActivityToken401JSONResponse”type SetLiveActivityToken401JSONResponse struct{ UnauthorizedJSONResponse }func (SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse
Section titled “func (SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse”func (response SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) errortype SetLiveActivityToken404JSONResponse
Section titled “type SetLiveActivityToken404JSONResponse”type SetLiveActivityToken404JSONResponse struct{ NotFoundJSONResponse }func (SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse
Section titled “func (SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse”func (response SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) errortype SetLiveActivityToken409Response
Section titled “type SetLiveActivityToken409Response”type SetLiveActivityToken409Response struct {}func (SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse
Section titled “func (SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse”func (response SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) errortype SetLiveActivityTokenJSONRequestBody
Section titled “type SetLiveActivityTokenJSONRequestBody”SetLiveActivityTokenJSONRequestBody defines body for SetLiveActivityToken for application/json ContentType.
type SetLiveActivityTokenJSONRequestBody = SetLiveActivityTokenRequesttype SetLiveActivityTokenRequest
Section titled “type SetLiveActivityTokenRequest”SetLiveActivityTokenRequest defines model for SetLiveActivityTokenRequest.
type SetLiveActivityTokenRequest struct { ActivityPushToken string `json:"activity_push_token"`}type SetLiveActivityTokenRequestObject
Section titled “type SetLiveActivityTokenRequestObject”type SetLiveActivityTokenRequestObject struct { Id RequestId `json:"id"` Body *SetLiveActivityTokenJSONRequestBody}type SetLiveActivityTokenResponseObject
Section titled “type SetLiveActivityTokenResponseObject”type SetLiveActivityTokenResponseObject interface { VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error}type StartHarnessAuth200JSONResponse
Section titled “type StartHarnessAuth200JSONResponse”type StartHarnessAuth200JSONResponse HarnessAuthStatusfunc (StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse
Section titled “func (StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse”func (response StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) errortype StartHarnessAuth400JSONResponse
Section titled “type StartHarnessAuth400JSONResponse”type StartHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }func (StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse
Section titled “func (StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse”func (response StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) errortype StartHarnessAuth401JSONResponse
Section titled “type StartHarnessAuth401JSONResponse”type StartHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }func (StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse
Section titled “func (StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse”func (response StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) errortype StartHarnessAuth404JSONResponse
Section titled “type StartHarnessAuth404JSONResponse”type StartHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }func (StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse
Section titled “func (StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse”func (response StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) errortype StartHarnessAuth500JSONResponse
Section titled “type StartHarnessAuth500JSONResponse”type StartHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }func (StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse
Section titled “func (StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse”func (response StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) errortype StartHarnessAuthJSONRequestBody
Section titled “type StartHarnessAuthJSONRequestBody”StartHarnessAuthJSONRequestBody defines body for StartHarnessAuth for application/json ContentType.
type StartHarnessAuthJSONRequestBody = HarnessRequesttype StartHarnessAuthRequestObject
Section titled “type StartHarnessAuthRequestObject”type StartHarnessAuthRequestObject struct { Body *StartHarnessAuthJSONRequestBody}type StartHarnessAuthResponseObject
Section titled “type StartHarnessAuthResponseObject”type StartHarnessAuthResponseObject interface { VisitStartHarnessAuthResponse(w http.ResponseWriter) error}type StdHTTPServerOptions
Section titled “type StdHTTPServerOptions”type StdHTTPServerOptions struct { BaseURL string BaseRouter ServeMux Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)}type StoreMcpOAuthToken200JSONResponse
Section titled “type StoreMcpOAuthToken200JSONResponse”type StoreMcpOAuthToken200JSONResponse StoreMcpOAuthTokenResponsefunc (StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse
Section titled “func (StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse”func (response StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) errortype StoreMcpOAuthToken400JSONResponse
Section titled “type StoreMcpOAuthToken400JSONResponse”type StoreMcpOAuthToken400JSONResponse struct{ BadRequestJSONResponse }func (StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse
Section titled “func (StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse”func (response StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) errortype StoreMcpOAuthToken401JSONResponse
Section titled “type StoreMcpOAuthToken401JSONResponse”type StoreMcpOAuthToken401JSONResponse struct{ UnauthorizedJSONResponse }func (StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse
Section titled “func (StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse”func (response StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) errortype StoreMcpOAuthToken404JSONResponse
Section titled “type StoreMcpOAuthToken404JSONResponse”type StoreMcpOAuthToken404JSONResponse struct{ NotFoundJSONResponse }func (StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse
Section titled “func (StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse”func (response StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) errortype StoreMcpOAuthToken500JSONResponse
Section titled “type StoreMcpOAuthToken500JSONResponse”type StoreMcpOAuthToken500JSONResponse struct{ InternalErrorJSONResponse }func (StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse
Section titled “func (StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse”func (response StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) errortype StoreMcpOAuthTokenJSONRequestBody
Section titled “type StoreMcpOAuthTokenJSONRequestBody”StoreMcpOAuthTokenJSONRequestBody defines body for StoreMcpOAuthToken for application/json ContentType.
type StoreMcpOAuthTokenJSONRequestBody = McpOAuthRequesttype StoreMcpOAuthTokenRequestObject
Section titled “type StoreMcpOAuthTokenRequestObject”type StoreMcpOAuthTokenRequestObject struct { Body *StoreMcpOAuthTokenJSONRequestBody}type StoreMcpOAuthTokenResponse
Section titled “type StoreMcpOAuthTokenResponse”StoreMcpOAuthTokenResponse defines model for StoreMcpOAuthTokenResponse.
type StoreMcpOAuthTokenResponse struct { Stored bool `json:"stored"`}type StoreMcpOAuthTokenResponseObject
Section titled “type StoreMcpOAuthTokenResponseObject”type StoreMcpOAuthTokenResponseObject interface { VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error}type StreamChatEvents200TexteventStreamResponse
Section titled “type StreamChatEvents200TexteventStreamResponse”type StreamChatEvents200TexteventStreamResponse struct { Body io.Reader ContentLength int64}func (StreamChatEvents200TexteventStreamResponse) VisitStreamChatEventsResponse
Section titled “func (StreamChatEvents200TexteventStreamResponse) VisitStreamChatEventsResponse”func (response StreamChatEvents200TexteventStreamResponse) VisitStreamChatEventsResponse(w http.ResponseWriter) errortype StreamChatEvents401JSONResponse
Section titled “type StreamChatEvents401JSONResponse”type StreamChatEvents401JSONResponse struct{ UnauthorizedJSONResponse }func (StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse
Section titled “func (StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse”func (response StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse(w http.ResponseWriter) errortype StreamChatEvents404JSONResponse
Section titled “type StreamChatEvents404JSONResponse”type StreamChatEvents404JSONResponse struct{ NotFoundJSONResponse }func (StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse
Section titled “func (StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse”func (response StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse(w http.ResponseWriter) errortype StreamChatEventsParams
Section titled “type StreamChatEventsParams”StreamChatEventsParams defines parameters for StreamChatEvents.
type StreamChatEventsParams struct { Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`}type StreamChatEventsRequestObject
Section titled “type StreamChatEventsRequestObject”type StreamChatEventsRequestObject struct { ChatId ChatId `json:"chatId"` Params StreamChatEventsParams}type StreamChatEventsResponseObject
Section titled “type StreamChatEventsResponseObject”type StreamChatEventsResponseObject interface { VisitStreamChatEventsResponse(w http.ResponseWriter) error}type StreamContainerLogs200TexteventStreamResponse
Section titled “type StreamContainerLogs200TexteventStreamResponse”type StreamContainerLogs200TexteventStreamResponse struct { Body io.Reader ContentLength int64}func (StreamContainerLogs200TexteventStreamResponse) VisitStreamContainerLogsResponse
Section titled “func (StreamContainerLogs200TexteventStreamResponse) VisitStreamContainerLogsResponse”func (response StreamContainerLogs200TexteventStreamResponse) VisitStreamContainerLogsResponse(w http.ResponseWriter) errortype StreamContainerLogs401JSONResponse
Section titled “type StreamContainerLogs401JSONResponse”type StreamContainerLogs401JSONResponse struct{ UnauthorizedJSONResponse }func (StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse
Section titled “func (StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse”func (response StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse(w http.ResponseWriter) errortype StreamContainerLogs404JSONResponse
Section titled “type StreamContainerLogs404JSONResponse”type StreamContainerLogs404JSONResponse struct{ NotFoundJSONResponse }func (StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse
Section titled “func (StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse”func (response StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse(w http.ResponseWriter) errortype StreamContainerLogsRequestObject
Section titled “type StreamContainerLogsRequestObject”type StreamContainerLogsRequestObject struct { ContainerName ContainerName `json:"containerName"`}type StreamContainerLogsResponseObject
Section titled “type StreamContainerLogsResponseObject”type StreamContainerLogsResponseObject interface { VisitStreamContainerLogsResponse(w http.ResponseWriter) error}type StrictHTTPServerOptions
Section titled “type StrictHTTPServerOptions”type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)}type StrictHandlerFunc
Section titled “type StrictHandlerFunc”type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)type StrictMiddlewareFunc
Section titled “type StrictMiddlewareFunc”type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunctype StrictServerInterface
Section titled “type StrictServerInterface”StrictServerInterface represents all server handlers.
type StrictServerInterface interface {
// (POST /api/pocketcoder/v1/chats/{chatId}/session/cancel) CancelChatSession(ctx context.Context, request CancelChatSessionRequestObject) (CancelChatSessionResponseObject, error)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/elicitation/{id}) RespondToElicitation(ctx context.Context, request RespondToElicitationRequestObject) (RespondToElicitationResponseObject, error)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/prompt) PromptChat(ctx context.Context, request PromptChatRequestObject) (PromptChatResponseObject, error)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/request-permission/{id}) RespondToPermission(ctx context.Context, request RespondToPermissionRequestObject) (RespondToPermissionResponseObject, error)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/set-config-option) SetChatConfigOption(ctx context.Context, request SetChatConfigOptionRequestObject) (SetChatConfigOptionResponseObject, error)
// (POST /api/pocketcoder/v1/chats/{chatId}/session/set-mode) SetChatMode(ctx context.Context, request SetChatModeRequestObject) (SetChatModeResponseObject, error)
// (GET /api/pocketcoder/v1/chats/{chatId}/stream) StreamChatEvents(ctx context.Context, request StreamChatEventsRequestObject) (StreamChatEventsResponseObject, error)
// (GET /api/pocketcoder/v1/compatibility) GetReleaseCompatibility(ctx context.Context, request GetReleaseCompatibilityRequestObject) (GetReleaseCompatibilityResponseObject, error)
// (GET /api/pocketcoder/v1/containers) ListContainers(ctx context.Context, request ListContainersRequestObject) (ListContainersResponseObject, error)
// (GET /api/pocketcoder/v1/files) GetWorkspaceFile(ctx context.Context, request GetWorkspaceFileRequestObject) (GetWorkspaceFileResponseObject, error)
// (GET /api/pocketcoder/v1/files-tree) ListWorkspaceFileTree(ctx context.Context, request ListWorkspaceFileTreeRequestObject) (ListWorkspaceFileTreeResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/cancel) CancelHarnessAuth(ctx context.Context, request CancelHarnessAuthRequestObject) (CancelHarnessAuthResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/disconnect) DisconnectHarnessAuth(ctx context.Context, request DisconnectHarnessAuthRequestObject) (DisconnectHarnessAuthResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/poll) PollHarnessAuth(ctx context.Context, request PollHarnessAuthRequestObject) (PollHarnessAuthResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/start) StartHarnessAuth(ctx context.Context, request StartHarnessAuthRequestObject) (StartHarnessAuthResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/status) GetHarnessAuthStatus(ctx context.Context, request GetHarnessAuthStatusRequestObject) (GetHarnessAuthStatusResponseObject, error)
// (POST /api/pocketcoder/v1/harness-auth/submit) SubmitHarnessAuth(ctx context.Context, request SubmitHarnessAuthRequestObject) (SubmitHarnessAuthResponseObject, error)
// (POST /api/pocketcoder/v1/live-activities/{id}/end) EndLiveActivity(ctx context.Context, request EndLiveActivityRequestObject) (EndLiveActivityResponseObject, error)
// (POST /api/pocketcoder/v1/live-activities/{id}/token) SetLiveActivityToken(ctx context.Context, request SetLiveActivityTokenRequestObject) (SetLiveActivityTokenResponseObject, error)
// (GET /api/pocketcoder/v1/logs/instance/{id}) GetHarnessInstanceLogs(ctx context.Context, request GetHarnessInstanceLogsRequestObject) (GetHarnessInstanceLogsResponseObject, error)
// (GET /api/pocketcoder/v1/logs/{containerName}) StreamContainerLogs(ctx context.Context, request StreamContainerLogsRequestObject) (StreamContainerLogsResponseObject, error)
// (POST /api/pocketcoder/v1/mcp/oauth/store) StoreMcpOAuthToken(ctx context.Context, request StoreMcpOAuthTokenRequestObject) (StoreMcpOAuthTokenResponseObject, error)
// (POST /api/pocketcoder/v1/mcp/request) ExecuteMcpRequest(ctx context.Context, request ExecuteMcpRequestRequestObject) (ExecuteMcpRequestResponseObject, error)
// (GET /api/pocketcoder/v1/ollama/models) ListOllamaModels(ctx context.Context, request ListOllamaModelsRequestObject) (ListOllamaModelsResponseObject, error)
// (POST /api/pocketcoder/v1/ollama/pull) PullOllamaModel(ctx context.Context, request PullOllamaModelRequestObject) (PullOllamaModelResponseObject, error)
// (DELETE /api/pocketcoder/v1/pro-data) DeleteProData(ctx context.Context, request DeleteProDataRequestObject) (DeleteProDataResponseObject, error)
// (GET /api/pocketcoder/v1/proxy/observability/{path}) ProxyObservability(ctx context.Context, request ProxyObservabilityRequestObject) (ProxyObservabilityResponseObject, error)
// (POST /api/pocketcoder/v1/push) SendPushNotification(ctx context.Context, request SendPushNotificationRequestObject) (SendPushNotificationResponseObject, error)
// (GET /api/pocketcoder/v1/release/status) GetReleaseStatus(ctx context.Context, request GetReleaseStatusRequestObject) (GetReleaseStatusResponseObject, error)
// (POST /api/pocketcoder/v1/schedules/{scheduleId}/run) RunScheduleNow(ctx context.Context, request RunScheduleNowRequestObject) (RunScheduleNowResponseObject, error)}type SubmitHarnessAuth200JSONResponse
Section titled “type SubmitHarnessAuth200JSONResponse”type SubmitHarnessAuth200JSONResponse HarnessAuthStatusfunc (SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse
Section titled “func (SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse”func (response SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) errortype SubmitHarnessAuth400JSONResponse
Section titled “type SubmitHarnessAuth400JSONResponse”type SubmitHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }func (SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse
Section titled “func (SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse”func (response SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) errortype SubmitHarnessAuth401JSONResponse
Section titled “type SubmitHarnessAuth401JSONResponse”type SubmitHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }func (SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse
Section titled “func (SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse”func (response SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) errortype SubmitHarnessAuth404JSONResponse
Section titled “type SubmitHarnessAuth404JSONResponse”type SubmitHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }func (SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse
Section titled “func (SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse”func (response SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) errortype SubmitHarnessAuth500JSONResponse
Section titled “type SubmitHarnessAuth500JSONResponse”type SubmitHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }func (SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse
Section titled “func (SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse”func (response SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) errortype SubmitHarnessAuthJSONRequestBody
Section titled “type SubmitHarnessAuthJSONRequestBody”SubmitHarnessAuthJSONRequestBody defines body for SubmitHarnessAuth for application/json ContentType.
type SubmitHarnessAuthJSONRequestBody = HarnessRequesttype SubmitHarnessAuthRequestObject
Section titled “type SubmitHarnessAuthRequestObject”type SubmitHarnessAuthRequestObject struct { Body *SubmitHarnessAuthJSONRequestBody}type SubmitHarnessAuthResponseObject
Section titled “type SubmitHarnessAuthResponseObject”type SubmitHarnessAuthResponseObject interface { VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error}type TooManyValuesForParamError
Section titled “type TooManyValuesForParamError”type TooManyValuesForParamError struct { ParamName string Count int}func (*TooManyValuesForParamError) Error
Section titled “func (*TooManyValuesForParamError) Error”func (e *TooManyValuesForParamError) Error() stringtype Unauthorized
Section titled “type Unauthorized”Unauthorized defines model for Unauthorized.
type Unauthorized = ErrorResponsetype UnauthorizedJSONResponse
Section titled “type UnauthorizedJSONResponse”type UnauthorizedJSONResponse ErrorResponsetype Unavailable
Section titled “type Unavailable”Unavailable defines model for Unavailable.
type Unavailable = ErrorResponsetype UnavailableJSONResponse
Section titled “type UnavailableJSONResponse”type UnavailableJSONResponse ErrorResponsetype UnescapedCookieParamError
Section titled “type UnescapedCookieParamError”type UnescapedCookieParamError struct { ParamName string Err error}func (*UnescapedCookieParamError) Error
Section titled “func (*UnescapedCookieParamError) Error”func (e *UnescapedCookieParamError) Error() stringfunc (*UnescapedCookieParamError) Unwrap
Section titled “func (*UnescapedCookieParamError) Unwrap”func (e *UnescapedCookieParamError) Unwrap() errortype UnmarshalingParamError
Section titled “type UnmarshalingParamError”type UnmarshalingParamError struct { ParamName string Err error}func (*UnmarshalingParamError) Error
Section titled “func (*UnmarshalingParamError) Error”func (e *UnmarshalingParamError) Error() stringfunc (*UnmarshalingParamError) Unwrap
Section titled “func (*UnmarshalingParamError) Unwrap”func (e *UnmarshalingParamError) Unwrap() errortype Unprocessable
Section titled “type Unprocessable”Unprocessable defines model for Unprocessable.
type Unprocessable = ErrorResponsetype UnprocessableJSONResponse
Section titled “type UnprocessableJSONResponse”type UnprocessableJSONResponse ErrorResponsetype pocketbaseTokenContextKey
Section titled “type pocketbaseTokenContextKey”pocketbaseTokenContextKey is the context key for pocketbaseToken security scheme
type pocketbaseTokenContextKey stringconst ( PocketbaseTokenScopes pocketbaseTokenContextKey = "pocketbaseToken.Scopes")type strictHandler
Section titled “type strictHandler”type strictHandler struct { ssi StrictServerInterface middlewares []StrictMiddlewareFunc options StrictHTTPServerOptions}func (*strictHandler) CancelChatSession
Section titled “func (*strictHandler) CancelChatSession”func (sh *strictHandler) CancelChatSession(w http.ResponseWriter, r *http.Request, chatId ChatId)CancelChatSession operation middleware
func (*strictHandler) CancelHarnessAuth
Section titled “func (*strictHandler) CancelHarnessAuth”func (sh *strictHandler) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)CancelHarnessAuth operation middleware
func (*strictHandler) DeleteProData
Section titled “func (*strictHandler) DeleteProData”func (sh *strictHandler) DeleteProData(w http.ResponseWriter, r *http.Request)DeleteProData operation middleware
func (*strictHandler) DisconnectHarnessAuth
Section titled “func (*strictHandler) DisconnectHarnessAuth”func (sh *strictHandler) DisconnectHarnessAuth(w http.ResponseWriter, r *http.Request)DisconnectHarnessAuth operation middleware
func (*strictHandler) EndLiveActivity
Section titled “func (*strictHandler) EndLiveActivity”func (sh *strictHandler) EndLiveActivity(w http.ResponseWriter, r *http.Request, id RequestId)EndLiveActivity operation middleware
func (*strictHandler) ExecuteMcpRequest
Section titled “func (*strictHandler) ExecuteMcpRequest”func (sh *strictHandler) ExecuteMcpRequest(w http.ResponseWriter, r *http.Request)ExecuteMcpRequest operation middleware
func (*strictHandler) GetHarnessAuthStatus
Section titled “func (*strictHandler) GetHarnessAuthStatus”func (sh *strictHandler) GetHarnessAuthStatus(w http.ResponseWriter, r *http.Request)GetHarnessAuthStatus operation middleware
func (*strictHandler) GetHarnessInstanceLogs
Section titled “func (*strictHandler) GetHarnessInstanceLogs”func (sh *strictHandler) GetHarnessInstanceLogs(w http.ResponseWriter, r *http.Request, id string)GetHarnessInstanceLogs operation middleware
func (*strictHandler) GetReleaseCompatibility
Section titled “func (*strictHandler) GetReleaseCompatibility”func (sh *strictHandler) GetReleaseCompatibility(w http.ResponseWriter, r *http.Request)GetReleaseCompatibility operation middleware
func (*strictHandler) GetReleaseStatus
Section titled “func (*strictHandler) GetReleaseStatus”func (sh *strictHandler) GetReleaseStatus(w http.ResponseWriter, r *http.Request)GetReleaseStatus operation middleware
func (*strictHandler) GetWorkspaceFile
Section titled “func (*strictHandler) GetWorkspaceFile”func (sh *strictHandler) GetWorkspaceFile(w http.ResponseWriter, r *http.Request, params GetWorkspaceFileParams)GetWorkspaceFile operation middleware
func (*strictHandler) ListContainers
Section titled “func (*strictHandler) ListContainers”func (sh *strictHandler) ListContainers(w http.ResponseWriter, r *http.Request)ListContainers operation middleware
func (*strictHandler) ListOllamaModels
Section titled “func (*strictHandler) ListOllamaModels”func (sh *strictHandler) ListOllamaModels(w http.ResponseWriter, r *http.Request)ListOllamaModels operation middleware
func (*strictHandler) ListWorkspaceFileTree
Section titled “func (*strictHandler) ListWorkspaceFileTree”func (sh *strictHandler) ListWorkspaceFileTree(w http.ResponseWriter, r *http.Request, params ListWorkspaceFileTreeParams)ListWorkspaceFileTree operation middleware
func (*strictHandler) PollHarnessAuth
Section titled “func (*strictHandler) PollHarnessAuth”func (sh *strictHandler) PollHarnessAuth(w http.ResponseWriter, r *http.Request)PollHarnessAuth operation middleware
func (*strictHandler) PromptChat
Section titled “func (*strictHandler) PromptChat”func (sh *strictHandler) PromptChat(w http.ResponseWriter, r *http.Request, chatId ChatId)PromptChat operation middleware
func (*strictHandler) ProxyObservability
Section titled “func (*strictHandler) ProxyObservability”func (sh *strictHandler) ProxyObservability(w http.ResponseWriter, r *http.Request, path string)ProxyObservability operation middleware
func (*strictHandler) PullOllamaModel
Section titled “func (*strictHandler) PullOllamaModel”func (sh *strictHandler) PullOllamaModel(w http.ResponseWriter, r *http.Request)PullOllamaModel operation middleware
func (*strictHandler) RespondToElicitation
Section titled “func (*strictHandler) RespondToElicitation”func (sh *strictHandler) RespondToElicitation(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)RespondToElicitation operation middleware
func (*strictHandler) RespondToPermission
Section titled “func (*strictHandler) RespondToPermission”func (sh *strictHandler) RespondToPermission(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)RespondToPermission operation middleware
func (*strictHandler) RunScheduleNow
Section titled “func (*strictHandler) RunScheduleNow”func (sh *strictHandler) RunScheduleNow(w http.ResponseWriter, r *http.Request, scheduleId string)RunScheduleNow operation middleware
func (*strictHandler) SendPushNotification
Section titled “func (*strictHandler) SendPushNotification”func (sh *strictHandler) SendPushNotification(w http.ResponseWriter, r *http.Request)SendPushNotification operation middleware
func (*strictHandler) SetChatConfigOption
Section titled “func (*strictHandler) SetChatConfigOption”func (sh *strictHandler) SetChatConfigOption(w http.ResponseWriter, r *http.Request, chatId ChatId)SetChatConfigOption operation middleware
func (*strictHandler) SetChatMode
Section titled “func (*strictHandler) SetChatMode”func (sh *strictHandler) SetChatMode(w http.ResponseWriter, r *http.Request, chatId ChatId)SetChatMode operation middleware
func (*strictHandler) SetLiveActivityToken
Section titled “func (*strictHandler) SetLiveActivityToken”func (sh *strictHandler) SetLiveActivityToken(w http.ResponseWriter, r *http.Request, id RequestId)SetLiveActivityToken operation middleware
func (*strictHandler) StartHarnessAuth
Section titled “func (*strictHandler) StartHarnessAuth”func (sh *strictHandler) StartHarnessAuth(w http.ResponseWriter, r *http.Request)StartHarnessAuth operation middleware
func (*strictHandler) StoreMcpOAuthToken
Section titled “func (*strictHandler) StoreMcpOAuthToken”func (sh *strictHandler) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)StoreMcpOAuthToken operation middleware
func (*strictHandler) StreamChatEvents
Section titled “func (*strictHandler) StreamChatEvents”func (sh *strictHandler) StreamChatEvents(w http.ResponseWriter, r *http.Request, chatId ChatId, params StreamChatEventsParams)StreamChatEvents operation middleware
func (*strictHandler) StreamContainerLogs
Section titled “func (*strictHandler) StreamContainerLogs”func (sh *strictHandler) StreamContainerLogs(w http.ResponseWriter, r *http.Request, containerName ContainerName)StreamContainerLogs operation middleware
func (*strictHandler) SubmitHarnessAuth
Section titled “func (*strictHandler) SubmitHarnessAuth”func (sh *strictHandler) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)SubmitHarnessAuth operation middleware
operation
Section titled “operation”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/operation"Package operation defines the direct boundary between generated OpenAPI operations and PocketBase request handlers.
- func MountDirect(e *core.ServeEvent, routes []Route)
- func MountForTests(e *core.ServeEvent, routes []Route)
- func mount(e *core.ServeEvent, routes []Route, directOnly bool)
- type Action
- type Registry
- type Route
func MountDirect
Section titled “func MountDirect”func MountDirect(e *core.ServeEvent, routes []Route)MountDirect installs only transports that cannot safely pass through a buffered strict response: SSE, NDJSON, opaque proxying, and binary files.
func MountForTests
Section titled “func MountForTests”func MountForTests(e *core.ServeEvent, routes []Route)MountForTests mounts operation actions directly so package tests can exercise a focused handler without constructing the complete generated API server. Production never calls this function.
func mount
Section titled “func mount”func mount(e *core.ServeEvent, routes []Route, directOnly bool)type Action
Section titled “type Action”type Action func(*core.RequestEvent) errortype Registry
Section titled “type Registry”type Registry struct { routes map[string]Route}func NewRegistry
Section titled “func NewRegistry”func NewRegistry() *Registryfunc (*Registry) Add
Section titled “func (*Registry) Add”func (r *Registry) Add(route Route)Registry keys are case-insensitive (normalized via strings.ToLower). Live-confirmed 2026-08-27: oapi-codegen’s generated strict-server wrapper calls StrictMiddlewareFunc with the operation’s exported Go method name (PascalCase, e.g. “GetReleaseCompatibility”), while every registry.Add call site here uses the raw OpenAPI operationId (camelCase, lowercase first letter, e.g. “getReleaseCompatibility”) -- an exact-match lookup between the two conventions failed for every single strict-server operation, with no exceptions, silently breaking the entire migrated API surface. Case-insensitive keys make the two conventions interchangeable without touching either convention’s ~30 call sites.
func (*Registry) Get
Section titled “func (*Registry) Get”func (r *Registry) Get(operationID string) (Route, bool)func (*Registry) Routes
Section titled “func (*Registry) Routes”func (r *Registry) Routes() []Routetype Route
Section titled “type Route”type Route struct { OperationID string Method string Path string Auth bool Direct bool Action Action}operationapi
Section titled “operationapi”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/operationapi"Package operationapi binds PocketCoder’s generated OpenAPI server to the existing PocketBase request context and direct operation actions.
- Variables
- func Register(app core.App, e *core.ServeEvent, coord func() coordinator.AgentRuntime) (coordinator.AgentRuntime, error)
- func authMiddleware(registry *operation.Registry) openapi.StrictMiddlewareFunc
- func challengeCodeDestinationPtr(value string) *openapi.HarnessAuthChallengeCodeDestination
- func challengeExpiresAtPtr(value string) *time.Time
- func challengeKindPtr(value string) *openapi.HarnessAuthChallengeKind
- func convertFileTreeEntry(entry filesystem.FileTreeEntry) openapi.FileTreeEntry
- func harnessStatusResponse(status api.HarnessAuthStatusResponse) openapi.HarnessAuthStatus
- func intPtr(value int) *int
- func requestEventFromContext(ctx context.Context) (*core.RequestEvent, error)
- func stringPtr(value string) *string
- type requestEventContextKey
- type server
- func (s *server) CancelChatSession(ctx context.Context, request openapi.CancelChatSessionRequestObject) (openapi.CancelChatSessionResponseObject, error)
- func (s *server) CancelHarnessAuth(ctx context.Context, _ openapi.CancelHarnessAuthRequestObject) (openapi.CancelHarnessAuthResponseObject, error)
- func (s *server) DeleteProData(ctx context.Context, _ openapi.DeleteProDataRequestObject) (openapi.DeleteProDataResponseObject, error)
- func (s *server) DisconnectHarnessAuth(ctx context.Context, _ openapi.DisconnectHarnessAuthRequestObject) (openapi.DisconnectHarnessAuthResponseObject, error)
- func (s *server) EndLiveActivity(ctx context.Context, request openapi.EndLiveActivityRequestObject) (openapi.EndLiveActivityResponseObject, error)
- func (s *server) ExecuteMcpRequest(ctx context.Context, _ openapi.ExecuteMcpRequestRequestObject) (openapi.ExecuteMcpRequestResponseObject, error)
- func (s *server) GetHarnessAuthStatus(ctx context.Context, _ openapi.GetHarnessAuthStatusRequestObject) (openapi.GetHarnessAuthStatusResponseObject, error)
- func (s *server) GetHarnessInstanceLogs(ctx context.Context, request openapi.GetHarnessInstanceLogsRequestObject) (openapi.GetHarnessInstanceLogsResponseObject, error)
- func (s *server) GetReleaseCompatibility(_ context.Context, _ openapi.GetReleaseCompatibilityRequestObject) (openapi.GetReleaseCompatibilityResponseObject, error)
- func (s *server) GetReleaseStatus(ctx context.Context, _ openapi.GetReleaseStatusRequestObject) (openapi.GetReleaseStatusResponseObject, error)
- func (s *server) GetWorkspaceFile(ctx context.Context, _ openapi.GetWorkspaceFileRequestObject) (openapi.GetWorkspaceFileResponseObject, error)
- func (s *server) ListContainers(ctx context.Context, _ openapi.ListContainersRequestObject) (openapi.ListContainersResponseObject, error)
- func (s *server) ListOllamaModels(ctx context.Context, _ openapi.ListOllamaModelsRequestObject) (openapi.ListOllamaModelsResponseObject, error)
- func (s *server) ListWorkspaceFileTree(ctx context.Context, _ openapi.ListWorkspaceFileTreeRequestObject) (openapi.ListWorkspaceFileTreeResponseObject, error)
- func (s *server) PollHarnessAuth(ctx context.Context, _ openapi.PollHarnessAuthRequestObject) (openapi.PollHarnessAuthResponseObject, error)
- func (s *server) PromptChat(ctx context.Context, request openapi.PromptChatRequestObject) (openapi.PromptChatResponseObject, error)
- func (s *server) ProxyObservability(ctx context.Context, _ openapi.ProxyObservabilityRequestObject) (openapi.ProxyObservabilityResponseObject, error)
- func (s *server) PullOllamaModel(ctx context.Context, _ openapi.PullOllamaModelRequestObject) (openapi.PullOllamaModelResponseObject, error)
- func (s *server) RespondToElicitation(ctx context.Context, request openapi.RespondToElicitationRequestObject) (openapi.RespondToElicitationResponseObject, error)
- func (s *server) RespondToPermission(ctx context.Context, request openapi.RespondToPermissionRequestObject) (openapi.RespondToPermissionResponseObject, error)
- func (s *server) RunScheduleNow(ctx context.Context, request openapi.RunScheduleNowRequestObject) (openapi.RunScheduleNowResponseObject, error)
- func (s *server) SendPushNotification(ctx context.Context, _ openapi.SendPushNotificationRequestObject) (openapi.SendPushNotificationResponseObject, error)
- func (s *server) SetChatConfigOption(ctx context.Context, request openapi.SetChatConfigOptionRequestObject) (openapi.SetChatConfigOptionResponseObject, error)
- func (s *server) SetChatMode(ctx context.Context, request openapi.SetChatModeRequestObject) (openapi.SetChatModeResponseObject, error)
- func (s *server) SetLiveActivityToken(ctx context.Context, request openapi.SetLiveActivityTokenRequestObject) (openapi.SetLiveActivityTokenResponseObject, error)
- func (s *server) StartHarnessAuth(ctx context.Context, _ openapi.StartHarnessAuthRequestObject) (openapi.StartHarnessAuthResponseObject, error)
- func (s *server) StoreMcpOAuthToken(ctx context.Context, _ openapi.StoreMcpOAuthTokenRequestObject) (openapi.StoreMcpOAuthTokenResponseObject, error)
- func (s *server) StreamChatEvents(ctx context.Context, _ openapi.StreamChatEventsRequestObject) (openapi.StreamChatEventsResponseObject, error)
- func (s *server) StreamContainerLogs(ctx context.Context, _ openapi.StreamContainerLogsRequestObject) (openapi.StreamContainerLogsResponseObject, error)
- func (s *server) SubmitHarnessAuth(ctx context.Context, _ openapi.SubmitHarnessAuthRequestObject) (openapi.SubmitHarnessAuthResponseObject, error)
- func (s *server) agentRequestEvent(ctx context.Context, chatID string) (*core.RequestEvent, error)
Variables
Section titled “Variables”var _ openapi.StrictServerInterface = (*server)(nil)func Register
Section titled “func Register”func Register(app core.App, e *core.ServeEvent, coord func() coordinator.AgentRuntime) (coordinator.AgentRuntime, error)Register installs every PocketCoder operation from one registry. Ordinary request/response operations cross the generated strict server interface. Streaming, proxy, and binary operations remain direct because buffering those responses would alter their transport semantics.
func authMiddleware
Section titled “func authMiddleware”func authMiddleware(registry *operation.Registry) openapi.StrictMiddlewareFuncauthMiddleware enforces operation.Route.Auth uniformly for every operation reachable through the strict server, converted or not -- this replaces dispatch()’s inline “if route.Auth && re.Auth == nil” check, which becomes redundant once every operation runs through this middleware and is removed once all operations are converted off the strict-server middleware.
One deliberate, accepted behavior change: the generated strict-server wrapper decodes a JSON request body BEFORE any StrictMiddlewareFunc runs (see e.g. pocketcoder.gen.go’s PromptChat wrapper). So an unauthenticated request with a malformed JSON body now gets 400 (bad request body) instead of 401 (unauthorized) -- previously, dispatch() checked auth first and never reached body-binding for an unauthenticated caller. This is a minor, common, and accepted information-disclosure nuance (confirms “this endpoint parses JSON” to an unauthenticated caller, nothing more) -- not a security regression worth blocking this migration over.
func challengeCodeDestinationPtr
Section titled “func challengeCodeDestinationPtr”func challengeCodeDestinationPtr(value string) *openapi.HarnessAuthChallengeCodeDestinationfunc challengeExpiresAtPtr
Section titled “func challengeExpiresAtPtr”func challengeExpiresAtPtr(value string) *time.TimechallengeExpiresAtPtr parses the domain Challenge’s plain-string ExpiresAt (RFC3339, set by the harnessauth authenticators) into the generated OpenAPI type’s *time.Time. An empty or unparseable value omits the field rather than erroring, matching stringPtr/intPtr’s existing “no value” convention.
func challengeKindPtr
Section titled “func challengeKindPtr”func challengeKindPtr(value string) *openapi.HarnessAuthChallengeKindfunc convertFileTreeEntry
Section titled “func convertFileTreeEntry”func convertFileTreeEntry(entry filesystem.FileTreeEntry) openapi.FileTreeEntryconvertFileTreeEntry maps filesystem.FileTreeEntry (plain values) onto the generated openapi.FileTreeEntry (pointer fields for the properties that are only meaningful for one node kind: Size/ModTime for files, Children for directories), recursing into Children for directory nodes.
func harnessStatusResponse
Section titled “func harnessStatusResponse”func harnessStatusResponse(status api.HarnessAuthStatusResponse) openapi.HarnessAuthStatusfunc intPtr
Section titled “func intPtr”func intPtr(value int) *intfunc requestEventFromContext
Section titled “func requestEventFromContext”func requestEventFromContext(ctx context.Context) (*core.RequestEvent, error)requestEventFromContext extracts the *core.RequestEvent PocketBase stashes on ctx. Every strict handler needing PocketBase-native access (SetPathValue, auth, etc.) does this exact lookup -- shared here so the “missing request event” case is logged and wrapped in exactly one place instead of once per call site.
func stringPtr
Section titled “func stringPtr”func stringPtr(value string) *stringtype requestEventContextKey
Section titled “type requestEventContextKey”type requestEventContextKey struct{}type server
Section titled “type server”type server struct { registry *operation.Registry app core.App agent coordinator.AgentRuntime agentErr error scheduleRunner *schedule.Runner harnessRuntime api.HarnessAuthRuntime}func (*server) CancelChatSession
Section titled “func (*server) CancelChatSession”func (s *server) CancelChatSession(ctx context.Context, request openapi.CancelChatSessionRequestObject) (openapi.CancelChatSessionResponseObject, error)func (*server) CancelHarnessAuth
Section titled “func (*server) CancelHarnessAuth”func (s *server) CancelHarnessAuth(ctx context.Context, _ openapi.CancelHarnessAuthRequestObject) (openapi.CancelHarnessAuthResponseObject, error)func (*server) DeleteProData
Section titled “func (*server) DeleteProData”func (s *server) DeleteProData(ctx context.Context, _ openapi.DeleteProDataRequestObject) (openapi.DeleteProDataResponseObject, error)func (*server) DisconnectHarnessAuth
Section titled “func (*server) DisconnectHarnessAuth”func (s *server) DisconnectHarnessAuth(ctx context.Context, _ openapi.DisconnectHarnessAuthRequestObject) (openapi.DisconnectHarnessAuthResponseObject, error)func (*server) EndLiveActivity
Section titled “func (*server) EndLiveActivity”func (s *server) EndLiveActivity(ctx context.Context, request openapi.EndLiveActivityRequestObject) (openapi.EndLiveActivityResponseObject, error)func (*server) ExecuteMcpRequest
Section titled “func (*server) ExecuteMcpRequest”func (s *server) ExecuteMcpRequest(ctx context.Context, _ openapi.ExecuteMcpRequestRequestObject) (openapi.ExecuteMcpRequestResponseObject, error)func (*server) GetHarnessAuthStatus
Section titled “func (*server) GetHarnessAuthStatus”func (s *server) GetHarnessAuthStatus(ctx context.Context, _ openapi.GetHarnessAuthStatusRequestObject) (openapi.GetHarnessAuthStatusResponseObject, error)func (*server) GetHarnessInstanceLogs
Section titled “func (*server) GetHarnessInstanceLogs”func (s *server) GetHarnessInstanceLogs(ctx context.Context, request openapi.GetHarnessInstanceLogsRequestObject) (openapi.GetHarnessInstanceLogsResponseObject, error)func (*server) GetReleaseCompatibility
Section titled “func (*server) GetReleaseCompatibility”func (s *server) GetReleaseCompatibility(_ context.Context, _ openapi.GetReleaseCompatibilityRequestObject) (openapi.GetReleaseCompatibilityResponseObject, error)func (*server) GetReleaseStatus
Section titled “func (*server) GetReleaseStatus”func (s *server) GetReleaseStatus(ctx context.Context, _ openapi.GetReleaseStatusRequestObject) (openapi.GetReleaseStatusResponseObject, error)func (*server) GetWorkspaceFile
Section titled “func (*server) GetWorkspaceFile”func (s *server) GetWorkspaceFile(ctx context.Context, _ openapi.GetWorkspaceFileRequestObject) (openapi.GetWorkspaceFileResponseObject, error)func (*server) ListContainers
Section titled “func (*server) ListContainers”func (s *server) ListContainers(ctx context.Context, _ openapi.ListContainersRequestObject) (openapi.ListContainersResponseObject, error)func (*server) ListOllamaModels
Section titled “func (*server) ListOllamaModels”func (s *server) ListOllamaModels(ctx context.Context, _ openapi.ListOllamaModelsRequestObject) (openapi.ListOllamaModelsResponseObject, error)func (*server) ListWorkspaceFileTree
Section titled “func (*server) ListWorkspaceFileTree”func (s *server) ListWorkspaceFileTree(ctx context.Context, _ openapi.ListWorkspaceFileTreeRequestObject) (openapi.ListWorkspaceFileTreeResponseObject, error)func (*server) PollHarnessAuth
Section titled “func (*server) PollHarnessAuth”func (s *server) PollHarnessAuth(ctx context.Context, _ openapi.PollHarnessAuthRequestObject) (openapi.PollHarnessAuthResponseObject, error)func (*server) PromptChat
Section titled “func (*server) PromptChat”func (s *server) PromptChat(ctx context.Context, request openapi.PromptChatRequestObject) (openapi.PromptChatResponseObject, error)func (*server) ProxyObservability
Section titled “func (*server) ProxyObservability”func (s *server) ProxyObservability(ctx context.Context, _ openapi.ProxyObservabilityRequestObject) (openapi.ProxyObservabilityResponseObject, error)func (*server) PullOllamaModel
Section titled “func (*server) PullOllamaModel”func (s *server) PullOllamaModel(ctx context.Context, _ openapi.PullOllamaModelRequestObject) (openapi.PullOllamaModelResponseObject, error)func (*server) RespondToElicitation
Section titled “func (*server) RespondToElicitation”func (s *server) RespondToElicitation(ctx context.Context, request openapi.RespondToElicitationRequestObject) (openapi.RespondToElicitationResponseObject, error)func (*server) RespondToPermission
Section titled “func (*server) RespondToPermission”func (s *server) RespondToPermission(ctx context.Context, request openapi.RespondToPermissionRequestObject) (openapi.RespondToPermissionResponseObject, error)func (*server) RunScheduleNow
Section titled “func (*server) RunScheduleNow”func (s *server) RunScheduleNow(ctx context.Context, request openapi.RunScheduleNowRequestObject) (openapi.RunScheduleNowResponseObject, error)func (*server) SendPushNotification
Section titled “func (*server) SendPushNotification”func (s *server) SendPushNotification(ctx context.Context, _ openapi.SendPushNotificationRequestObject) (openapi.SendPushNotificationResponseObject, error)func (*server) SetChatConfigOption
Section titled “func (*server) SetChatConfigOption”func (s *server) SetChatConfigOption(ctx context.Context, request openapi.SetChatConfigOptionRequestObject) (openapi.SetChatConfigOptionResponseObject, error)func (*server) SetChatMode
Section titled “func (*server) SetChatMode”func (s *server) SetChatMode(ctx context.Context, request openapi.SetChatModeRequestObject) (openapi.SetChatModeResponseObject, error)func (*server) SetLiveActivityToken
Section titled “func (*server) SetLiveActivityToken”func (s *server) SetLiveActivityToken(ctx context.Context, request openapi.SetLiveActivityTokenRequestObject) (openapi.SetLiveActivityTokenResponseObject, error)func (*server) StartHarnessAuth
Section titled “func (*server) StartHarnessAuth”func (s *server) StartHarnessAuth(ctx context.Context, _ openapi.StartHarnessAuthRequestObject) (openapi.StartHarnessAuthResponseObject, error)func (*server) StoreMcpOAuthToken
Section titled “func (*server) StoreMcpOAuthToken”func (s *server) StoreMcpOAuthToken(ctx context.Context, _ openapi.StoreMcpOAuthTokenRequestObject) (openapi.StoreMcpOAuthTokenResponseObject, error)func (*server) StreamChatEvents
Section titled “func (*server) StreamChatEvents”func (s *server) StreamChatEvents(ctx context.Context, _ openapi.StreamChatEventsRequestObject) (openapi.StreamChatEventsResponseObject, error)func (*server) StreamContainerLogs
Section titled “func (*server) StreamContainerLogs”func (s *server) StreamContainerLogs(ctx context.Context, _ openapi.StreamContainerLogsRequestObject) (openapi.StreamContainerLogsResponseObject, error)func (*server) SubmitHarnessAuth
Section titled “func (*server) SubmitHarnessAuth”func (s *server) SubmitHarnessAuth(ctx context.Context, _ openapi.SubmitHarnessAuthRequestObject) (openapi.SubmitHarnessAuthResponseObject, error)func (*server) agentRequestEvent
Section titled “func (*server) agentRequestEvent”func (s *server) agentRequestEvent(ctx context.Context, chatID string) (*core.RequestEvent, error)releaseartifact
Section titled “releaseartifact”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/releaseartifact"Package releaseartifact installs release-pinned Docker images from the immutable artifact manifest cached on a PocketCoder host.
- Constants
- Variables
- func EnsureHarnessImage(ctx context.Context, docker DockerLoader, harnessID, image string) error
- func EnsureOptionalImage(ctx context.Context, docker DockerLoader, optionalID string) (string, error)
- func ManagedReleaseImage(image, release string) bool
- func decodeStrictFile(path string, target any) error
- func filesystemAvailableBytes(path string) (uint64, error)
- func validateHarnessArtifact(candidate artifact, image string) error
- type Config
- type DockerLoader
- type Loader
- func New(config Config) *Loader
- func (l *Loader) EnsureHarnessImage(ctx context.Context, docker DockerLoader, harnessID, image string) error
- func (l *Loader) EnsureOptionalImage(ctx context.Context, docker DockerLoader, optionalID string) (string, error)
- func (l *Loader) installArtifact(ctx context.Context, docker DockerLoader, artifactLabel string, selected artifact, image string) error
- func (l *Loader) installHarness(ctx context.Context, docker DockerLoader, harnessID, image string) error
- func (l *Loader) loadReleaseState() (releasePointer, releaseManifest, error)
- type artifact
- type flight
- type flightGroup
- type progressReader
- type releaseManifest
- type releasePointer
Constants
Section titled “Constants”const ( defaultPointerPath = "/var/lib/pocketcoder/release/current.json" defaultArtifactDir = "/artifacts" defaultReserveBytes = int64(1 << 30))Variables
Section titled “Variables”var ( releasePattern = regexp.MustCompile(`^[0-9a-f]{40}$`) digestPattern = regexp.MustCompile(`^[0-9a-f]{64}$`) harnessIDPattern = regexp.MustCompile(`^[a-z0-9]+(?:-[a-z0-9]+)*$`) shaPattern = regexp.MustCompile(`^[0-9a-f]{64}$`) registryImagePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9./_-]*(?::[A-Za-z0-9._-]+)?@sha256:[0-9a-f]{64}$`))func EnsureHarnessImage
Section titled “func EnsureHarnessImage”func EnsureHarnessImage(ctx context.Context, docker DockerLoader, harnessID, image string) errorfunc EnsureOptionalImage
Section titled “func EnsureOptionalImage”func EnsureOptionalImage(ctx context.Context, docker DockerLoader, optionalID string) (string, error)EnsureOptionalImage installs a release-pinned optional runtime without making it part of the default bootstrap artifact set. Optional IDs are a closed manifest contract; today Ollama is the only supported capability.
func ManagedReleaseImage
Section titled “func ManagedReleaseImage”func ManagedReleaseImage(image, release string) boolManagedReleaseImage reports whether image belongs to the active immutable PocketCoder release and therefore must come from its verified artifact.
func decodeStrictFile
Section titled “func decodeStrictFile”func decodeStrictFile(path string, target any) errorfunc filesystemAvailableBytes
Section titled “func filesystemAvailableBytes”func filesystemAvailableBytes(path string) (uint64, error)func validateHarnessArtifact
Section titled “func validateHarnessArtifact”func validateHarnessArtifact(candidate artifact, image string) errortype Config
Section titled “type Config”type Config struct { PointerPath string ArtifactDir string ExpectedRelease string ReserveBytes int64 DownloadTimeout time.Duration HTTPClient *http.Client AvailableBytes func(path string) (uint64, error)}func ConfigFromEnvironment
Section titled “func ConfigFromEnvironment”func ConfigFromEnvironment() Configtype DockerLoader
Section titled “type DockerLoader”DockerLoader is the narrow Docker API surface artifact installation needs.
type DockerLoader interface { ImageExists(ctx context.Context, image string) (bool, error) PullImage(ctx context.Context, image string) error LoadImage(ctx context.Context, archive io.Reader) error}type Loader
Section titled “type Loader”type Loader struct { config Config flights flightGroup}var ( defaultOnce sync.Once defaultLoader *Loader)func New
Section titled “func New”func New(config Config) *Loaderfunc (*Loader) EnsureHarnessImage
Section titled “func (*Loader) EnsureHarnessImage”func (l *Loader) EnsureHarnessImage(ctx context.Context, docker DockerLoader, harnessID, image string) errorfunc (*Loader) EnsureOptionalImage
Section titled “func (*Loader) EnsureOptionalImage”func (l *Loader) EnsureOptionalImage(ctx context.Context, docker DockerLoader, optionalID string) (string, error)func (*Loader) installArtifact
Section titled “func (*Loader) installArtifact”func (l *Loader) installArtifact(ctx context.Context, docker DockerLoader, artifactLabel string, selected artifact, image string) errorfunc (*Loader) installHarness
Section titled “func (*Loader) installHarness”func (l *Loader) installHarness(ctx context.Context, docker DockerLoader, harnessID, image string) errorfunc (*Loader) loadReleaseState
Section titled “func (*Loader) loadReleaseState”func (l *Loader) loadReleaseState() (releasePointer, releaseManifest, error)type artifact
Section titled “type artifact”type artifact struct { URL string `json:"url"` SHA256 string `json:"sha256"` DownloadBytes int64 `json:"downloadBytes"` UnpackedBytes int64 `json:"unpackedBytes"` Images []string `json:"images"`}type flight
Section titled “type flight”type flight struct { done chan struct{} err error}type flightGroup
Section titled “type flightGroup”type flightGroup struct { mu sync.Mutex flights map[string]*flight}func (*flightGroup) Do
Section titled “func (*flightGroup) Do”func (g *flightGroup) Do(ctx context.Context, key string, work func() error) errortype progressReader
Section titled “type progressReader”type progressReader struct { reader io.Reader label string bytes, lastBytes int64 lastReport time.Time}func (*progressReader) Read
Section titled “func (*progressReader) Read”func (r *progressReader) Read(p []byte) (int, error)type releaseManifest
Section titled “type releaseManifest”type releaseManifest struct { SchemaVersion int `json:"schemaVersion"` ServerVersion string `json:"serverVersion"` SourceRepository string `json:"sourceRepository"` SourceCommit string `json:"sourceCommit"` BuiltAt string `json:"builtAt"` Platform json.RawMessage `json:"platform"` DataVersion int `json:"dataVersion"` MinimumUpgradeFromDataVersion int `json:"minimumUpgradeFromDataVersion"` Compatibility json.RawMessage `json:"compatibility"` Documents map[string]json.RawMessage `json:"documents"` OSImages map[string]json.RawMessage `json:"osImages"` ServerFiles artifact `json:"serverFiles"` Images struct { Required map[string]artifact `json:"required"` Choices map[string]struct { SchemaVersion int `json:"schemaVersion"` ConsumerPolicy string `json:"consumerPolicy"` CatalogDocument string `json:"catalogDocument"` MinimumSelections int `json:"minimumSelections"` MaximumSelections *int `json:"maximumSelections"` Options map[string]artifact `json:"options"` } `json:"choices"` Registry struct { Required []string `json:"required"` Optional map[string]struct { Image string `json:"image"` ComposeProfile string `json:"composeProfile"` } `json:"optional"` } `json:"registry"` } `json:"images"` Extensions json.RawMessage `json:"extensions,omitempty"`}type releasePointer
Section titled “type releasePointer”type releasePointer struct { SchemaVersion int `json:"schemaVersion"` ReleaseDigest string `json:"releaseDigest"` SourceCommit string `json:"sourceCommit"` ServerVersion string `json:"serverVersion"` DataVersion int `json:"dataVersion"` DeploymentContractVersion int `json:"deploymentContractVersion"` Channel string `json:"channel"` ChannelSequence int `json:"channelSequence"` RevocationSequence int `json:"revocationSequence"` SelectedImages []string `json:"selectedImages"` ManifestURL string `json:"manifestUrl"` ActivatedAt string `json:"activatedAt"`}releaseidentity
Section titled “releaseidentity”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/releaseidentity"- Variables
- func SyncHarnessImages(app core.App, catalogPath, release string) error
- type Catalog
- type Harness
Variables
Section titled “Variables”var releasePattern = regexp.MustCompile(`^[0-9a-f]{40}$`)func SyncHarnessImages
Section titled “func SyncHarnessImages”func SyncHarnessImages(app core.App, catalogPath, release string) errortype Catalog
Section titled “type Catalog”type Catalog struct { SchemaVersion int `json:"schemaVersion"` DefaultHarness string `json:"defaultHarness"` Harnesses []Harness `json:"harnesses"`}func LoadCatalog
Section titled “func LoadCatalog”func LoadCatalog(path string) (Catalog, error)type Harness
Section titled “type Harness”type Harness struct { ID string `json:"id"` ComposeService string `json:"composeService"` ImageRepository string `json:"imageRepository"` UpstreamVersion string `json:"upstreamVersion"`}schedule
Section titled “schedule”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/schedule"Package schedule executes scheduled agent prompts on a cron trigger or an on-demand request.
Variables
Section titled “Variables”var notifyRunFinished = hooks.NotifyRunFinishedvar notifyRunStarted = hooks.NotifyRunStartedfunc JobID
Section titled “func JobID”func JobID(id string) stringfunc Register
Section titled “func Register”func Register(runner *Runner, row *core.Record)type Runner
Section titled “type Runner”type Runner struct { App core.App Coord func() coordinator.AgentRuntime OllamaBaseURL string Now func() time.Time}func (*Runner) Run
Section titled “func (*Runner) Run”func (r *Runner) Run(ctx context.Context, ownerID string) errorfunc (*Runner) RunDetached
Section titled “func (*Runner) RunDetached”func (r *Runner) RunDetached(ownerID string)RunDetached runs a schedule in a background goroutine launched by a fire-and-forget caller (an HTTP handler that already responded, or a cron callback). It must never let a panic escape and crash the process -- a background job failing is an operational event to log, not a reason to take down the whole server.
func (*Runner) now
Section titled “func (*Runner) now”func (r *Runner) now() time.Timesessionprofile
Section titled “sessionprofile”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/sessionprofile"- Constants
- Variables
- func Build(app core.App, chatID string, ctx context.Context, ollamaBaseURL string) (coordinator.SessionProfile, error)
- func SaveSession(ctx context.Context, app core.App, chatID, userID, sessionID, harnessInstanceID string) error
- func SessionForChat(app core.App, chatID, userID string) (string, error)
- func credentialHash(providerID, credential string) string
- func defaultPermissionModeID(app core.App, userID string) string
- func defaultPocoConfigAPI(app core.App, userID string) (*core.Record, error)
- func lockForInstance(instanceID string) *sync.Mutex
- func markCredentialSynced(app core.App, instanceID string, syncedCredentials map[string]string) error
- func resolveDefaultHarnessModel(app core.App, harnessID, providerID string) (*core.Record, *core.Record, error)
- func supportsOllamaHarness(harness *core.Record) bool
- func validateWorkspacePath(p string) error
- func waitForPort(ctx context.Context, host string, port int, timeout time.Duration) error
- func warmOpencodeModelCache(ctx context.Context, client *dockerapi.Client, image, authVolume, providerID string) error
- func writeOpencodeAuthFile(ctx context.Context, client *dockerapi.Client, image, authVolume, providerID, credential string) error
- type CredentialSyncer
- type NoopCredentialSyncer
- type OpencodeAuthFileSyncer
- type stdioMcp
Constants
Section titled “Constants”const opencodeCliID = "opencode"workspaceRoot is the mount point every catalog harness is required to share (§6.3) — the same value the coordinator falls back to.
const workspaceRoot = "/workspace"Variables
Section titled “Variables”ErrHarnessFailed is the sentinel wrapped into the error returned when a resolved harness_instances row’s status is “error” — lets callers tell “harness failed to start” apart from any other Build failure via errors.Is, without matching on the (last_error-dependent) error string.
var ErrHarnessFailed = errors.New("harness failed to start")ErrProvisioning is returned by Build when no harness_instances row exists yet for the resolved (harness, launch_key) pair — provisioning has just been kicked off in the background (§5.1), and the caller should surface “harness starting, try again shortly” rather than blocking on an image pull or proceeding with an empty dial target.
var ErrProvisioning = errors.New("harness is being provisioned — retry shortly")var syncLocks sync.Map // instance id -> *sync.Mutexfunc Build
Section titled “func Build”func Build(app core.App, chatID string, ctx context.Context, ollamaBaseURL string) (coordinator.SessionProfile, error)func SaveSession
Section titled “func SaveSession”func SaveSession(ctx context.Context, app core.App, chatID, userID, sessionID, harnessInstanceID string) errorfunc SessionForChat
Section titled “func SessionForChat”func SessionForChat(app core.App, chatID, userID string) (string, error)SessionForChat resolves an existing ACP session for a chat owned by userID.
func credentialHash
Section titled “func credentialHash”func credentialHash(providerID, credential string) stringfunc defaultPermissionModeID
Section titled “func defaultPermissionModeID”func defaultPermissionModeID(app core.App, userID string) stringAn unscoped “is_default = true” filter would match arbitrarily across every user’s rows once personal default modes exist, so scope by user first (mirroring defaultPocoConfigAPI) before falling back to the system default.
func defaultPocoConfigAPI
Section titled “func defaultPocoConfigAPI”func defaultPocoConfigAPI(app core.App, userID string) (*core.Record, error)defaultPocoConfigAPI mirrors the hook’s §5.2 tie-break (is_default=true, deterministic first on multiple, nil on none). Kept separate from the hooks package to avoid a hooks→api import; the logic is small and identical. agent_profiles has no created/updated autodate field, so the stable, unique-indexed `name` column is the sort key (matches defaultPocoConfig).
func lockForInstance
Section titled “func lockForInstance”func lockForInstance(instanceID string) *sync.Mutexfunc markCredentialSynced
Section titled “func markCredentialSynced”func markCredentialSynced(app core.App, instanceID string, syncedCredentials map[string]string) errormarkCredentialSynced re-fetches instanceID immediately before saving: ProvisionHarnessInstance can concurrently set acp_endpoint on this same row while the caller’s slow Docker I/O is in flight, and saving a snapshot fetched before that I/O started would silently clobber it back to empty.
func resolveDefaultHarnessModel
Section titled “func resolveDefaultHarnessModel”func resolveDefaultHarnessModel(app core.App, harnessID, providerID string) (*core.Record, *core.Record, error)Build resolves a chat’s agent definition (agent_profile, or the default per §5.2) into a coordinator.SessionProfile: model/provider, system prompt, workspace cwd/additional directories, per-chat MCP servers (stdio only), and mode. It also resolves the harness identity and harness_instances row, and validates workspace paths. resolveDefaultHarnessModel finds a harness_models row to treat as the default when no explicit harness_model_override was given. It prefers a row with is_default = true, but falls back to any row for the harness -- no admin/migration/sync writer sets is_default on a real deployment today (confirmed 2026-08-28: neither the seed migration nor modelcatalog’s models.dev sync ever writes that field), so treating it as authoritative would make this whole fallback a no-op in production.
When providerID is non-empty, only rows whose model belongs to that provider are considered -- needed for a live-config harness (Goose, OpenCode), which can have harness_models rows spanning multiple providers, unlike a single-provider harness where every row already shares the one pinned provider. Returns (nil, nil, nil) if no matching row exists.
func supportsOllamaHarness
Section titled “func supportsOllamaHarness”func supportsOllamaHarness(harness *core.Record) boolfunc validateWorkspacePath
Section titled “func validateWorkspacePath”func validateWorkspacePath(p string) errorvalidateWorkspacePath validates that a path is within the workspace root.
func waitForPort
Section titled “func waitForPort”func waitForPort(ctx context.Context, host string, port int, timeout time.Duration) errorfunc warmOpencodeModelCache
Section titled “func warmOpencodeModelCache”func warmOpencodeModelCache(ctx context.Context, client *dockerapi.Client, image, authVolume, providerID string) errorwarmOpencodeModelCache runs `opencode models <provider>` once in a throwaway helper container against the same auth-home volume the real harness container mounts, so its ~/.cache/opencode/models.json is already populated by the time any session dials in. Best-effort by design: a slow/failed warm here just means the coordinator’s own setModelWithRetry falls back to retrying live, not a fatal sync error.
func writeOpencodeAuthFile
Section titled “func writeOpencodeAuthFile”func writeOpencodeAuthFile(ctx context.Context, client *dockerapi.Client, image, authVolume, providerID, credential string) errortype CredentialSyncer
Section titled “type CredentialSyncer”type CredentialSyncer interface { Sync(ctx context.Context, app core.App, instance *core.Record, providerRec *core.Record, credential string) error}func selectCredentialSyncer
Section titled “func selectCredentialSyncer”func selectCredentialSyncer(harness *core.Record) CredentialSyncertype NoopCredentialSyncer
Section titled “type NoopCredentialSyncer”type NoopCredentialSyncer struct{}func (NoopCredentialSyncer) Sync
Section titled “func (NoopCredentialSyncer) Sync”func (NoopCredentialSyncer) Sync(context.Context, core.App, *core.Record, *core.Record, string) errortype OpencodeAuthFileSyncer
Section titled “type OpencodeAuthFileSyncer”type OpencodeAuthFileSyncer struct{}func (OpencodeAuthFileSyncer) Sync
Section titled “func (OpencodeAuthFileSyncer) Sync”func (OpencodeAuthFileSyncer) Sync(ctx context.Context, app core.App, instance *core.Record, providerRec *core.Record, credential string) errortype stdioMcp
Section titled “type stdioMcp”stdioMcp is the stored acp_mcp_servers JSON shape (spec §5.1). Only stdio is supported today; http/sse/acp entries are skipped + logged.
type stdioMcp struct { Type string `json:"type"` Name string `json:"name"` Command string `json:"command"` Args []string `json:"args"` Env map[string]string `json:"env"`}import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/acp"@pocketcoder-core: ACP Transport. WebSocket adapter bridging the coder/acp-go-sdk connection to goose serve.
- func wsURLWithToken(rawURL, secret string) (string, error)
- type Conn
- type DialConfig
- type sdkConn
- type wsStream
func wsURLWithToken
Section titled “func wsURLWithToken”func wsURLWithToken(rawURL, secret string) (string, error)wsURLWithToken carries the Goose secret in the WS URL as ?token=<secret>. Goose enforces auth on the WebSocket upgrade via this query parameter (the browser WebSocket API cannot set headers); the X-Secret-Key header remains for HTTP parity. An empty secret leaves the URL untouched.
type Conn
Section titled “type Conn”type Conn interface { Initialize(context.Context, acpsdk.InitializeRequest) (acpsdk.InitializeResponse, error) NewSession(context.Context, acpsdk.NewSessionRequest) (acpsdk.NewSessionResponse, error) LoadSession(context.Context, acpsdk.LoadSessionRequest) (acpsdk.LoadSessionResponse, error) ResumeSession(context.Context, acpsdk.ResumeSessionRequest) (acpsdk.ResumeSessionResponse, error) SetSessionMode(context.Context, acpsdk.SetSessionModeRequest) (acpsdk.SetSessionModeResponse, error) SetSessionConfigOption(context.Context, acpsdk.SetSessionConfigOptionRequest) (acpsdk.SetSessionConfigOptionResponse, error) CallExtension(ctx context.Context, method string, params any) (json.RawMessage, error) Prompt(context.Context, acpsdk.PromptRequest) (acpsdk.PromptResponse, error) Cancel(context.Context, acpsdk.CancelNotification) error UnstableDeleteSession(context.Context, acpsdk.UnstableDeleteSessionRequest) (acpsdk.UnstableDeleteSessionResponse, error) Done() <-chan struct{} Close() error}var _ Conn = (*sdkConn)(nil)func Dial
Section titled “func Dial”func Dial(ctx context.Context, cfg DialConfig, client acpsdk.Client) (Conn, error)type DialConfig
Section titled “type DialConfig”type DialConfig struct{ URL, Secret string }type sdkConn
Section titled “type sdkConn”type sdkConn struct { *acpsdk.ClientSideConnection stream *wsStream}func (*sdkConn) Close
Section titled “func (*sdkConn) Close”func (c *sdkConn) Close() errortype wsStream
Section titled “type wsStream”type wsStream struct { ctx context.Context conn *websocket.Conn rbuf bytes.Buffer wmu sync.Mutex wbuf bytes.Buffer}func dialWS
Section titled “func dialWS”func dialWS(ctx context.Context, rawURL, secret string) (*wsStream, error)func (*wsStream) Close
Section titled “func (*wsStream) Close”func (w *wsStream) Close() errorfunc (*wsStream) Read
Section titled “func (*wsStream) Read”func (w *wsStream) Read(p []byte) (int, error)func (*wsStream) Write
Section titled “func (*wsStream) Write”func (w *wsStream) Write(p []byte) (int, error)import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/agui"@pocketcoder-core: ACP to AG-UI Bridge. Translates the ACP session-update subset from Goose into typed AG-UI events. Package agui translates the deliberately small ACP subset used by Goose into typed AG-UI events. It owns no history: Goose remains the source of truth.
Custom event constructors for AG-UI.
PocketCoder uses four CUSTOM events (`pocketcoder:tool`, `pocketcoder:diff`, `pocketcoder:terminal`, `pocketcoder:content`) to carry structured per-item enrichment that AG-UI’s standard timeline types can’t represent on their own. `rawEvent` is the redaction-safe fallback for unmapped ACP update variants — it never leaks the original `_meta` blob or vendor internals to the client.
State projection for the /pocketcoder/* namespace.
PocketCoder state values are bounded current-value snapshots (the *latest* plan/mode/config/usage/etc.) that AG-UI clients keep rendered alongside the linear message/tool timeline. They are carried on STATE_DELTA / STATE_SNAPSHOT events, separate from TEXT_MESSAGE_START/END and TOOL_CALL_START/END, so emitting state never opens or closes a text/tool boundary — that invariant lets consumers treat the two streams independently.
projection is package-private to the agui translation unit; callers hold it as a value field on Bridge and route set/remove operations through it.
- Variables
- func ElicitationPayload(id, message, mode string, schema any, url string) map[string]any
- func PermissionPayload(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) map[string]any
- func commands(cmds []acpsdk.AvailableCommand) []map[string]any
- func configOptions(opts []acpsdk.SessionConfigOption) []map[string]any
- func customContent(messageID string, m MediaDescriptor) events.Event
- func customDiff(toolCallID string, d ToolDiff) events.Event
- func customTerminal(toolCallID string, term ToolTerminal) events.Event
- func customTool(id, title, kind, status string, locations []acpsdk.ToolCallLocation) events.Event
- func customToolContent(toolCallID string, m MediaDescriptor) events.Event
- func deref(s *string) string
- func isTerminalToolStatus(status string) bool
- func planEntries(entries []acpsdk.PlanEntry) []map[string]any
- func rawEvent(kind string, _ any) events.Event
- func renderToolContent(content []acpsdk.ToolCallContent, rawOutput any) (string, []ToolDiff, []ToolTerminal, []MediaDescriptor, bool, error)
- func selectOptions(opts acpsdk.SessionConfigSelectOptions) []map[string]any
- func sessionModes(modes []acpsdk.SessionMode) []map[string]any
- type Bridge
- func NewBridge(threadID, runID string) *Bridge
- func (b *Bridge) CloseOpenTools() []events.Event
- func (b *Bridge) CloseOpenToolsAsFailed() []events.Event
- func (b *Bridge) ConfigUpdated(options []acpsdk.SessionConfigOption) []events.Event
- func (b *Bridge) ElicitationPending(id, message, mode string, schema any, url string) events.Event
- func (b *Bridge) Finished(stopReason acpsdk.StopReason) []events.Event
- func (b *Bridge) PermissionPending(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) events.Event
- func (b *Bridge) ReplayStarted() events.Event
- func (b *Bridge) ResolveElicitation(id string) []events.Event
- func (b *Bridge) ResolvePermission(id string) []events.Event
- func (b *Bridge) SeedSession(modes *acpsdk.SessionModeState, config []acpsdk.SessionConfigOption) []events.Event
- func (b *Bridge) Snapshot() []events.Event
- func (b *Bridge) Started() events.Event
- func (b *Bridge) Update(update acpsdk.SessionUpdate) ([]events.Event, error)
- func (b *Bridge) closeMessage() []events.Event
- func (b *Bridge) closeOpenTools(failed bool) []events.Event
- func (b *Bridge) closeReasoning() []events.Event
- func (b *Bridge) endTool(id string) []events.Event
- func (b *Bridge) ensureMessageID(messageID *string) string
- func (b *Bridge) ensureReasoningID(messageID *string) string
- func (b *Bridge) messageChunk(role string, msgID *string, content acpsdk.ContentBlock) []events.Event
- func (b *Bridge) planUpdate(u *acpsdk.SessionPlanUpdate) []events.Event
- func (b *Bridge) startTool(tc *acpsdk.SessionUpdateToolCall) []events.Event
- func (b *Bridge) toolProgressEvents(id string, content []acpsdk.ToolCallContent, rawOutput any) (progress []events.Event, resultText string, hasResult bool)
- func (b *Bridge) updateTool(u *acpsdk.SessionToolCallUpdate) []events.Event
- type MediaDescriptor
- type ToolDiff
- type ToolTerminal
- type projection
- type toolMeta
Variables
Section titled “Variables”“mode” is the harness’s own permission axis (approve/auto/chat/…); it must never reach a client, which could switch it live and silence the coordinator’s RequestPermission callback for the rest of the session.
var harnessConfigOptionsToDrop = map[string]bool{"mode": true}func ElicitationPayload
Section titled “func ElicitationPayload”func ElicitationPayload(id, message, mode string, schema any, url string) map[string]anyElicitationPayload is ElicitationPending’s payload-builder, exported for the same reason as PermissionPayload -- one shape shared by the live STATE stream and any push notification dispatch.
func PermissionPayload
Section titled “func PermissionPayload”func PermissionPayload(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) map[string]anyPermissionPayload builds the same AG-UI-shaped payload PermissionPending wraps into a STATE_DELTA -- exported so a non-SSE consumer (push notification dispatch) can carry the exact vocabulary the client already parses (requestId/options[].optionId,name,kind/toolCallId/title/kind) instead of a second, narrower schema. Single source of truth: the live STATE stream and any push payload are built from this one function, so they cannot drift apart.
func commands
Section titled “func commands”func commands(cmds []acpsdk.AvailableCommand) []map[string]anycommands projects an ACP available-commands slice into the AG-UI client’s expected shape (name + description).
func configOptions
Section titled “func configOptions”func configOptions(opts []acpsdk.SessionConfigOption) []map[string]anyconfigOptions decodes ACP’s discriminated union (Boolean | Select). The `kind` discriminator is preserved so clients can branch on it; the original id/name/currentValue are carried alongside so the Flutter side can rebuild either a checkbox or a dropdown from one slice.
func customContent
Section titled “func customContent”func customContent(messageID string, m MediaDescriptor) events.EventcustomContent emits `pocketcoder:content` for media-bearing message chunks (image / audio / resource / resource_link) that AG-UI’s TEXT_MESSAGE_* events can’t represent on their own.
func customDiff
Section titled “func customDiff”func customDiff(toolCallID string, d ToolDiff) events.EventcustomDiff emits `pocketcoder:diff` for a single tool-call diff hunk.
func customTerminal
Section titled “func customTerminal”func customTerminal(toolCallID string, term ToolTerminal) events.EventcustomTerminal emits `pocketcoder:terminal` to attach a terminal handle to a tool call so the UI can stream its output.
func customTool
Section titled “func customTool”func customTool(id, title, kind, status string, locations []acpsdk.ToolCallLocation) events.EventcustomTool emits `pocketcoder:tool` carrying identifier, title, kind, status, and follow-along file locations. Mirrors ACP’s startTool/updateTool arms.
func customToolContent
Section titled “func customToolContent”func customToolContent(toolCallID string, m MediaDescriptor) events.EventcustomToolContent emits `pocketcoder:content` for media-bearing tool result content blocks (image / audio / resource / resource_link), keyed by toolCallId rather than messageId -- same event kind and field shape as customContent, distinct id namespace (mirrors customDiff/customTerminal).
func deref
Section titled “func deref”func deref(s *string) stringfunc isTerminalToolStatus
Section titled “func isTerminalToolStatus”func isTerminalToolStatus(status string) boolfunc planEntries
Section titled “func planEntries”func planEntries(entries []acpsdk.PlanEntry) []map[string]anyplanEntries projects an ACP plan entry slice into the AG-UI client’s expected shape (content + priority + status strings). Helper kept package-private since it’s only consumed by the Update dispatch.
func rawEvent
Section titled “func rawEvent”func rawEvent(kind string, _ any) events.EventrawEvent is the redacted fallback emitted for any unmapped ACP update variant. It only ships `{“unmapped”: <kind>}` (plus source); the payload argument is intentionally ignored so ACP `_meta` / cost blobs cannot leak. Callers debug-gate by choosing to emit this at all; the default stays redacted per the spec.
func renderToolContent
Section titled “func renderToolContent”func renderToolContent(content []acpsdk.ToolCallContent, rawOutput any) (string, []ToolDiff, []ToolTerminal, []MediaDescriptor, bool, error)renderToolContent splits ACP tool result content into a fallback text rendering (for TOOL_CALL_RESULT.content), structured diffs/terminals (for CUSTOM pocketcoder:{diff,terminal}), and any media content blocks (for CUSTOM pocketcoder:content) -- a tool result’s content block can itself be an image/resource, same as a message chunk, and must not be silently dropped just because renderContent’s text half was empty. rawOutput is the JSON fallback when no content blocks are present.
func selectOptions
Section titled “func selectOptions”func selectOptions(opts acpsdk.SessionConfigSelectOptions) []map[string]anyselectOptions projects a select config option’s candidate values into a flat list of {name, value, description} maps. Grouped options are flattened (group headers dropped) since the client has no grouped-dropdown UI to render them into; ungrouped options pass through as-is.
func sessionModes
Section titled “func sessionModes”func sessionModes(modes []acpsdk.SessionMode) []map[string]anysessionModes projects an ACP session-mode slice into the AG-UI client’s expected shape (id + name + optional description). Kept package-private; it is only consumed by SeedSession.
type Bridge
Section titled “type Bridge”Bridge keeps only the open-event state needed to turn ACP chunks into AG-UI message boundaries for one run.
type Bridge struct { threadID, runID string messageID string messageOpen bool messageRole string reasoningID string reasoningOpen bool openTools map[string]toolMeta state projection}func NewBridge
Section titled “func NewBridge”func NewBridge(threadID, runID string) *BridgeNewBridge starts an AG-UI run for one PocketCoder chat / Goose session pair.
func (*Bridge) CloseOpenTools
Section titled “func (*Bridge) CloseOpenTools”func (b *Bridge) CloseOpenTools() []events.Eventfunc (*Bridge) CloseOpenToolsAsFailed
Section titled “func (*Bridge) CloseOpenToolsAsFailed”func (b *Bridge) CloseOpenToolsAsFailed() []events.Eventfunc (*Bridge) ConfigUpdated
Section titled “func (*Bridge) ConfigUpdated”func (b *Bridge) ConfigUpdated(options []acpsdk.SessionConfigOption) []events.Eventfunc (*Bridge) ElicitationPending
Section titled “func (*Bridge) ElicitationPending”func (b *Bridge) ElicitationPending(id, message, mode string, schema any, url string) events.EventElicitationPending records a pending elicitation in the projection. The returned STATE_DELTA mirrors PermissionPending’s shape so the client UI can render any pending side-channel request from the same STATE stream.
func (*Bridge) Finished
Section titled “func (*Bridge) Finished”func (b *Bridge) Finished(stopReason acpsdk.StopReason) []events.EventFinished closes all lifecycle events. Call this only after the correlated session/prompt response, never by guessing from the final text chunk.
func (*Bridge) PermissionPending
Section titled “func (*Bridge) PermissionPending”func (b *Bridge) PermissionPending(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) events.Eventfunc (*Bridge) ReplayStarted
Section titled “func (*Bridge) ReplayStarted”func (b *Bridge) ReplayStarted() events.EventReplayStarted marks the head of a cold replay so the client discards its cached view and rebuilds from this replay (Goose is authority). Distinct from Started() which begins a live turn.
func (*Bridge) ResolveElicitation
Section titled “func (*Bridge) ResolveElicitation”func (b *Bridge) ResolveElicitation(id string) []events.EventResolveElicitation clears a pending elicitation from the projection. Same id-symmetry rationale as ResolvePermission.
func (*Bridge) ResolvePermission
Section titled “func (*Bridge) ResolvePermission”func (b *Bridge) ResolvePermission(id string) []events.EventResolvePermission clears a pending permission from the projection. The id is accepted for call-site symmetry with the c1 approval endpoint and a future multi-pending model; v1 stores a single pending entry per namespace so the param is unused and remove suffices.
func (*Bridge) SeedSession
Section titled “func (*Bridge) SeedSession”func (b *Bridge) SeedSession(modes *acpsdk.SessionModeState, config []acpsdk.SessionConfigOption) []events.EventSeedSession primes the /pocketcoder projection with the modes and config that the agent advertised on session/new (or session/load). It is called once per run, before any Update. The returned events are STATE_DELTAs that a subscriber can replay so the Flutter side has the initial state without waiting for a CurrentModeUpdate / ConfigOptionUpdate to arrive.
func (*Bridge) Snapshot
Section titled “func (*Bridge) Snapshot”func (b *Bridge) Snapshot() []events.EventSnapshot returns the current /pocketcoder projection as a single STATE_SNAPSHOT (or nil when nothing has been recorded). Intended for subscriber attach so a late-joining client can catch up without re-emitting every delta.
func (*Bridge) Started
Section titled “func (*Bridge) Started”func (b *Bridge) Started() events.EventStarted emits the first AG-UI event for a turn.
func (*Bridge) Update
Section titled “func (*Bridge) Update”func (b *Bridge) Update(update acpsdk.SessionUpdate) ([]events.Event, error)Update converts output-bearing ACP updates. Unknown update variants are intentionally ignored rather than leaking vendor details to Flutter.
func (*Bridge) closeMessage
Section titled “func (*Bridge) closeMessage”func (b *Bridge) closeMessage() []events.Eventfunc (*Bridge) closeOpenTools
Section titled “func (*Bridge) closeOpenTools”func (b *Bridge) closeOpenTools(failed bool) []events.Eventfunc (*Bridge) closeReasoning
Section titled “func (*Bridge) closeReasoning”func (b *Bridge) closeReasoning() []events.Eventfunc (*Bridge) endTool
Section titled “func (*Bridge) endTool”func (b *Bridge) endTool(id string) []events.EventendTool closes a single open tool id. Returns nil if the id is unknown so re-entry (e.g. a late terminal status) is a no-op rather than a duplicate TOOL_CALL_END.
func (*Bridge) ensureMessageID
Section titled “func (*Bridge) ensureMessageID”func (b *Bridge) ensureMessageID(messageID *string) stringfunc (*Bridge) ensureReasoningID
Section titled “func (*Bridge) ensureReasoningID”func (b *Bridge) ensureReasoningID(messageID *string) stringfunc (*Bridge) messageChunk
Section titled “func (*Bridge) messageChunk”func (b *Bridge) messageChunk(role string, msgID *string, content acpsdk.ContentBlock) []events.EventmessageChunk is the shared emit path for ACP user/agent message chunks. It routes text to TEXT_MESSAGE_START/CONTENT with the given role, and routes media (image/audio/resource/resource_link) to CUSTOM pocketcoder:content without opening a text scope. Reasoning and the previous message are closed before opening a new assistant text scope, so mutual-exclusion between REASONING_MESSAGE and TEXT_MESSAGE is preserved across chunks.
The msgID switch check happens before ensureMessageID mutates b.messageID (ensureMessageID itself resets b.messageOpen when the ID changes), so a pending TEXT_MESSAGE_END for the previous message still fires.
func (*Bridge) planUpdate
Section titled “func (*Bridge) planUpdate”func (b *Bridge) planUpdate(u *acpsdk.SessionPlanUpdate) []events.EventplanUpdate decodes SessionPlanUpdate’s discriminated union (Items | File | Markdown). Items carries a full entry list — same full-replace semantics as the Plan variant, so it’s projected through planEntries the same way. File and Markdown have no entries shape to reuse; they’re projected under their own keys so the client can still render a URI or raw markdown plan. Any future union member is a soft miss: never abort the turn; surface as redacted RAW.
func (*Bridge) startTool
Section titled “func (*Bridge) startTool”func (b *Bridge) startTool(tc *acpsdk.SessionUpdateToolCall) []events.EventstartTool handles the initial tool_call. tc is the FLAT SessionUpdate variant: fields (ToolCallId, Title, Kind, Status, Content, RawInput, RawOutput, Locations) live directly on it. Single-shot: an initial terminal status with content emits TOOL_CALL_RESULT + TOOL_CALL_END in the same burst so the output is never lost when ACP delivers a completed call up-front.
func (*Bridge) toolProgressEvents
Section titled “func (*Bridge) toolProgressEvents”func (b *Bridge) toolProgressEvents(id string, content []acpsdk.ToolCallContent, rawOutput any) (progress []events.Event, resultText string, hasResult bool)toolProgressEvents never signals completion to the client, unlike TOOL_CALL_RESULT, so diff/terminal/media events are safe to emit unconditionally here even while a tool call is still in_progress.
func (*Bridge) updateTool
Section titled “func (*Bridge) updateTool”func (b *Bridge) updateTool(u *acpsdk.SessionToolCallUpdate) []events.EventupdateTool handles tool_call_update. Its fields are POINTERS (partial update), unlike startTool’s flat non-pointer struct — read-modify-write the retained meta. Unknown tool ids still emit an update (zero-value meta) so the client always sees the latest state.
type MediaDescriptor
Section titled “type MediaDescriptor”MediaDescriptor summarizes one non-text ACP content block for downstream UI. Exactly one of (text, media) is populated per call to renderContent.
type MediaDescriptor struct { Kind string `json:"kind"` MimeType string `json:"mimeType,omitempty"` URI string `json:"uri,omitempty"` Name string `json:"name,omitempty"` Size int `json:"size,omitempty"`}func renderContent
Section titled “func renderContent”func renderContent(block acpsdk.ContentBlock) (string, *MediaDescriptor, bool)renderContent decodes one ACP content block into either text or a media descriptor. No variant falls through: unknown/empty returns ok=false so the caller emits RAW rather than silently dropping it.
type ToolDiff
Section titled “type ToolDiff”ToolDiff is the structured shape AG-UI clients render for an ACP diff result. Path is required; OldText is omitted for new-file diffs; NewText is the new content.
type ToolDiff struct { Path string `json:"path"` OldText string `json:"oldText,omitempty"` NewText string `json:"newText"`}type ToolTerminal
Section titled “type ToolTerminal”ToolTerminal carries the terminal-id pointer for tools that return one.
type ToolTerminal struct { TerminalID string `json:"terminalId"` Type string `json:"type,omitempty"`}type projection
Section titled “type projection”projection owns the current-value map for /pocketcoder/* namespaces. A nil state map means “no namespaced state has been set yet”, so snapshot() can return nil instead of an empty snapshot.
type projection struct { state map[string]any}func (*projection) ensure
Section titled “func (*projection) ensure”func (p *projection) ensure()ensure lazily allocates the underlying map. Called by set; remove tolerates a nil map (matching ensure’s contract that it’s only consulted when state exists).
func (*projection) remove
Section titled “func (*projection) remove”func (p *projection) remove(ns string) events.Eventremove deletes the /pocketcoder/<ns> namespace and returns the matching STATE_DELTA. remove on an unknown namespace still emits a remove patch; the client treats it as a no-op and the next snapshot stays empty.
func (*projection) set
Section titled “func (*projection) set”func (p *projection) set(ns string, value any) events.Eventset stores value at /pocketcoder/<ns> and returns the STATE_DELTA event for the client to apply. Storing first means a snapshot taken immediately after a set sees the new value, which is what clients expect on reconnect.
func (*projection) setSub
Section titled “func (*projection) setSub”func (p *projection) setSub(ns, key string, value any) events.EventsetSub patches /pocketcoder/<ns>/<key> in place, preserving any sibling keys already stored under ns (unlike set, which replaces the whole ns value). If ns isn’t a map yet (or holds a non-map value), a fresh sub-map is created so the patch never throws on an absent parent.
func (*projection) snapshot
Section titled “func (*projection) snapshot”func (p *projection) snapshot() []events.Eventsnapshot returns a single STATE_SNAPSHOT covering the entire /pocketcoder subtree, or nil when nothing has been set. One whole-subtree snapshot is cheaper than per-namespace snapshots and lets subscribers atomically rebuild the current state on attach.
type toolMeta
Section titled “type toolMeta”type toolMeta struct { title, kind, status string // ACP content can arrive while status is still in_progress; emitting // it immediately would make the client treat the call as done early. pendingResultText string pendingHasResult bool}coordinator
Section titled “coordinator”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/coordinator"@pocketcoder-core: Agent Coordinator. Owns the per-chat Goose ACP connection and the run/approval lifecycle.
@pocketcoder-core: Run Lifecycle. Drives a single AG-UI run over the ACP session and resolves permission callbacks.
- Constants
- Variables
- func DefaultPermissionTimeout() time.Duration
- func DefaultWorkspace() string
- func actionRank(action ToolPermissionAction) int
- func apiKeyInvalidMessage(harnessName string) string
- func automaticPermissionResponse(options []acpsdk.PermissionOption, action ToolPermissionAction) acpsdk.RequestPermissionResponse
- func emitAll(emit Emit, values []events.Event) error
- func gooseProviderDefaultModel(ctx context.Context, conn acp.Conn, providerIDString string) (string, error)
- func initializeRequest() acpsdk.InitializeRequest
- func isConnDone(conn acp.Conn) bool
- func isModeNotFoundError(err error, mode acpsdk.SessionModeId) bool
- func isModelNotFoundError(err error, model string) bool
- func matchesAuthFailureMarker(err error) bool
- func modeAdvertised(modes *acpsdk.SessionModeState, mode acpsdk.SessionModeId) bool
- func permissionToolIdentity(call acpsdk.ToolCallUpdate) (string, []string)
- func providerApiKeyFailure(accountLogin bool, err error) bool
- func providerAuthFailure(accountLogin bool, err error) bool
- func providerRunError(accountLogin bool, harnessName, fallback string, err error) events.Event
- func reauthRequiredMessage(harnessName string) string
- func registerProviderCredential(ctx context.Context, conn acp.Conn, providerIDString, fieldName, fieldValue string) error
- func requestErrorData(err error) (data map[string]any, code int, ok bool)
- func selectedPermission(id acpsdk.PermissionOptionId) acpsdk.RequestPermissionResponse
- func setGooseDefaultProvider(ctx context.Context, conn acp.Conn, providerIDString, modelID string) error
- func setModelWithRetry(ctx context.Context, conn acp.Conn, sessionID, model string) ([]acpsdk.SessionConfigOption, error)
- func unsupported() error
- func wildcardMatch(pattern, value string) bool
- type AgentRuntime
- type Attachment
- type ChatHub
- func NewChatHub(clock Clock, lingerWindow time.Duration, liveBuf int) *ChatHub
- func (h *ChatHub) Attach(cursor int) Attachment
- func (h *ChatHub) FinishRun()
- func (h *ChatHub) IsEmpty() bool
- func (h *ChatHub) Publish(ev events.Event) int
- func (h *ChatHub) StartRun(runID string, snapshot func() []events.Event)
- func (h *ChatHub) evictNow()
- func (h *ChatHub) nextSeq() int
- func (h *ChatHub) nextSeqLocked() int
- func (h *ChatHub) seqForTest(to int)
- func (h *ChatHub) unsubscribe(s *subscriber)
- type Clock
- type Config
- type Coordinator
- func New(config Config) (*Coordinator, error)
- func (c *Coordinator) Approve(_ context.Context, chatID, requestID, optionID string) error
- func (c *Coordinator) Attach(chatID string, cursor int) Attachment
- func (c *Coordinator) Cancel(ctx context.Context, chatID string) error
- func (c *Coordinator) CheckIdempotency(chatID, key string) (any, bool)
- func (c *Coordinator) DeleteSession(ctx context.Context, app core.App, chatID string) error
- func (c *Coordinator) DenyPermission(chatID, requestID string) error
- func (c *Coordinator) NextSeq(chatID string) int
- func (c *Coordinator) RecordIdempotency(chatID, key string, result any)
- func (c *Coordinator) Reserve(chatID string) error
- func (c *Coordinator) ResolveElicitation(chatID, id string, resp acpsdk.UnstableCreateElicitationResponse) error
- func (c *Coordinator) SetConfigOption(ctx context.Context, chatID string, req acpsdk.SetSessionConfigOptionRequest) error
- func (c *Coordinator) SetMode(ctx context.Context, chatID, modeID string) error
- func (c *Coordinator) Shutdown(ctx context.Context)
- func (c *Coordinator) StartPrompt(chatID, prompt string, resolve ResolveSession, profileFn ProfileFunc, created OnSessionCreated, finished OnRunFinished, opts …RunOption) (string, error)
- func (c *Coordinator) StreamColdReplay(ctx context.Context, chatID, sessionID string, profileFn ProfileFunc, emit func(seq int, ev events.Event) error) error
- func (c *Coordinator) clearRun(chatID, runID string)
- func (c *Coordinator) dropPendingForChat(chat string)
- func (c *Coordinator) establishSession(ctx context.Context, client acpsdk.Client, profile SessionProfile, sessionID string, beforeSessionCall func()) (conn acp.Conn, newSessionID string, modes *acpsdk.SessionModeState, configOptions []acpsdk.SessionConfigOption, initResp *acpsdk.InitializeResponse, wasNew bool, err error)
- func (c *Coordinator) hubFor(chatID string) *ChatHub
- func (c *Coordinator) isReserved(chatID string) bool
- func (c *Coordinator) reapHub(chatID string)
- func (c *Coordinator) registerRun(chatID string, h *runHandle)
- func (c *Coordinator) release(chatID string)
- func (c *Coordinator) runFor(chatID string) *runHandle
- func (c *Coordinator) runLoop(runCtx context.Context, chatID, runID, prompt string, h *runHandle, resolve ResolveSession, profileFn ProfileFunc, created OnSessionCreated, finished OnRunFinished, onRunEnded func(context.Context, string, RunOutcome), userMessageID string)
- func (c *Coordinator) stopTimers(h *runHandle)
- func (c *Coordinator) trackTimer(chatID, runID string, t Timer)
- type DialFunc
- type Emit
- type GlobalConfigApplier
- type LiveConfigBootstrap
- type OnRunFinished
- type OnSessionCreated
- type PerSessionApplier
- type ProfileApplier
- type ProfileFunc
- type ProviderBootstrap
- type ResolveSession
- type RunOption
- type RunOutcome
- type SessionProfile
- type StaticEnvBootstrap
- type Target
- type Timer
- type ToolPermissionAction
- type ToolPermissionRule
- type defaultsSaveRequest
- type defaultsSaveResponse
- type elicitationDecision
- type fakeClock
- type fakeTimer
- type idempotencySlot
- type pendingElicitation
- type pendingPermission
- type permissionDecision
- type providerConfigFieldUpdate
- type providerConfigSaveRequest
- type providerConfigSaveResponse
- type providerConfigStatus
- type providerInventoryEntry
- type providersListRequest
- type providersListResponse
- type realClock
- type run
- type runHandle
- type runOptions
- type seqEvent
- type sessionClient
- func (s *sessionClient) CreateTerminal(context.Context, acpsdk.CreateTerminalRequest) (acpsdk.CreateTerminalResponse, error)
- func (s *sessionClient) KillTerminal(context.Context, acpsdk.KillTerminalRequest) (acpsdk.KillTerminalResponse, error)
- func (s *sessionClient) ReadTextFile(context.Context, acpsdk.ReadTextFileRequest) (acpsdk.ReadTextFileResponse, error)
- func (s *sessionClient) ReleaseTerminal(context.Context, acpsdk.ReleaseTerminalRequest) (acpsdk.ReleaseTerminalResponse, error)
- func (s *sessionClient) RequestPermission(ctx context.Context, req acpsdk.RequestPermissionRequest) (acpsdk.RequestPermissionResponse, error)
- func (s *sessionClient) SessionUpdate(_ context.Context, n acpsdk.SessionNotification) error
- func (s *sessionClient) TerminalOutput(context.Context, acpsdk.TerminalOutputRequest) (acpsdk.TerminalOutputResponse, error)
- func (s *sessionClient) UnstableCreateElicitation(ctx context.Context, req acpsdk.UnstableCreateElicitationRequest) (acpsdk.UnstableCreateElicitationResponse, error)
- func (s *sessionClient) WaitForTerminalExit(context.Context, acpsdk.WaitForTerminalExitRequest) (acpsdk.WaitForTerminalExitResponse, error)
- func (s *sessionClient) WriteTextFile(context.Context, acpsdk.WriteTextFileRequest) (acpsdk.WriteTextFileResponse, error)
- func (s *sessionClient) removePending(id string, expected *pendingPermission)
- func (s *sessionClient) removePendingElicitation(id string, expected *pendingElicitation)
- func (s *sessionClient) resolveExpired(id string, expected *pendingPermission)
- func (s *sessionClient) resolveExpiredElicitation(id string, expected *pendingElicitation)
- type subscriber
Constants
Section titled “Constants”const ( providerAuthRequiredCode = "provider_auth_required" providerApiKeyInvalidCode = "provider_api_key_invalid")const gooseDefaultsSaveMethod = "_goose/unstable/defaults/save"const gooseProviderConfigSaveMethod = "_goose/unstable/providers/config/save"const gooseProvidersListMethod = "_goose/unstable/providers/list"Variables
Section titled “Variables”Overridable by tests so TestPerSessionApplierGivesUpOnGenuinelyUnknownModel doesn’t have to wait out the real production timeout.
var ( modelRetryTimeout = 90 * time.Second modelRetryPollInterval = time.Second)Switching the harness’s own permission axis live could silence RequestPermission for the rest of the session, so it’s never forwarded.
var ErrHarnessModeConfigRejected = errors.New(`configId "mode" is reserved for PocketCoder's own permission layer and cannot be set directly`)var ErrNoActiveRun = errors.New("no active run")var ErrNoPendingElicitation = errors.New("no pending elicitation")var ErrNoPendingPermission = errors.New("no pending permission")var ErrPermissionOptionNotOffered = errors.New("permission option was not offered")var ErrRunInProgress = errors.New("chat already has an active run")func DefaultPermissionTimeout
Section titled “func DefaultPermissionTimeout”func DefaultPermissionTimeout() time.DurationDefaultPermissionTimeout reads POCKETCODER_PERMISSION_TIMEOUT once, falling back to 5 minutes for an empty or invalid value.
func DefaultWorkspace
Section titled “func DefaultWorkspace”func DefaultWorkspace() stringDefaultWorkspace reads POCKETCODER_WORKSPACE once, falling back to “/workspace”.
func actionRank
Section titled “func actionRank”func actionRank(action ToolPermissionAction) intfunc apiKeyInvalidMessage
Section titled “func apiKeyInvalidMessage”func apiKeyInvalidMessage(harnessName string) stringapiKeyInvalidMessage builds the invalid-credential copy for an api_key harness -- distinct from reauthRequiredMessage’s OAuth-flavored “your saved login was kept” wording, since there is no login session to keep here, only a saved key the user should go check in Harness Connections.
func automaticPermissionResponse
Section titled “func automaticPermissionResponse”func automaticPermissionResponse(options []acpsdk.PermissionOption, action ToolPermissionAction) acpsdk.RequestPermissionResponsefunc emitAll
Section titled “func emitAll”func emitAll(emit Emit, values []events.Event) errorfunc gooseProviderDefaultModel
Section titled “func gooseProviderDefaultModel”func gooseProviderDefaultModel(ctx context.Context, conn acp.Conn, providerIDString string) (string, error)gooseProviderDefaultModel asks goose for the model it would itself pick as the default for providerIDString -- guaranteed to exist in goose’s own live provider inventory, unlike anything sourced from PocketBase’s own harness_models catalog (see LiveConfigBootstrap’s doc comment for why that distinction matters).
func initializeRequest
Section titled “func initializeRequest”func initializeRequest() acpsdk.InitializeRequestfunc isConnDone
Section titled “func isConnDone”func isConnDone(conn acp.Conn) boolisConnDone reports whether conn’s transport has already signalled shutdown, distinguishing a dead pipe from an application-level harness error while the connection is still alive.
func isModeNotFoundError
Section titled “func isModeNotFoundError”func isModeNotFoundError(err error, mode acpsdk.SessionModeId) boolData.mode is checked before the message text, which can drift.
func isModelNotFoundError
Section titled “func isModelNotFoundError”func isModelNotFoundError(err error, model string) boolData.modelId is checked before the message text, which can drift.
func matchesAuthFailureMarker
Section titled “func matchesAuthFailureMarker”func matchesAuthFailureMarker(err error) boolfunc modeAdvertised
Section titled “func modeAdvertised”func modeAdvertised(modes *acpsdk.SessionModeState, mode acpsdk.SessionModeId) boolfunc permissionToolIdentity
Section titled “func permissionToolIdentity”func permissionToolIdentity(call acpsdk.ToolCallUpdate) (string, []string)func providerApiKeyFailure
Section titled “func providerApiKeyFailure”func providerApiKeyFailure(accountLogin bool, err error) boolproviderApiKeyFailure classifies a run failure from a session whose harness/provider pair uses a bare API key rather than an account-owned login (the accountLogin == false counterpart to providerAuthFailure). Without this, an api_key harness (goose, opencode) that gets a genuinely rejected/invalid key from its upstream provider collapsed into the same generic “goose_unavailable” code as a crashed container or a network failure -- indistinguishable from every other kind of failure, and giving the user no actionable signal to go fix their saved key. It intentionally reuses the same textual markers as providerAuthFailure: the upstream provider’s own wording for “your credential was rejected” doesn’t change based on whether PocketCoder obtained that credential via OAuth or a pasted key.
func providerAuthFailure
Section titled “func providerAuthFailure”func providerAuthFailure(accountLogin bool, err error) boolproviderAuthFailure deliberately classifies only errors from a session whose harness account uses an account-owned login rather than a bare API key (SessionProfile.AccountLogin, resolved from credential_selections.mode == “oauth” for the session’s (harness, provider) pair). That flag comes from the user’s actual credential selection, not a hardcoded per-provider name list -- a name list is what this used to be (claude/claude-code only), and it silently left Codex’s own account-login errors misclassified as a generic failure with no reauth path, even though harness_provision.go’s renderEnv had already started treating Codex the same as Claude Code for credential purposes. Keying off the account’s real credential mode means any future account-login harness is covered automatically. It does not modify the provider’s durable auth volume: a failed request is a signal to reauthenticate, not permission to erase a user’s saved login.
func providerRunError
Section titled “func providerRunError”func providerRunError(accountLogin bool, harnessName, fallback string, err error) events.Eventfunc reauthRequiredMessage
Section titled “func reauthRequiredMessage”func reauthRequiredMessage(harnessName string) stringreauthRequiredMessage builds the reauth-required copy for whichever account-login harness actually failed, rather than a name hardcoded for one harness -- the client only keys off the event’s error code today (see chat_cubit.dart), but this message is still surfaced through logs and any future client that reads it, so it should name the right harness.
func registerProviderCredential
Section titled “func registerProviderCredential”func registerProviderCredential(ctx context.Context, conn acp.Conn, providerIDString, fieldName, fieldValue string) errorregisterProviderCredential persists a provider’s saved API key into goose’s own provider registry via its custom ACP method, so a subsequent SetSessionConfigOption(“provider”, providerIDString) call succeeds instead of failing with “Provider not set” -- goose only allows switching to a provider its own config/secrets store already knows about, and does not discover credentials from process env vars for anything but the one provider it booted with. providerIDString is the provider_id STRING (e.g. “openai”), matching what goose’s own registry keys on and what SessionProfile.Provider already holds -- never a PocketBase record id.
func requestErrorData
Section titled “func requestErrorData”func requestErrorData(err error) (data map[string]any, code int, ok bool)func selectedPermission
Section titled “func selectedPermission”func selectedPermission(id acpsdk.PermissionOptionId) acpsdk.RequestPermissionResponsefunc setGooseDefaultProvider
Section titled “func setGooseDefaultProvider”func setGooseDefaultProvider(ctx context.Context, conn acp.Conn, providerIDString, modelID string) errorsetGooseDefaultProvider sets providerIDString as goose’s active default provider, using modelID as the default model. Callers should pass a model sourced from goose’s own inventory (gooseProviderDefaultModel), not from PocketBase’s own harness_models catalog: defaults/save strictly validates modelID against goose’s live provider inventory, and a catalog pick with no is_default row set can resolve to a model that inventory doesn’t recognize, which fails this call outright -- see LiveConfigBootstrap’s doc comment. The caller’s actual desired model (which may differ from modelID here) is applied separately, afterward, via the ordinary per-session model switch.
func setModelWithRetry
Section titled “func setModelWithRetry”func setModelWithRetry(ctx context.Context, conn acp.Conn, sessionID, model string) ([]acpsdk.SessionConfigOption, error)A “model not found” moments after connecting can mean a fresh stdio subprocess’s own catalog sync hasn’t finished yet, not a real bad model name. Retry for a bounded window before giving up.
func unsupported
Section titled “func unsupported”func unsupported() errorfunc wildcardMatch
Section titled “func wildcardMatch”func wildcardMatch(pattern, value string) booltype AgentRuntime
Section titled “type AgentRuntime”AgentRuntime is the execution surface shared by agent and schedule routes.
type AgentRuntime interface { StartPrompt(chatID, prompt string, resolve ResolveSession, profileFn ProfileFunc, created OnSessionCreated, finished OnRunFinished, opts ...RunOption) (string, error) Attach(chatID string, cursor int) Attachment NextSeq(chatID string) int StreamColdReplay(ctx context.Context, chatID, sessionID string, profileFn ProfileFunc, emit func(seq int, ev events.Event) error) error Cancel(ctx context.Context, chatID string) error SetMode(ctx context.Context, chatID, modeID string) error SetConfigOption(ctx context.Context, chatID string, req acpsdk.SetSessionConfigOptionRequest) error Approve(ctx context.Context, chatID, requestID, optionID string) error DenyPermission(chatID, requestID string) error ResolveElicitation(chatID, id string, resp acpsdk.UnstableCreateElicitationResponse) error DeleteSession(ctx context.Context, app core.App, chatID string) error Shutdown(ctx context.Context) CheckIdempotency(chatID, key string) (any, bool) RecordIdempotency(chatID, key string, result any)}type Attachment
Section titled “type Attachment”type Attachment struct { Snapshot []events.Event // Bridge.Snapshot() at join; flushed first Buffered []seqEvent // in-memory log with Seq > cursor Live <-chan seqEvent ColdReplayNeeded bool // caller must Goose-replay history before flushing Unsubscribe func()}type ChatHub
Section titled “type ChatHub”type ChatHub struct { mu sync.Mutex seq int // chat-global monotonic, never reset active *run subs map[*subscriber]struct{} clock Clock lingerWindow time.Duration liveBuf int}func NewChatHub
Section titled “func NewChatHub”func NewChatHub(clock Clock, lingerWindow time.Duration, liveBuf int) *ChatHubfunc (*ChatHub) Attach
Section titled “func (*ChatHub) Attach”func (h *ChatHub) Attach(cursor int) Attachmentfunc (*ChatHub) FinishRun
Section titled “func (*ChatHub) FinishRun”func (h *ChatHub) FinishRun()func (*ChatHub) IsEmpty
Section titled “func (*ChatHub) IsEmpty”func (h *ChatHub) IsEmpty() boolfunc (*ChatHub) Publish
Section titled “func (*ChatHub) Publish”func (h *ChatHub) Publish(ev events.Event) intfunc (*ChatHub) StartRun
Section titled “func (*ChatHub) StartRun”func (h *ChatHub) StartRun(runID string, snapshot func() []events.Event)func (*ChatHub) evictNow
Section titled “func (*ChatHub) evictNow”func (h *ChatHub) evictNow()evictNow forces the lingering run to be evicted immediately. Test-only.
func (*ChatHub) nextSeq
Section titled “func (*ChatHub) nextSeq”func (h *ChatHub) nextSeq() intnextSeq allocates the next hub-global monotonic sequence number. It is used both by live Publish and by cold-replay emission so a single stream’s ids are strictly increasing regardless of which path produced them.
func (*ChatHub) nextSeqLocked
Section titled “func (*ChatHub) nextSeqLocked”func (h *ChatHub) nextSeqLocked() intnextSeqLocked allocates the next seq; caller must hold h.mu.
func (*ChatHub) seqForTest
Section titled “func (*ChatHub) seqForTest”func (h *ChatHub) seqForTest(to int)seqForTest advances the chat-global seq without buffering, simulating events evicted with a prior run. Test-only.
func (*ChatHub) unsubscribe
Section titled “func (*ChatHub) unsubscribe”func (h *ChatHub) unsubscribe(s *subscriber)type Clock
Section titled “type Clock”type Clock interface { Now() time.Time AfterFunc(d time.Duration, f func()) Timer}func RealClock
Section titled “func RealClock”func RealClock() Clocktype Config
Section titled “type Config”type Config struct { Workspace string PermissionTimeout time.Duration Dial DialFunc Clock Clock LingerWindow time.Duration MaxRun time.Duration ElicitationTimeout time.Duration MaxRunEvents int LiveBuffer int // OnPermissionPending fires whenever a permission request actually goes // pending (i.e. session-profile rules didn't auto-resolve it) -- the // hook point for dispatching a push notification. payload is exactly // what agui.PermissionPayload builds -- the same AG-UI STATE_DELTA shape // (requestId/status/options[].optionId,name,kind/toolCallId/title/kind) // the Flutter client already parses from the live SSE stream, not a // second ACP-shaped schema it's never had to speak. Called from a // goroutine by the caller; must not block or delay the permission wait. OnPermissionPending func(ctx context.Context, chatID string, payload map[string]any) // OnElicitationPending mirrors OnPermissionPending for elicitation // (spec N5's separate id-space): payload is agui.ElicitationPayload's // shape (elicitationId/message/mode/requestedSchema/url). OnElicitationPending func(ctx context.Context, chatID string, payload map[string]any)}type Coordinator
Section titled “type Coordinator”type Coordinator struct { config Config mu sync.Mutex running map[string]struct{} pending map[string]*pendingPermission clock Clock hubs map[string]*ChatHub runs map[string]*runHandle elicits map[string]*pendingElicitation lingerWindow time.Duration maxRun time.Duration elicitationTimeout time.Duration maxRunEvents int liveBuf int idempotency map[string]idempotencySlot}func New
Section titled “func New”func New(config Config) (*Coordinator, error)func (*Coordinator) Approve
Section titled “func (*Coordinator) Approve”func (c *Coordinator) Approve(_ context.Context, chatID, requestID, optionID string) errorfunc (*Coordinator) Attach
Section titled “func (*Coordinator) Attach”func (c *Coordinator) Attach(chatID string, cursor int) Attachmentfunc (*Coordinator) Cancel
Section titled “func (*Coordinator) Cancel”func (c *Coordinator) Cancel(ctx context.Context, chatID string) errorCancel sends an ACP session/cancel for chatID’s active detached run (if any) and resolves any pending permission/elicitation for that chat as cancelled, so a blocked ACP callback unblocks instead of stalling teardown. There is no legacy fallback path: every run is now started via StartPrompt and lives in the run registry.
func (*Coordinator) CheckIdempotency
Section titled “func (*Coordinator) CheckIdempotency”func (c *Coordinator) CheckIdempotency(chatID, key string) (any, bool)CheckIdempotency returns the cached result for key if it matches the current chat’s slot. A chat holds exactly one slot: the most recent (key, result) pair. There is no TTL — the slot is only ever replaced by the next legitimate mutation for that chat, never expired.
func (*Coordinator) DeleteSession
Section titled “func (*Coordinator) DeleteSession”func (c *Coordinator) DeleteSession(ctx context.Context, app core.App, chatID string) errorfunc (*Coordinator) DenyPermission
Section titled “func (*Coordinator) DenyPermission”func (c *Coordinator) DenyPermission(chatID, requestID string) errorDenyPermission cancels a pending permission decision (the ACP “cancelled” outcome) without requiring an offered option, mirroring dropPendingForChat’s cancellation but scoped to a single requestID.
func (*Coordinator) NextSeq
Section titled “func (*Coordinator) NextSeq”func (c *Coordinator) NextSeq(chatID string) intNextSeq allocates the next hub-global monotonic sequence number for chatID, shared between cold replay and live publish so a stream’s ids are strictly increasing regardless of which path produced them.
func (*Coordinator) RecordIdempotency
Section titled “func (*Coordinator) RecordIdempotency”func (c *Coordinator) RecordIdempotency(chatID, key string, result any)RecordIdempotency stores result under key for chatID, replacing whatever was there. Call this after successfully performing the mutation.
func (*Coordinator) Reserve
Section titled “func (*Coordinator) Reserve”func (c *Coordinator) Reserve(chatID string) errorfunc (*Coordinator) ResolveElicitation
Section titled “func (*Coordinator) ResolveElicitation”func (c *Coordinator) ResolveElicitation(chatID, id string, resp acpsdk.UnstableCreateElicitationResponse) errorResolveElicitation delivers the user’s response to a pending elicitation (identified by id, scoped to chatID) so the blocked sessionClient.UnstableCreateElicitation call can return.
func (*Coordinator) SetConfigOption
Section titled “func (*Coordinator) SetConfigOption”func (c *Coordinator) SetConfigOption(ctx context.Context, chatID string, req acpsdk.SetSessionConfigOptionRequest) errorSetConfigOption dispatches session/set_config_option to the active run’s connection. The caller is expected to have already set SessionId on whichever variant of the union is populated.
func (*Coordinator) SetMode
Section titled “func (*Coordinator) SetMode”func (c *Coordinator) SetMode(ctx context.Context, chatID, modeID string) errorSetMode dispatches session/set_mode to the active run’s connection.
func (*Coordinator) Shutdown
Section titled “func (*Coordinator) Shutdown”func (c *Coordinator) Shutdown(ctx context.Context)Shutdown cancels every in-flight detached run and resolves every pending permission/elicitation as cancelled, so no ACP callback is left blocked when the process is asked to terminate.
func (*Coordinator) StartPrompt
Section titled “func (*Coordinator) StartPrompt”func (c *Coordinator) StartPrompt(chatID, prompt string, resolve ResolveSession, profileFn ProfileFunc, created OnSessionCreated, finished OnRunFinished, opts ...RunOption) (string, error)StartPrompt reserves chatID, spawns a detached run goroutine on a fresh context.Background()-derived ctx (which also doubles as the Goose dial ctx, spec N1), and returns the run id immediately. The run survives the caller returning: teardown fires on Prompt return / cancel / panic, last in the gate is always the release of Reserve so a second StartPrompt can take over.
func (*Coordinator) StreamColdReplay
Section titled “func (*Coordinator) StreamColdReplay”func (c *Coordinator) StreamColdReplay(ctx context.Context, chatID, sessionID string, profileFn ProfileFunc, emit func(seq int, ev events.Event) error) errorStreamColdReplay runs a bounded, no-Reserve Goose replay for a subscriber whose Attach reported ColdReplayNeeded (the buffered run was evicted or never existed for this chat-global cursor). It dials a short-lived conn, walks session/load through a fresh Bridge exactly like the old ReplayReserved body, and hands each resulting event to emit with ascending seqs starting at 1 — the caller (the stream route) writes these as SSE frames before falling through to the hub’s Buffered/Live tail.
func (*Coordinator) clearRun
Section titled “func (*Coordinator) clearRun”func (c *Coordinator) clearRun(chatID, runID string)func (*Coordinator) dropPendingForChat
Section titled “func (*Coordinator) dropPendingForChat”func (c *Coordinator) dropPendingForChat(chat string)func (*Coordinator) establishSession
Section titled “func (*Coordinator) establishSession”func (c *Coordinator) establishSession(ctx context.Context, client acpsdk.Client, profile SessionProfile, sessionID string, beforeSessionCall func()) (conn acp.Conn, newSessionID string, modes *acpsdk.SessionModeState, configOptions []acpsdk.SessionConfigOption, initResp *acpsdk.InitializeResponse, wasNew bool, err error)establishSession is the resolve+pin-check+capability-check+dial+init prefix shared by runLoop and StreamColdReplay. It does NOT call SeedSession, ProfileApplier.Apply, or Prompt — those are each caller’s own job, done with the conn/sessionID/modes/configOptions this returns. See design spec §5.6 for why the split is drawn exactly here.
wasNew reports whether this call minted a brand-new session (sessionID was empty) — callers need this to decide whether to persist a new agent_sessions row; sessionID’s own emptiness can no longer be used for that check once establishSession owns both branches internally.
func (*Coordinator) hubFor
Section titled “func (*Coordinator) hubFor”func (c *Coordinator) hubFor(chatID string) *ChatHubfunc (*Coordinator) isReserved
Section titled “func (*Coordinator) isReserved”func (c *Coordinator) isReserved(chatID string) boolfunc (*Coordinator) reapHub
Section titled “func (*Coordinator) reapHub”func (c *Coordinator) reapHub(chatID string)func (*Coordinator) registerRun
Section titled “func (*Coordinator) registerRun”func (c *Coordinator) registerRun(chatID string, h *runHandle)func (*Coordinator) release
Section titled “func (*Coordinator) release”func (c *Coordinator) release(chatID string)func (*Coordinator) runFor
Section titled “func (*Coordinator) runFor”func (c *Coordinator) runFor(chatID string) *runHandlefunc (*Coordinator) runLoop
Section titled “func (*Coordinator) runLoop”func (c *Coordinator) runLoop(runCtx context.Context, chatID, runID, prompt string, h *runHandle, resolve ResolveSession, profileFn ProfileFunc, created OnSessionCreated, finished OnRunFinished, onRunEnded func(context.Context, string, RunOutcome), userMessageID string)runLoop is the per-run goroutine. It owns the *one* sync.Once teardown, a single panic recover that publishes RUN_ERROR, and the publish-through- hub `emit` so RequestPermission (which also calls s.emit) remains safe on the detached path with no client lifetime dependency.
func (*Coordinator) stopTimers
Section titled “func (*Coordinator) stopTimers”func (c *Coordinator) stopTimers(h *runHandle)func (*Coordinator) trackTimer
Section titled “func (*Coordinator) trackTimer”func (c *Coordinator) trackTimer(chatID, runID string, t Timer)type DialFunc
Section titled “type DialFunc”type DialFunc func(context.Context, acpsdk.Client, Target) (acp.Conn, error)type Emit
Section titled “type Emit”type Emit func(events.Event) errortype GlobalConfigApplier
Section titled “type GlobalConfigApplier”GlobalConfigApplier delivers only what ACP allows post-create today: the session mode. Permission enforcement remains in RequestPermission below.
type GlobalConfigApplier struct{}func (GlobalConfigApplier) Apply
Section titled “func (GlobalConfigApplier) Apply”func (GlobalConfigApplier) Apply(ctx context.Context, conn acp.Conn, sessionID string, p SessionProfile, modes *acpsdk.SessionModeState) ([]acpsdk.SessionConfigOption, error)type LiveConfigBootstrap
Section titled “type LiveConfigBootstrap”LiveConfigBootstrap covers goose: it registers the resolved provider’s credential into goose’s own provider registry and sets it as the active default provider via custom ACP methods before any session exists on this connection. This ensures session/new resolves the intended provider and a later SetSessionConfigOption(“provider”, …) switch call has a live current provider to switch from.
Deliberately does not use p.Model for the defaults/save call: goose strictly validates a modelId against its own live provider inventory, but p.Model comes from PocketBase’s own harness_models catalog, which can resolve to a model goose’s inventory doesn’t currently carry (a real incident: a fallback pick with no explicit is_default row landed on a model goose’s openrouter inventory didn’t recognize, which failed this call and blocked session establishment entirely, for a reason that has nothing to do with whether the provider itself is live). Instead this asks goose for ITS OWN default model for the provider (gooseProviderDefaultModel), which is guaranteed to exist in its inventory. The caller’s actual desired model is applied separately, afterward, via PerSessionApplier’s existing, unconditional post-session model switch (profile.go, unrelated to this bootstrap) -- exactly as it already did before this bootstrap existed.
type LiveConfigBootstrap struct{}func (LiveConfigBootstrap) Bootstrap
Section titled “func (LiveConfigBootstrap) Bootstrap”func (LiveConfigBootstrap) Bootstrap(ctx context.Context, conn acp.Conn, p SessionProfile) errortype OnRunFinished
Section titled “type OnRunFinished”type OnRunFinished func(context.Context, acpsdk.StopReason) errortype OnSessionCreated
Section titled “type OnSessionCreated”type OnSessionCreated func(context.Context, string) errortype PerSessionApplier
Section titled “type PerSessionApplier”PerSessionApplier delivers model/provider live, in addition to mode. Provider and model use the standard ACP session/set_config_option method; prompts use the optional ACP _meta extension at session creation/load and are not sent through a harness-private RPC.
type PerSessionApplier struct{}func (PerSessionApplier) Apply
Section titled “func (PerSessionApplier) Apply”func (PerSessionApplier) Apply(ctx context.Context, conn acp.Conn, sessionID string, p SessionProfile, modes *acpsdk.SessionModeState) ([]acpsdk.SessionConfigOption, error)The returned []acpsdk.SessionConfigOption is the harness’s own post-correction values, not an echo of the request.
type ProfileApplier
Section titled “type ProfileApplier”ProfileApplier delivers the parts of a SessionProfile that ACP allows to be set post session/new|load.
type ProfileApplier interface { Apply(ctx context.Context, conn acp.Conn, sessionID string, p SessionProfile, modes *acpsdk.SessionModeState) ([]acpsdk.SessionConfigOption, error)}func selectApplier
Section titled “func selectApplier”func selectApplier(profile SessionProfile) ProfileApplierselectApplier always returns PerSessionApplier — the branching that used to matter (whether Goose advertised per-session config at all) now lives inside PerSessionApplier.Apply itself, gated on the resolved harness’s own capability flags carried on profile.
type ProfileFunc
Section titled “type ProfileFunc”ProfileFunc resolves a SessionProfile for the run currently starting. Injected from internal/api, mirroring the existing ResolveSession closure, so the coordinator stays PocketBase-agnostic.
type ProfileFunc func(context.Context) (SessionProfile, error)type ProviderBootstrap
Section titled “type ProviderBootstrap”ProviderBootstrap prepares a harness connection so profile.Provider is ready to use before the coordinator creates, resumes, or loads a session on it. Implementations vary by how a harness discovers provider credentials; the contract is the same for all of them.
Bootstrap MUST be idempotent and safe to call on every session establishment -- including a resume/load against a connection whose underlying container may have just restarted. It must run after the harness connection is initialized and before any of session/new, session/resume, or session/load. For why: a harness’s own provider-switch operation (e.g. goose’s SetSessionConfigOption) may require an already-live provider to switch from, which a session created before any credential existed never has.
type ProviderBootstrap interface { Bootstrap(ctx context.Context, conn acp.Conn, p SessionProfile) error}func selectProviderBootstrap
Section titled “func selectProviderBootstrap”func selectProviderBootstrap(profile SessionProfile) ProviderBootstrapselectProviderBootstrap picks the bootstrap strategy for a resolved profile, mirroring selectApplier’s existing capability-flag dispatch pattern in this same package. Keyed on SupportsLiveCredentialRegistration specifically, not SupportsLiveConfig: the seed data sets supports_live_config=true for both goose and opencode, but only goose sets supports_live_credential_registration=true. Keying on SupportsLiveConfig would silently route opencode through LiveConfigBootstrap -- harmless today only because its registration flag happens to be false, but a live bug waiting for the day opencode gains that flag.
type ResolveSession
Section titled “type ResolveSession”type ResolveSession func(context.Context) (string, error)type RunOption
Section titled “type RunOption”type RunOption func(*runOptions)func WithOnRunEnded
Section titled “func WithOnRunEnded”func WithOnRunEnded(fn func(context.Context, string, RunOutcome)) RunOptionfunc WithUserMessageID
Section titled “func WithUserMessageID”func WithUserMessageID(id string) RunOptionWithUserMessageID carries the client-generated id from PromptRequest.MessageId (acp-go-sdk) through to runLoop, which echoes it back into the hub as a user-role TEXT_MESSAGE_START/CONTENT/END sequence — see runLoop’s use of this value for why: the client already renders this id optimistically, and the client’s ConversationReducer dedupes by exact id, so echoing the same id here (rather than minting a new one) is what makes the optimistic insert get superseded instead of duplicated once this arrives.
func WithUserMessageIDOpt
Section titled “func WithUserMessageIDOpt”func WithUserMessageIDOpt(id *string) RunOptionWithUserMessageIDOpt is WithUserMessageID for a caller holding the acp-go-sdk *string shape directly (PromptRequest.MessageId) — a no-op RunOption when nil or empty, so call sites don’t need their own branch.
type RunOutcome
Section titled “type RunOutcome”type RunOutcome stringconst ( RunCompleted RunOutcome = "completed" RunFailed RunOutcome = "failed" RunCancelled RunOutcome = "cancelled")type SessionProfile
Section titled “type SessionProfile”SessionProfile is the per-session configuration resolved from a chat’s agent definition (agent_profile). Not every field is deliverable over ACP today — see ProfileApplier.
type SessionProfile struct { Model, Provider, Instructions, Cwd string AdditionalDirectories []string McpServers []acpsdk.McpServer Mode acpsdk.SessionModeId PermissionRules []ToolPermissionRule AccountID string AgentProfileID string AgentName string
// AccountLogin is true when the resolved (harness, provider) pair uses // an account/OAuth login (credential_selections.mode == "oauth") rather // than a bare API key. This is the real signal for whether an auth-shaped error // from the harness should map to the "reauthenticate" flow -- it comes // from the account row itself, not a hardcoded per-provider allowlist, // so a new harness that adds account-login support is covered // automatically instead of silently falling through to a generic // failure the way Codex did before this field existed. AccountLogin bool HarnessName string // display name (harnesses.name, e.g. "Codex"), for user-facing reauth copy
Target Target ResolvedInstanceID string // the harness_instances id this chat resolves to right now PinnedInstanceID string // the harness_instances id agent_sessions.harness_instance already points at (empty if none yet) SupportsLiveConfig bool SupportsLiveCredentialRegistration bool CredentialFieldName string CredentialFieldValue string SupportsSessionDelete bool SupportsAdditionalDirectories bool}func (SessionProfile) PermissionDecision
Section titled “func (SessionProfile) PermissionDecision”func (p SessionProfile) PermissionDecision(tool string, values ...string) ToolPermissionActionPermissionDecision evaluates the most specific matching PocketBase rule. A rule with an exact tool/pattern wins over a wildcard rule. At equal specificity, deny wins over ask, and ask wins over allow.
func (SessionProfile) additionalDirectories
Section titled “func (SessionProfile) additionalDirectories”func (p SessionProfile) additionalDirectories() []stringadditionalDirectories returns the profile’s extra directories as a non-nil slice, for the same Goose-contract reason as mcpServers.
func (SessionProfile) mcpServers
Section titled “func (SessionProfile) mcpServers”func (p SessionProfile) mcpServers() []acpsdk.McpServermcpServers returns the profile’s MCP servers as a non-nil slice. Goose’s session/new|load deserializer rejects a null mcpServers with -32602 “invalid type: null, expected a sequence”, so a chat with no MCP servers must still serialize the field as an empty array.
func (SessionProfile) sessionMeta
Section titled “func (SessionProfile) sessionMeta”func (p SessionProfile) sessionMeta() map[string]anysessionMeta carries PocketCoder’s optional prompt extension through the standard ACP extensibility slot. ACP agents must ignore unknown metadata, so this is an enhancement only; the provider-specific fallback remains a separate capability to verify per pinned harness version.
type StaticEnvBootstrap
Section titled “type StaticEnvBootstrap”StaticEnvBootstrap is a no-op: claude-code, codex, and opencode get their provider credential baked into the container’s env at provisioning time (see hooks.renderEnv), so there is nothing left to do at session-establishment time.
type StaticEnvBootstrap struct{}func (StaticEnvBootstrap) Bootstrap
Section titled “func (StaticEnvBootstrap) Bootstrap”func (StaticEnvBootstrap) Bootstrap(context.Context, acp.Conn, SessionProfile) errortype Target
Section titled “type Target”Target identifies the harness_instances row a session should dial — Empty targets are invalid for production runs. They are retained as a zero-value for profile construction and test doubles only.
type Target struct { URL, Secret string}type Timer
Section titled “type Timer”type Timer interface{ Stop() bool }type ToolPermissionAction
Section titled “type ToolPermissionAction”ToolPermissionAction is the PocketBase policy decision for one ACP tool request. The coordinator is the enforcement point for every harness; no harness-specific permission API is authoritative.
type ToolPermissionAction stringconst ( ToolPermissionAllow ToolPermissionAction = "allow" ToolPermissionAsk ToolPermissionAction = "ask" ToolPermissionDeny ToolPermissionAction = "deny")type ToolPermissionRule
Section titled “type ToolPermissionRule”type ToolPermissionRule struct { Tool string Pattern string Action ToolPermissionAction}type defaultsSaveRequest
Section titled “type defaultsSaveRequest”type defaultsSaveRequest struct { ProviderID string `json:"providerId"` ModelID string `json:"modelId,omitempty"`}type defaultsSaveResponse
Section titled “type defaultsSaveResponse”type defaultsSaveResponse struct { ProviderID string `json:"providerId"` ModelID string `json:"modelId"`}type elicitationDecision
Section titled “type elicitationDecision”type elicitationDecision struct { resp acpsdk.UnstableCreateElicitationResponse cancelled bool}type fakeClock
Section titled “type fakeClock”fakeClock is a deterministic clock for tests. Advance drives all timers.
type fakeClock struct { mu sync.Mutex now time.Time timers []*fakeTimer}func NewFakeClock
Section titled “func NewFakeClock”func NewFakeClock(t time.Time) *fakeClockfunc (*fakeClock) Advance
Section titled “func (*fakeClock) Advance”func (c *fakeClock) Advance(d time.Duration)Advance moves time forward and fires every timer whose deadline has passed.
func (*fakeClock) AfterFunc
Section titled “func (*fakeClock) AfterFunc”func (c *fakeClock) AfterFunc(d time.Duration, f func()) Timerfunc (*fakeClock) Now
Section titled “func (*fakeClock) Now”func (c *fakeClock) Now() time.Timetype fakeTimer
Section titled “type fakeTimer”type fakeTimer struct { clk *fakeClock deadline time.Time fn func() done bool}func (*fakeTimer) Stop
Section titled “func (*fakeTimer) Stop”func (t *fakeTimer) Stop() booltype idempotencySlot
Section titled “type idempotencySlot”type idempotencySlot struct { key string result any}type pendingElicitation
Section titled “type pendingElicitation”pendingElicitation mirrors pendingPermission’s shape but lives in a separate map (spec N5): elicitation and permission are distinct ACP side-channels and must not share id-space or resolution paths.
type pendingElicitation struct { chatID, sessionID string decision chan elicitationDecision timer Timer}type pendingPermission
Section titled “type pendingPermission”type pendingPermission struct { chatID, sessionID string options map[string]struct{} decision chan permissionDecision timer *time.Timer}type permissionDecision
Section titled “type permissionDecision”type permissionDecision struct { option string cancelled bool}type providerConfigFieldUpdate
Section titled “type providerConfigFieldUpdate”type providerConfigFieldUpdate struct { Key string `json:"key"` Value string `json:"value"`}type providerConfigSaveRequest
Section titled “type providerConfigSaveRequest”type providerConfigSaveRequest struct { ProviderID string `json:"providerId"` Fields []providerConfigFieldUpdate `json:"fields"`}type providerConfigSaveResponse
Section titled “type providerConfigSaveResponse”type providerConfigSaveResponse struct { Status providerConfigStatus `json:"status"`}type providerConfigStatus
Section titled “type providerConfigStatus”type providerConfigStatus struct { ProviderID string `json:"providerId"` IsConfigured bool `json:"isConfigured"`}type providerInventoryEntry
Section titled “type providerInventoryEntry”type providerInventoryEntry struct { ProviderID string `json:"providerId"` DefaultModel string `json:"defaultModel"`}type providersListRequest
Section titled “type providersListRequest”type providersListRequest struct { ProviderIDs []string `json:"providerIds"`}type providersListResponse
Section titled “type providersListResponse”type providersListResponse struct { Entries []providerInventoryEntry `json:"entries"`}type realClock
Section titled “type realClock”realClock delegates to the stdlib.
type realClock struct{}func (realClock) AfterFunc
Section titled “func (realClock) AfterFunc”func (realClock) AfterFunc(d time.Duration, f func()) Timerfunc (realClock) Now
Section titled “func (realClock) Now”func (realClock) Now() time.Timetype run
Section titled “type run”type run struct { id string log []seqEvent // this run's events only (bounded by run length) snapshot func() []events.Event finished bool lingerTimer Timer}type runHandle
Section titled “type runHandle”type runHandle struct { runID, sessionID string cancel context.CancelFunc conn acp.Conn accepting *atomic.Bool events atomic.Int64 timers []Timer teardown func(release bool)}type runOptions
Section titled “type runOptions”type runOptions struct { onRunEnded func(context.Context, string, RunOutcome) userMessageID string}type seqEvent
Section titled “type seqEvent”type seqEvent struct { Seq int Ev events.Event}type sessionClient
Section titled “type sessionClient”type sessionClient struct { c *Coordinator chatID, sessionID string runID string bridge *agui.Bridge emit Emit accepting *atomic.Bool events atomic.Int64 maxEvents int cancel context.CancelFunc permissionRules []ToolPermissionRule emitMu sync.Mutex}func (*sessionClient) CreateTerminal
Section titled “func (*sessionClient) CreateTerminal”func (s *sessionClient) CreateTerminal(context.Context, acpsdk.CreateTerminalRequest) (acpsdk.CreateTerminalResponse, error)func (*sessionClient) KillTerminal
Section titled “func (*sessionClient) KillTerminal”func (s *sessionClient) KillTerminal(context.Context, acpsdk.KillTerminalRequest) (acpsdk.KillTerminalResponse, error)func (*sessionClient) ReadTextFile
Section titled “func (*sessionClient) ReadTextFile”func (s *sessionClient) ReadTextFile(context.Context, acpsdk.ReadTextFileRequest) (acpsdk.ReadTextFileResponse, error)func (*sessionClient) ReleaseTerminal
Section titled “func (*sessionClient) ReleaseTerminal”func (s *sessionClient) ReleaseTerminal(context.Context, acpsdk.ReleaseTerminalRequest) (acpsdk.ReleaseTerminalResponse, error)func (*sessionClient) RequestPermission
Section titled “func (*sessionClient) RequestPermission”func (s *sessionClient) RequestPermission(ctx context.Context, req acpsdk.RequestPermissionRequest) (acpsdk.RequestPermissionResponse, error)func (*sessionClient) SessionUpdate
Section titled “func (*sessionClient) SessionUpdate”func (s *sessionClient) SessionUpdate(_ context.Context, n acpsdk.SessionNotification) errorfunc (*sessionClient) TerminalOutput
Section titled “func (*sessionClient) TerminalOutput”func (s *sessionClient) TerminalOutput(context.Context, acpsdk.TerminalOutputRequest) (acpsdk.TerminalOutputResponse, error)func (*sessionClient) UnstableCreateElicitation
Section titled “func (*sessionClient) UnstableCreateElicitation”func (s *sessionClient) UnstableCreateElicitation(ctx context.Context, req acpsdk.UnstableCreateElicitationRequest) (acpsdk.UnstableCreateElicitationResponse, error)UnstableCreateElicitation mirrors RequestPermission’s block-until-resolved shape but lives in its own map (pendingElicitation, spec N5) and its timeout runs through the injectable Clock so tests are deterministic.
func (*sessionClient) WaitForTerminalExit
Section titled “func (*sessionClient) WaitForTerminalExit”func (s *sessionClient) WaitForTerminalExit(context.Context, acpsdk.WaitForTerminalExitRequest) (acpsdk.WaitForTerminalExitResponse, error)func (*sessionClient) WriteTextFile
Section titled “func (*sessionClient) WriteTextFile”func (s *sessionClient) WriteTextFile(context.Context, acpsdk.WriteTextFileRequest) (acpsdk.WriteTextFileResponse, error)func (*sessionClient) removePending
Section titled “func (*sessionClient) removePending”func (s *sessionClient) removePending(id string, expected *pendingPermission)func (*sessionClient) removePendingElicitation
Section titled “func (*sessionClient) removePendingElicitation”func (s *sessionClient) removePendingElicitation(id string, expected *pendingElicitation)func (*sessionClient) resolveExpired
Section titled “func (*sessionClient) resolveExpired”func (s *sessionClient) resolveExpired(id string, expected *pendingPermission)func (*sessionClient) resolveExpiredElicitation
Section titled “func (*sessionClient) resolveExpiredElicitation”func (s *sessionClient) resolveExpiredElicitation(id string, expected *pendingElicitation)type subscriber
Section titled “type subscriber”type subscriber struct { live chan seqEvent cursor int}executor
Section titled “executor”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/executor"Package executor preserves the sandbox ACP adapter for a future Goose tool integration. The selected c1 runtime does not currently advertise or call it because Goose’s built-in shell executes in c2 rather than via ACP.
- func Capabilities() acp.ClientCapabilities
- type Config
- type Sandbox
- func New(cfg Config) (*Sandbox, error)
- func (s *Sandbox) CreateTerminal(ctx context.Context, request acp.CreateTerminalRequest) (acp.CreateTerminalResponse, error)
- func (s *Sandbox) KillTerminal(ctx context.Context, request acp.KillTerminalRequest) (acp.KillTerminalResponse, error)
- func (s *Sandbox) ReadTextFile(ctx context.Context, request acp.ReadTextFileRequest) (acp.ReadTextFileResponse, error)
- func (s *Sandbox) ReleaseTerminal(ctx context.Context, request acp.ReleaseTerminalRequest) (acp.ReleaseTerminalResponse, error)
- func (s *Sandbox) TerminalOutput(ctx context.Context, request acp.TerminalOutputRequest) (acp.TerminalOutputResponse, error)
- func (s *Sandbox) WaitForTerminalExit(ctx context.Context, request acp.WaitForTerminalExitRequest) (acp.WaitForTerminalExitResponse, error)
- func (s *Sandbox) WriteTextFile(ctx context.Context, request acp.WriteTextFileRequest) (acp.WriteTextFileResponse, error)
- func (s *Sandbox) call(ctx context.Context, method, path string, input, output any) error
- func (s *Sandbox) pathAllowed(value string) error
func Capabilities
Section titled “func Capabilities”func Capabilities() acp.ClientCapabilitiesCapabilities are advertised only because every handler below reaches the sandbox API and each requested path is restricted to Workspace.
type Config
Section titled “type Config”type Config struct { URL string Workspace string Client *http.Client}type Sandbox
Section titled “type Sandbox”type Sandbox struct { baseURL, workspace string client *http.Client}func New
Section titled “func New”func New(cfg Config) (*Sandbox, error)func (*Sandbox) CreateTerminal
Section titled “func (*Sandbox) CreateTerminal”func (s *Sandbox) CreateTerminal(ctx context.Context, request acp.CreateTerminalRequest) (acp.CreateTerminalResponse, error)func (*Sandbox) KillTerminal
Section titled “func (*Sandbox) KillTerminal”func (s *Sandbox) KillTerminal(ctx context.Context, request acp.KillTerminalRequest) (acp.KillTerminalResponse, error)func (*Sandbox) ReadTextFile
Section titled “func (*Sandbox) ReadTextFile”func (s *Sandbox) ReadTextFile(ctx context.Context, request acp.ReadTextFileRequest) (acp.ReadTextFileResponse, error)func (*Sandbox) ReleaseTerminal
Section titled “func (*Sandbox) ReleaseTerminal”func (s *Sandbox) ReleaseTerminal(ctx context.Context, request acp.ReleaseTerminalRequest) (acp.ReleaseTerminalResponse, error)func (*Sandbox) TerminalOutput
Section titled “func (*Sandbox) TerminalOutput”func (s *Sandbox) TerminalOutput(ctx context.Context, request acp.TerminalOutputRequest) (acp.TerminalOutputResponse, error)func (*Sandbox) WaitForTerminalExit
Section titled “func (*Sandbox) WaitForTerminalExit”func (s *Sandbox) WaitForTerminalExit(ctx context.Context, request acp.WaitForTerminalExitRequest) (acp.WaitForTerminalExitResponse, error)func (*Sandbox) WriteTextFile
Section titled “func (*Sandbox) WriteTextFile”func (s *Sandbox) WriteTextFile(ctx context.Context, request acp.WriteTextFileRequest) (acp.WriteTextFileResponse, error)func (*Sandbox) call
Section titled “func (*Sandbox) call”func (s *Sandbox) call(ctx context.Context, method, path string, input, output any) errorfunc (*Sandbox) pathAllowed
Section titled “func (*Sandbox) pathAllowed”func (s *Sandbox) pathAllowed(value string) errorpocoprompt
Section titled “pocoprompt”import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/pocoprompt"Variables
Section titled “Variables”var Default stringGenerated by gomarkdoc