Skip to content

Backend Reference

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()
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.

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 * 1024

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(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

CancelChatSession 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(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)

PersistModelOverride is best-effort: the live RPC already succeeded, so a lookup/save failure here is logged, not returned.

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() (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(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(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, resp acpsdk.UnstableCreateElicitationResponse) error

RespondToElicitation resolves a pending elicitation request. Shared by the registry action and the strict operation adapter.

func RespondToPermission(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, requestID string, input acpsdk.RequestPermissionResponse) error

RespondToPermission resolves a pending permission request with the caller’s decision. Shared by the registry action and the strict operation adapter.

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

SetChatConfigOption changes a single session config option on the active run. Shared by the registry action and the strict operation adapter.

func SetChatMode(re *core.RequestEvent, service coordinator.AgentRuntime, chatID, modeID string) error

SetChatMode changes the active run’s mode. Shared by the registry action (raw-body parsing) and the strict operation adapter (typed request body).

func SetLiveActivityToken(app core.App, re *core.RequestEvent) error

SetLiveActivityToken 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(app core.App, re *core.RequestEvent, id, token string) error

SetLiveActivityTokenByID 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(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

createProxyHandler creates a standard reverse proxy handler that strips a prefix and forwards to a target.

func parseCursor(re *core.RequestEvent) int

parseCursor 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(path string, target any) error

func releaseStateDir() string

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(re *core.RequestEvent, roles ...string) error

requireRole enforces authentication and membership in one of the supplied roles. Authentication failures deliberately have a different status from authorization failures.

func resolveAccountAndAttemptError(re *core.RequestEvent, err error) error

resolveAccountAndAttemptError 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(app core.App, userID, harnessID, providerID string) string

resolveMode returns the user’s currently selected credential_selections.mode for (harness, provider), or harnessauth.ModeNone if no selection exists yet.

func storeOAuthToken(app core.App, serverName, accessToken, refreshToken string) error

storeOAuthToken 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(w http.ResponseWriter, flusher http.Flusher, seq int, ev events.Event) error

func writeSeqFrame(w io.Writer, seq int, ev events.Event) error

writeSeqFrame 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 struct {
Runtime coordinator.AgentRuntime
Dial coordinator.DialFunc
}

type HarnessAuthDeps struct {
Runtime harnessAuthRuntime
}

type HarnessAuthRuntime = harnessAuthRuntime

type HarnessAuthStatusResponse = harnessAuthStatusResp

type LogsDeps struct {
App core.App
Source dockerLogSource // nil -> dockerProxyLogSource{}
Lister containerLister // nil -> dockerProxyContainerLister{}
}

type McpDeps struct{ ResolveImage mcpserver.ImageResolver }

type OllamaDeps struct {
Docker ollama.Docker
HTTP *http.Client
StreamHTTP *http.Client
Config ollama.Config
RuntimeMu *sync.Mutex
}

type ProxyDeps struct {
Transport http.RoundTripper
TargetURL string
}

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() (ReleaseStatusDocument, map[string]any, error)

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)
}

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)
}

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)

dockerProxyLogSource is the production dockerLogSource, backed by the internal docker-socket-proxy.

type dockerProxyLogSource struct{}

func (dockerProxyLogSource) StreamLogs(ctx context.Context, containerName string) (io.ReadCloser, error)

type harnessAuthAttemptResp struct {
ID string `json:"id"`
Status string `json:"status"`
LastError string `json:"lastError,omitempty"`
}

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(c *harnessauth.Challenge) *harnessAuthChallengeResp

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(app core.App, re *core.RequestEvent) (harnessAuthRequest, *core.Record, *core.Record, error)

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(app core.App, registry *operation.Registry, deps HarnessAuthDeps) harnessAuthRuntime

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(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 struct {
Model string `json:"model"`
}

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"`
}
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).

MaxLogFrameSize is the largest payload accepted from a Docker log frame.

const MaxLogFrameSize = 1 << 20

const defaultDockerHost = "tcp://docker-socket-proxy-write:2375"

var ErrContainerNotFound = errors.New("container not found")

func DecodeLogFrame(r *bufio.Reader) (stream byte, payload []byte, err error)

DecodeLogFrame reads one Docker multiplexed log frame.

func decodeDockerLogStream(raw []byte) (string, error)

type Client struct {
baseURL string
http *http.Client
}

func New() *Client

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 (c *Client) CopyArchive(ctx context.Context, containerName, destination string, archive io.Reader) error

CopyArchive 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 (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)

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 (c *Client) Inspect(ctx context.Context, containerName string) (ContainerInspect, error)

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 (c *Client) ListContainers(ctx context.Context) ([]ContainerSummary, error)

func (c *Client) LoadImage(ctx context.Context, archive io.Reader) error

LoadImage 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 (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

Remove deletes a managed container after it has stopped. The socket proxy permits this narrow lifecycle operation for PocketCoder-owned containers.

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)

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 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 struct {
ID string `json:"Id"`
Names []string `json:"Names"`
Image string `json:"Image"`
State string `json:"State"`
Status string `json:"Status"`
}

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 struct {
Type, Action, ContainerName string
}

type Mount struct {
Destination, Name string
}

type NetworkEndpoint struct{}
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/errorutil"

func Internal(context string, err error) error

Internal 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.

import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/filesystem"

@pocketcoder-core: Files API. Secure endpoint for accessing workspace files.

var (
errPathEscape = errors.New("path escape attempt detected")
errWorkspaceUnavailable = errors.New("workspace not available")
errNotFound = errors.New("not found")
)

var workspaceRoot = "/workspace"

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)

Any of the user’s running instances works: they share one workspace volume.

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.

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
}

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(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(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(node *fileTreeNode) []FileTreeEntry

func listWorkspaceFileTree(ctx context.Context, reader containerArchiveReader, app core.App, userID, pathParam string) (cleanPath string, entries []FileTreeEntry, err error)

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 struct{ client *dockerapi.Client }

func (d dockerArchiveReader) GetArchive(ctx context.Context, containerName, path string) (io.ReadCloser, error)

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(name string) *fileTreeNode
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/gitssh"

const CustomProviderID = "custom"

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(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

RenderRemotesDoc 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(provider, repository string) (string, error)

func ValidateFiles(files []File) error

ValidateFiles 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(config string, knownHosts []string, newKeys map[string][]byte) string

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 struct {
Path string
Mode uint32
Data []byte
}

type KeyMaterial struct {
Private []byte
Public string
Fingerprint string
}

func GenerateKey(comment string) (KeyMaterial, error)

func ImportKey(private []byte, comment string) (KeyMaterial, error)

type Manifest struct {
Generation string
Config []byte
KnownHosts []byte
Keys map[string][]byte
}

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 struct {
ID, Host, User string
Port int
}

func ProviderByID(id string) (Provider, bool)

Queue coalesces rapid CRUD notifications by full PocketBase user id.

type Queue struct {
mu sync.Mutex
pending map[string]struct{}
}

func NewQueue() *Queue

func (q *Queue) Drain() []string

func (q *Queue) Enqueue(userID string)

type Reconciler struct {
Materializer Materializer
}

func (r *Reconciler) ReconcileUser(ctx context.Context, app core.App, userID string) error

func (*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) 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

Never re-probes an already-pinned row: a transient network blip must not look like a changed/MITM host key.

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(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).

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
}
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.

const (
StatusDisconnected = "disconnected"
VisibilityPersonal = "personal"
VisibilityDeployment = "deployment"
)

func CanAccess(account *core.Record, userID string) bool

CanAccess 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(app core.App)

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(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(app core.App, userID, harnessID, providerID string, account *core.Record) error

SetSelection records mode=oauth with this account for (user, harness, provider). The collection’s unique(user, harness, provider) index enforces the cardinality invariant.

import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/harnessauth"

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"
)

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(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 struct {
AttemptID string
UserID string
AccountID string
HarnessCLI string
HarnessImage string
}

func BuildAttemptContext(app core.App, attempt *core.Record, userID string) (AttemptContext, error)

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"`
}

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() Authenticator

func NewCodexAuthenticator() Authenticator

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(logs string) *Challenge

func parseCodexChallenge(logs string) *Challenge

Runtime dispatches start/poll/submit/cancel/disconnect calls to provider implementations selected by attempt input.

type Runtime struct {
providers map[string]Authenticator
}

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 struct {
provider string
docker *dockerapi.Client
startCommandBuilder func(AttemptContext) string
parseChallenge func(string) *Challenge
submitCode func(context.Context, AttemptContext, string) error
}

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 (*commandAuthenticator) ensureRunningHelper

Section titled “func (*commandAuthenticator) ensureRunningHelper”
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 struct {
provider string
}

func (e unknownProviderError) Error() string
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.

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"

var nameComponent = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`)

func GitSSHVolumeName(base, userID string) (string, error)

func namespaceOf(base string) (string, error)

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(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.

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 = 5

ModelNetwork 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/api

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(app core.App, registry *operation.Registry)

func AddPushOperations(app core.App, registry *operation.Registry)

func DeleteProDataOperation(userID string) error

DeleteProDataOperation 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(edge, provider *core.Record) []string

EnvVarNamesForCredential 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(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(app core.App, userID string) bool

IsUserOnline checks if the user has an active Realtime (SSE) connection.

func MaterializeUserHarnessFiles(ctx context.Context, app core.App, client archiveCopier, instance *core.Record) error

MaterializeUserHarnessFiles 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() *acpsdk.McpServer

McpGatewayHttpServer returns the gateway in the standard ACP shape used by every harness’s session/new request.

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(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)

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(app core.App)

RegisterAgentFileHooks refreshes every running harness for a user whenever PocketBase-owned prompt, profile, or skill content changes.

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(app core.App, queue *gitssh.Queue)

func RegisterGlobalTimestamps(app core.App)

RegisterGlobalTimestamps registers hooks for created, updated, and last_active timestamps.

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(app core.App)

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(app core.App)

RegisterNotificationHooks registers hooks for triggering push notifications and the /api/push custom endpoint.

func ResolveOAuthAccountForLaunch(app core.App, userID, harnessID, providerID string) (*core.Record, error)

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(containerName string, timeout time.Duration) error

RestartContainer sends a restart command to the named container via the Docker Socket Proxy.

func SendLiveActivityUpdate(token, fcmToken, userID string, state LiveActivityContentState, version int, event, attributesType string, attributes any) error

SendLiveActivityUpdate 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(app core.App, userID, title, message, notifType, chatID string) error

SendPushNotification is the unified dispatch function. Flow: rules check -> presence check -> device dispatch

func SendPushNotificationWithExtra(app core.App, userID, title, message, notifType, chatID string, extra map[string]string) error

SendPushNotificationWithExtra 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(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{}

A user’s reconcile error never blocks another user or the next tick -- their next enqueue simply retries.

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(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

dispatchToDevices sends notifications to every active device registered to the user.

func dockerEventToStatus(action string) string

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(app core.App, userID, notifType string) bool

isNotificationTypeEnabled checks the user’s notification_rules record. Returns true if the type is enabled or if no rules exist (opt-out model).

func isRecordNotFound(err error) bool

isRecordNotFound 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(manifest gitssh.Manifest) ([]byte, error)

Layout must match what cmd/git-materializer expects under /inbox/manifest.tar.

func maybeStartLiveActivities(app core.App, chatID string) error

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(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(app core.App, harness *core.Record, providerID string) ([]*core.Record, error)

func purgeRelayData(userID string) error

purgeRelayData 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(ctx context.Context, app core.App, client eventSource)

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(rootSecret, userID string) string

relaySecretFor 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(prefix string, renderFn func() error, container string, e *core.RecordEvent) error

renderAndRestart runs a config render function and restarts the given container. On render failure it logs and continues the hook chain without restarting.

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(app core.App) error

renderMcpConfig 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(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 struct {
Client gitMaterializerDocker
}

func (DockerGitSSHMaterializer) Materialize

Section titled “func (DockerGitSSHMaterializer) Materialize”
func (m DockerGitSSHMaterializer) Materialize(ctx context.Context, userID string, manifest gitssh.Manifest) error

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 (p *FcmRelayProvider) Send(token, title, body string, extra map[string]string) error

type LiveActivityContentState struct {
Status string `json:"status"`
Title string `json:"title"`
UpdatedAt int64 `json:"updated_at"`
}

NtfyDirectProvider sends notifications directly to a UnifiedPush (ntfy) endpoint. This preserves the “Zero-Trust” sovereign architecture.

type NtfyDirectProvider struct {
ChatID string
Type string
}

func (p *NtfyDirectProvider) Send(endpoint, title, body string, extra map[string]string) error

extra is ignored here: ntfy’s direct path has no structured-action support yet -- that’s out of scope for this slice.

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
}

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)

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 interface {
Remove(context.Context, string) error
}

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 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 interface {
ReconcileUser(ctx context.Context, app core.App, userID string) error
}

type harnessRemover interface {
Remove(context.Context, string) error
}

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)
}
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 func(context.Context, string, string) (string, error)

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 struct {
Kind RequestServerErrorKind
Err error
}

func (e *RequestServerError) Error() string

func (e *RequestServerError) Unwrap() error

type RequestServerErrorKind int

const (
ErrKindInternal RequestServerErrorKind = iota
ErrKindInvalidRequest
ErrKindImageResolution
ErrKindSaveSync
ErrKindSaveCreate
)

type Result struct {
ID string
Status string
Synced bool
}

func RequestServer(ctx context.Context, store Store, resolve ImageResolver, req Request) (Result, error)

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
}
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.

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 * * *"

var (
catalogCacheMu sync.RWMutex
catalogCache = map[string]map[string]ProviderInfo{}
)

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(app core.App, client *http.Client, url string)

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(ctx context.Context, app core.App, client *http.Client, url string) error

Sync 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(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

harnessModelID 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(app core.App) (map[string]bool, error)

keyedProviderIDs is unscoped by owner: a deployment belongs to exactly one user.

func recordUnchanged(rec *core.Record, fields map[string]any) bool

recordUnchanged 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(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

ModelInfo is the trimmed shape of one models.dev model entry.

type ModelInfo struct {
ID string
Name string
Description string
ContextWindow int
}

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 (p ProviderInfo) PrimaryAPIKeyEnv() string

PrimaryAPIKeyEnv 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 map[string]rawProvider

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 struct {
ID string `json:"id"`
Name string `json:"name"`
Env []string `json:"env"`
Models map[string]rawModel `json:"models"`
}
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.

const DefaultURL = "http://ollama:11434"

const ollamaContainerName = "pocketcoder-ollama"

const ollamaModelsVolumeName = "pocketcoder_ollama_models"

var modelName = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._/-]*(?::[A-Za-z0-9][A-Za-z0-9._-]*)?$`)

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

ResolveRelease reads POCKETCODER_RELEASE once. Empty or “development” selects the local-models runtime path in EnsureRuntime.

func StreamingHTTPClient() *http.Client

func WaitForReady(ctx context.Context, client *http.Client, baseURL string) error

type Config struct {
BaseURL string
Release string
}

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 struct {
Name string `json:"name"`
Size int64 `json:"size"`
}

func FetchTags(ctx context.Context, client *http.Client, baseURL string) ([]Model, error)

type ReleaseImageAcquirer func(context.Context, releaseartifact.DockerLoader, string) (string, error)

type tagsResponse struct {
Models []Model `json:"models"`
}
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

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

AcceptedResponse defines model for AcceptedResponse.

type AcceptedResponse struct {
RunId string `json:"runId"`
}

AgentEvent defines model for AgentEvent.

type AgentEvent map[string]interface{}

BadGateway defines model for BadGateway.

type BadGateway = ErrorResponse

type BadGatewayJSONResponse ErrorResponse

BadRequest defines model for BadRequest.

type BadRequest = ErrorResponse

type BadRequestJSONResponse ErrorResponse

type CancelChatSession202Response struct {
}

func (CancelChatSession202Response) VisitCancelChatSessionResponse

Section titled “func (CancelChatSession202Response) VisitCancelChatSessionResponse”
func (response CancelChatSession202Response) VisitCancelChatSessionResponse(w http.ResponseWriter) error

type CancelChatSession401JSONResponse struct{ UnauthorizedJSONResponse }

func (CancelChatSession401JSONResponse) VisitCancelChatSessionResponse

Section titled “func (CancelChatSession401JSONResponse) VisitCancelChatSessionResponse”
func (response CancelChatSession401JSONResponse) VisitCancelChatSessionResponse(w http.ResponseWriter) error

type CancelChatSession404JSONResponse struct{ NotFoundJSONResponse }

func (CancelChatSession404JSONResponse) VisitCancelChatSessionResponse

Section titled “func (CancelChatSession404JSONResponse) VisitCancelChatSessionResponse”
func (response CancelChatSession404JSONResponse) VisitCancelChatSessionResponse(w http.ResponseWriter) error

type CancelChatSessionRequestObject struct {
ChatId ChatId `json:"chatId"`
}

type CancelChatSessionResponseObject interface {
VisitCancelChatSessionResponse(w http.ResponseWriter) error
}

type CancelHarnessAuth200JSONResponse HarnessAuthStatus

func (CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse

Section titled “func (CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse”
func (response CancelHarnessAuth200JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) error

type CancelHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }

func (CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse

Section titled “func (CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse”
func (response CancelHarnessAuth400JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) error

type CancelHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }

func (CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse

Section titled “func (CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse”
func (response CancelHarnessAuth401JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) error

type CancelHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }

func (CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse

Section titled “func (CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse”
func (response CancelHarnessAuth404JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) error

type CancelHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }

func (CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse

Section titled “func (CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse”
func (response CancelHarnessAuth500JSONResponse) VisitCancelHarnessAuthResponse(w http.ResponseWriter) error

CancelHarnessAuthJSONRequestBody defines body for CancelHarnessAuth for application/json ContentType.

type CancelHarnessAuthJSONRequestBody = HarnessRequest

type CancelHarnessAuthRequestObject struct {
Body *CancelHarnessAuthJSONRequestBody
}

type CancelHarnessAuthResponseObject interface {
VisitCancelHarnessAuthResponse(w http.ResponseWriter) error
}

ChatId defines model for ChatId.

type ChatId = string

ConfigOptionRequest defines model for ConfigOptionRequest.

type ConfigOptionRequest struct {
ConfigId string `json:"configId"`
Value string `json:"value"`
}

ContainerListResponse defines model for ContainerListResponse.

type ContainerListResponse struct {
Containers []ContainerSummary `json:"containers"`
}

ContainerName defines model for ContainerName.

type ContainerName = string

ContainerSummary defines model for ContainerSummary.

type ContainerSummary struct {
Name string `json:"name"`
State string `json:"state"`
Status string `json:"status"`
}

ContentBlock defines model for ContentBlock.

type ContentBlock struct {
Text *string `json:"text,omitempty"`
Type string `json:"type"`
AdditionalProperties map[string]interface{} `json:"-"`
}

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 (a ContentBlock) MarshalJSON() ([]byte, error)

Override default JSON handling for ContentBlock to handle AdditionalProperties

func (a *ContentBlock) Set(fieldName string, value interface{})

Setter for additional properties for ContentBlock

func (a *ContentBlock) UnmarshalJSON(b []byte) error

Override default JSON handling for ContentBlock to handle AdditionalProperties

Cursor defines model for Cursor.

type Cursor = int

DecisionRequest defines model for DecisionRequest.

type DecisionRequest map[string]interface{}

type DeleteProData204Response struct {
}

func (DeleteProData204Response) VisitDeleteProDataResponse

Section titled “func (DeleteProData204Response) VisitDeleteProDataResponse”
func (response DeleteProData204Response) VisitDeleteProDataResponse(w http.ResponseWriter) error

type DeleteProData401JSONResponse struct{ UnauthorizedJSONResponse }

func (DeleteProData401JSONResponse) VisitDeleteProDataResponse

Section titled “func (DeleteProData401JSONResponse) VisitDeleteProDataResponse”
func (response DeleteProData401JSONResponse) VisitDeleteProDataResponse(w http.ResponseWriter) error

type DeleteProData502JSONResponse struct{ BadGatewayJSONResponse }

func (DeleteProData502JSONResponse) VisitDeleteProDataResponse

Section titled “func (DeleteProData502JSONResponse) VisitDeleteProDataResponse”
func (response DeleteProData502JSONResponse) VisitDeleteProDataResponse(w http.ResponseWriter) error

type DeleteProDataRequestObject struct {
}

type DeleteProDataResponseObject interface {
VisitDeleteProDataResponse(w http.ResponseWriter) error
}

DirectoryPath defines model for DirectoryPath.

type DirectoryPath = string

type DisconnectHarnessAuth200JSONResponse HarnessAuthStatus

func (DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse

Section titled “func (DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse”
func (response DisconnectHarnessAuth200JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error

type DisconnectHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }

func (DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse

Section titled “func (DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse”
func (response DisconnectHarnessAuth400JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error

type DisconnectHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }

func (DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse

Section titled “func (DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse”
func (response DisconnectHarnessAuth401JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error

type DisconnectHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }

func (DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse

Section titled “func (DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse”
func (response DisconnectHarnessAuth404JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error

type DisconnectHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }

func (DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse

Section titled “func (DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse”
func (response DisconnectHarnessAuth500JSONResponse) VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error

DisconnectHarnessAuthJSONRequestBody defines body for DisconnectHarnessAuth for application/json ContentType.

type DisconnectHarnessAuthJSONRequestBody = HarnessRequest

type DisconnectHarnessAuthRequestObject struct {
Body *DisconnectHarnessAuthJSONRequestBody
}

type DisconnectHarnessAuthResponseObject interface {
VisitDisconnectHarnessAuthResponse(w http.ResponseWriter) error
}

type EndLiveActivity200JSONResponse OkResponse

func (EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse

Section titled “func (EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse”
func (response EndLiveActivity200JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) error

type EndLiveActivity400JSONResponse struct{ BadRequestJSONResponse }

func (EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse

Section titled “func (EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse”
func (response EndLiveActivity400JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) error

type EndLiveActivity401JSONResponse struct{ UnauthorizedJSONResponse }

func (EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse

Section titled “func (EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse”
func (response EndLiveActivity401JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) error

type EndLiveActivity404JSONResponse struct{ NotFoundJSONResponse }

func (EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse

Section titled “func (EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse”
func (response EndLiveActivity404JSONResponse) VisitEndLiveActivityResponse(w http.ResponseWriter) error

type EndLiveActivity409Response struct {
}

func (EndLiveActivity409Response) VisitEndLiveActivityResponse

Section titled “func (EndLiveActivity409Response) VisitEndLiveActivityResponse”
func (response EndLiveActivity409Response) VisitEndLiveActivityResponse(w http.ResponseWriter) error

type EndLiveActivityRequestObject struct {
Id RequestId `json:"id"`
}

type EndLiveActivityResponseObject interface {
VisitEndLiveActivityResponse(w http.ResponseWriter) error
}

ErrorResponse defines model for ErrorResponse.

type ErrorResponse struct {
Data map[string]interface{} `json:"data"`
Message string `json:"message"`
Status int `json:"status"`
}

type ExecuteMcpRequest200JSONResponse ExecuteMcpRequestResponse

func (ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest200JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest400JSONResponse struct{ BadRequestJSONResponse }

func (ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest400JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest401JSONResponse struct{ UnauthorizedJSONResponse }

func (ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest401JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest403JSONResponse struct{ ForbiddenJSONResponse }

func (ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest403JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest404JSONResponse struct{ NotFoundJSONResponse }

func (ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest404JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest422JSONResponse struct{ UnprocessableJSONResponse }

func (ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest422JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

type ExecuteMcpRequest500JSONResponse struct{ InternalErrorJSONResponse }

func (ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse

Section titled “func (ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse”
func (response ExecuteMcpRequest500JSONResponse) VisitExecuteMcpRequestResponse(w http.ResponseWriter) error

ExecuteMcpRequestJSONRequestBody defines body for ExecuteMcpRequest for application/json ContentType.

type ExecuteMcpRequestJSONRequestBody = McpRequest

type ExecuteMcpRequestRequestObject struct {
Body *ExecuteMcpRequestJSONRequestBody
}

ExecuteMcpRequestResponse defines model for ExecuteMcpRequestResponse.

type ExecuteMcpRequestResponse struct {
Id string `json:"id"`
Status string `json:"status"`
Synced *bool `json:"synced,omitempty"`
}

type ExecuteMcpRequestResponseObject interface {
VisitExecuteMcpRequestResponse(w http.ResponseWriter) error
}

FilePath defines model for FilePath.

type FilePath = string

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"`
}

FileTreeResponse defines model for FileTreeResponse.

type FileTreeResponse struct {
Entries []FileTreeEntry `json:"entries"`
Path string `json:"path"`
}

Forbidden defines model for Forbidden.

type Forbidden = ErrorResponse

type ForbiddenJSONResponse ErrorResponse

type GetHarnessAuthStatus200JSONResponse HarnessAuthStatus

func (GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse

Section titled “func (GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse”
func (response GetHarnessAuthStatus200JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error

type GetHarnessAuthStatus400JSONResponse struct{ BadRequestJSONResponse }

func (GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse

Section titled “func (GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse”
func (response GetHarnessAuthStatus400JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error

type GetHarnessAuthStatus401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse

Section titled “func (GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse”
func (response GetHarnessAuthStatus401JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error

type GetHarnessAuthStatus404JSONResponse struct{ NotFoundJSONResponse }

func (GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse

Section titled “func (GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse”
func (response GetHarnessAuthStatus404JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error

type GetHarnessAuthStatus500JSONResponse struct{ InternalErrorJSONResponse }

func (GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse

Section titled “func (GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse”
func (response GetHarnessAuthStatus500JSONResponse) VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error

GetHarnessAuthStatusJSONRequestBody defines body for GetHarnessAuthStatus for application/json ContentType.

type GetHarnessAuthStatusJSONRequestBody = HarnessRequest

type GetHarnessAuthStatusRequestObject struct {
Body *GetHarnessAuthStatusJSONRequestBody
}

type GetHarnessAuthStatusResponseObject interface {
VisitGetHarnessAuthStatusResponse(w http.ResponseWriter) error
}

type GetHarnessInstanceLogs200JSONResponse

Section titled “type GetHarnessInstanceLogs200JSONResponse”
type GetHarnessInstanceLogs200JSONResponse HarnessInstanceLogResponse

func (GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse

Section titled “func (GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse”
func (response GetHarnessInstanceLogs200JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) error

type GetHarnessInstanceLogs401JSONResponse

Section titled “type GetHarnessInstanceLogs401JSONResponse”
type GetHarnessInstanceLogs401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse

Section titled “func (GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse”
func (response GetHarnessInstanceLogs401JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) error

type GetHarnessInstanceLogs404JSONResponse

Section titled “type GetHarnessInstanceLogs404JSONResponse”
type GetHarnessInstanceLogs404JSONResponse struct{ NotFoundJSONResponse }

func (GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse

Section titled “func (GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse”
func (response GetHarnessInstanceLogs404JSONResponse) VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) error

type GetHarnessInstanceLogsRequestObject struct {
Id string `json:"id"`
}

type GetHarnessInstanceLogsResponseObject interface {
VisitGetHarnessInstanceLogsResponse(w http.ResponseWriter) error
}

type GetReleaseCompatibility200JSONResponse

Section titled “type GetReleaseCompatibility200JSONResponse”
type GetReleaseCompatibility200JSONResponse ReleaseCompatibilityResponse

func (GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse

Section titled “func (GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse”
func (response GetReleaseCompatibility200JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error

type GetReleaseCompatibility400JSONResponse

Section titled “type GetReleaseCompatibility400JSONResponse”
type GetReleaseCompatibility400JSONResponse struct{ BadRequestJSONResponse }

func (GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse

Section titled “func (GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse”
func (response GetReleaseCompatibility400JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error

type GetReleaseCompatibility401JSONResponse

Section titled “type GetReleaseCompatibility401JSONResponse”
type GetReleaseCompatibility401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse

Section titled “func (GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse”
func (response GetReleaseCompatibility401JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error

type GetReleaseCompatibility404JSONResponse

Section titled “type GetReleaseCompatibility404JSONResponse”
type GetReleaseCompatibility404JSONResponse struct{ NotFoundJSONResponse }

func (GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse

Section titled “func (GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse”
func (response GetReleaseCompatibility404JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error

type GetReleaseCompatibility500JSONResponse

Section titled “type GetReleaseCompatibility500JSONResponse”
type GetReleaseCompatibility500JSONResponse struct{ InternalErrorJSONResponse }

func (GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse

Section titled “func (GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse”
func (response GetReleaseCompatibility500JSONResponse) VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error

type GetReleaseCompatibilityRequestObject struct {
}

type GetReleaseCompatibilityResponseObject

Section titled “type GetReleaseCompatibilityResponseObject”
type GetReleaseCompatibilityResponseObject interface {
VisitGetReleaseCompatibilityResponse(w http.ResponseWriter) error
}

type GetReleaseStatus200JSONResponse ReleaseStatusResponse

func (GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse

Section titled “func (GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse”
func (response GetReleaseStatus200JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) error

type GetReleaseStatus400JSONResponse struct{ BadRequestJSONResponse }

func (GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse

Section titled “func (GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse”
func (response GetReleaseStatus400JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) error

type GetReleaseStatus401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse

Section titled “func (GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse”
func (response GetReleaseStatus401JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) error

type GetReleaseStatus404JSONResponse struct{ NotFoundJSONResponse }

func (GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse

Section titled “func (GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse”
func (response GetReleaseStatus404JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) error

type GetReleaseStatus500JSONResponse struct{ InternalErrorJSONResponse }

func (GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse

Section titled “func (GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse”
func (response GetReleaseStatus500JSONResponse) VisitGetReleaseStatusResponse(w http.ResponseWriter) error

type GetReleaseStatusRequestObject struct {
}

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) error

type GetWorkspaceFile401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse

Section titled “func (GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse”
func (response GetWorkspaceFile401JSONResponse) VisitGetWorkspaceFileResponse(w http.ResponseWriter) error

type GetWorkspaceFile404JSONResponse struct{ NotFoundJSONResponse }

func (GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse

Section titled “func (GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse”
func (response GetWorkspaceFile404JSONResponse) VisitGetWorkspaceFileResponse(w http.ResponseWriter) error

GetWorkspaceFileParams defines parameters for GetWorkspaceFile.

type GetWorkspaceFileParams struct {
Path FilePath `form:"path" json:"path"`
}

type GetWorkspaceFileRequestObject struct {
Params GetWorkspaceFileParams
}

type GetWorkspaceFileResponseObject interface {
VisitGetWorkspaceFileResponse(w http.ResponseWriter) error
}

HarnessAuthAttempt defines model for HarnessAuthAttempt.

type HarnessAuthAttempt struct {
Id string `json:"id"`
LastError *string `json:"lastError,omitempty"`
Status string `json:"status"`
}

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"`
}

HarnessAuthChallengeCodeDestination defines model for HarnessAuthChallenge.CodeDestination.

type HarnessAuthChallengeCodeDestination string

Defines 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() bool

Valid indicates whether the value is a known member of the HarnessAuthChallengeCodeDestination enum.

HarnessAuthChallengeKind defines model for HarnessAuthChallenge.Kind.

type HarnessAuthChallengeKind string

Defines values for HarnessAuthChallengeKind.

const (
BrowserCode HarnessAuthChallengeKind = "browser_code"
DeviceCode HarnessAuthChallengeKind = "device_code"
)

func (e HarnessAuthChallengeKind) Valid() bool

Valid indicates whether the value is a known member of the HarnessAuthChallengeKind enum.

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"`
}

HarnessAuthStatusMode defines model for HarnessAuthStatus.Mode.

type HarnessAuthStatusMode string

Defines values for HarnessAuthStatusMode.

const (
HarnessAuthStatusModeNone HarnessAuthStatusMode = "none"
HarnessAuthStatusModeOauth HarnessAuthStatusMode = "oauth"
)

func (e HarnessAuthStatusMode) Valid() bool

Valid indicates whether the value is a known member of the HarnessAuthStatusMode enum.

HarnessInstanceLogResponse defines model for HarnessInstanceLogResponse.

type HarnessInstanceLogResponse struct {
Lines []string `json:"lines"`
Truncated bool `json:"truncated"`
}

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"`
}

HarnessRequestMode defines model for HarnessRequest.Mode.

type HarnessRequestMode string

Defines values for HarnessRequestMode.

const (
None HarnessRequestMode = "none"
Oauth HarnessRequestMode = "oauth"
)

func (e HarnessRequestMode) Valid() bool

Valid indicates whether the value is a known member of the HarnessRequestMode enum.

InternalError defines model for InternalError.

type InternalError = ErrorResponse

type InternalErrorJSONResponse ErrorResponse

type InvalidParamFormatError struct {
ParamName string
Err error
}

func (e *InvalidParamFormatError) Error() string

func (e *InvalidParamFormatError) Unwrap() error

type ListContainers200JSONResponse ContainerListResponse

func (ListContainers200JSONResponse) VisitListContainersResponse

Section titled “func (ListContainers200JSONResponse) VisitListContainersResponse”
func (response ListContainers200JSONResponse) VisitListContainersResponse(w http.ResponseWriter) error

type ListContainers401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListContainers401JSONResponse) VisitListContainersResponse

Section titled “func (ListContainers401JSONResponse) VisitListContainersResponse”
func (response ListContainers401JSONResponse) VisitListContainersResponse(w http.ResponseWriter) error

type ListContainers403JSONResponse struct{ ForbiddenJSONResponse }

func (ListContainers403JSONResponse) VisitListContainersResponse

Section titled “func (ListContainers403JSONResponse) VisitListContainersResponse”
func (response ListContainers403JSONResponse) VisitListContainersResponse(w http.ResponseWriter) error

type ListContainersRequestObject struct {
}

type ListContainersResponseObject interface {
VisitListContainersResponse(w http.ResponseWriter) error
}

type ListOllamaModels200JSONResponse OllamaModelsResponse

func (ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels200JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModels400JSONResponse struct{ BadRequestJSONResponse }

func (ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels400JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModels401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels401JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModels403JSONResponse struct{ ForbiddenJSONResponse }

func (ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels403JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModels404JSONResponse struct{ NotFoundJSONResponse }

func (ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels404JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModels500JSONResponse struct{ InternalErrorJSONResponse }

func (ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse

Section titled “func (ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse”
func (response ListOllamaModels500JSONResponse) VisitListOllamaModelsResponse(w http.ResponseWriter) error

type ListOllamaModelsRequestObject struct {
}

type ListOllamaModelsResponseObject interface {
VisitListOllamaModelsResponse(w http.ResponseWriter) error
}

type ListWorkspaceFileTree200JSONResponse FileTreeResponse

func (ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse

Section titled “func (ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse”
func (response ListWorkspaceFileTree200JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) error

type ListWorkspaceFileTree401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse

Section titled “func (ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse”
func (response ListWorkspaceFileTree401JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) error

type ListWorkspaceFileTree404JSONResponse struct{ NotFoundJSONResponse }

func (ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse

Section titled “func (ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse”
func (response ListWorkspaceFileTree404JSONResponse) VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) error

ListWorkspaceFileTreeParams defines parameters for ListWorkspaceFileTree.

type ListWorkspaceFileTreeParams struct {
Path *DirectoryPath `form:"path,omitempty" json:"path,omitempty"`
}

type ListWorkspaceFileTreeRequestObject struct {
Params ListWorkspaceFileTreeParams
}

type ListWorkspaceFileTreeResponseObject interface {
VisitListWorkspaceFileTreeResponse(w http.ResponseWriter) error
}

LogEvent defines model for LogEvent.

type LogEvent map[string]interface{}

McpOAuthRequest defines model for McpOAuthRequest.

type McpOAuthRequest struct {
AccessToken string `json:"access_token"`
RefreshToken *string `json:"refresh_token,omitempty"`
ServerName string `json:"server_name"`
}

McpRequest defines model for McpRequest.

type McpRequest map[string]interface{}

type MiddlewareFunc func(http.Handler) http.Handler

ModeRequest defines model for ModeRequest.

type ModeRequest struct {
ModeId string `json:"modeId"`
}

ModelRequest defines model for ModelRequest.

type ModelRequest struct {
Model string `json:"model"`
}

NotFound defines model for NotFound.

type NotFound = ErrorResponse

type NotFoundJSONResponse ErrorResponse

OkResponse defines model for OkResponse.

type OkResponse struct {
Ok bool `json:"ok"`
}

OllamaModelsResponse defines model for OllamaModelsResponse.

type OllamaModelsResponse struct {
Enabled bool `json:"enabled"`
Models []map[string]interface{} `json:"models"`
}

OllamaProgress defines model for OllamaProgress.

type OllamaProgress map[string]interface{}

type PollHarnessAuth200JSONResponse HarnessAuthStatus

func (PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse

Section titled “func (PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse”
func (response PollHarnessAuth200JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) error

type PollHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }

func (PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse

Section titled “func (PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse”
func (response PollHarnessAuth400JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) error

type PollHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }

func (PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse

Section titled “func (PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse”
func (response PollHarnessAuth401JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) error

type PollHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }

func (PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse

Section titled “func (PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse”
func (response PollHarnessAuth404JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) error

type PollHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }

func (PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse

Section titled “func (PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse”
func (response PollHarnessAuth500JSONResponse) VisitPollHarnessAuthResponse(w http.ResponseWriter) error

PollHarnessAuthJSONRequestBody defines body for PollHarnessAuth for application/json ContentType.

type PollHarnessAuthJSONRequestBody = HarnessRequest

type PollHarnessAuthRequestObject struct {
Body *PollHarnessAuthJSONRequestBody
}

type PollHarnessAuthResponseObject interface {
VisitPollHarnessAuthResponse(w http.ResponseWriter) error
}

type PromptChat202JSONResponse AcceptedResponse

func (PromptChat202JSONResponse) VisitPromptChatResponse

Section titled “func (PromptChat202JSONResponse) VisitPromptChatResponse”
func (response PromptChat202JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) error

type PromptChat400JSONResponse struct{ BadRequestJSONResponse }

func (PromptChat400JSONResponse) VisitPromptChatResponse

Section titled “func (PromptChat400JSONResponse) VisitPromptChatResponse”
func (response PromptChat400JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) error

type PromptChat401JSONResponse struct{ UnauthorizedJSONResponse }

func (PromptChat401JSONResponse) VisitPromptChatResponse

Section titled “func (PromptChat401JSONResponse) VisitPromptChatResponse”
func (response PromptChat401JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) error

type PromptChat404JSONResponse struct{ NotFoundJSONResponse }

func (PromptChat404JSONResponse) VisitPromptChatResponse

Section titled “func (PromptChat404JSONResponse) VisitPromptChatResponse”
func (response PromptChat404JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) error

type PromptChat503JSONResponse struct{ UnavailableJSONResponse }

func (PromptChat503JSONResponse) VisitPromptChatResponse

Section titled “func (PromptChat503JSONResponse) VisitPromptChatResponse”
func (response PromptChat503JSONResponse) VisitPromptChatResponse(w http.ResponseWriter) error

PromptChatJSONRequestBody defines body for PromptChat for application/json ContentType.

type PromptChatJSONRequestBody = PromptRequest

type PromptChatRequestObject struct {
ChatId ChatId `json:"chatId"`
Body *PromptChatJSONRequestBody
}

type PromptChatResponseObject interface {
VisitPromptChatResponse(w http.ResponseWriter) error
}

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) error

type ProxyObservability401JSONResponse struct{ UnauthorizedJSONResponse }

func (ProxyObservability401JSONResponse) VisitProxyObservabilityResponse

Section titled “func (ProxyObservability401JSONResponse) VisitProxyObservabilityResponse”
func (response ProxyObservability401JSONResponse) VisitProxyObservabilityResponse(w http.ResponseWriter) error

type ProxyObservability403JSONResponse struct{ ForbiddenJSONResponse }

func (ProxyObservability403JSONResponse) VisitProxyObservabilityResponse

Section titled “func (ProxyObservability403JSONResponse) VisitProxyObservabilityResponse”
func (response ProxyObservability403JSONResponse) VisitProxyObservabilityResponse(w http.ResponseWriter) error

type ProxyObservabilityRequestObject struct {
Path string `json:"path"`
}

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) error

type PullOllamaModel400JSONResponse struct{ BadRequestJSONResponse }

func (PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse

Section titled “func (PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse”
func (response PullOllamaModel400JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) error

type PullOllamaModel401JSONResponse struct{ UnauthorizedJSONResponse }

func (PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse

Section titled “func (PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse”
func (response PullOllamaModel401JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) error

type PullOllamaModel403JSONResponse struct{ ForbiddenJSONResponse }

func (PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse

Section titled “func (PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse”
func (response PullOllamaModel403JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) error

type PullOllamaModel502JSONResponse struct{ BadGatewayJSONResponse }

func (PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse

Section titled “func (PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse”
func (response PullOllamaModel502JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) error

type PullOllamaModel503JSONResponse struct{ UnavailableJSONResponse }

func (PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse

Section titled “func (PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse”
func (response PullOllamaModel503JSONResponse) VisitPullOllamaModelResponse(w http.ResponseWriter) error

PullOllamaModelJSONRequestBody defines body for PullOllamaModel for application/json ContentType.

type PullOllamaModelJSONRequestBody = ModelRequest

type PullOllamaModelRequestObject struct {
Body *PullOllamaModelJSONRequestBody
}

type PullOllamaModelResponseObject interface {
VisitPullOllamaModelResponse(w http.ResponseWriter) error
}

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"`
}

ReleaseCompatibilityResponse defines model for ReleaseCompatibilityResponse.

type ReleaseCompatibilityResponse struct {
Compatibility map[string]interface{} `json:"compatibility"`
DataVersion int `json:"dataVersion"`
SchemaVersion int `json:"schemaVersion"`
}

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"`
}

RequestId defines model for RequestId.

type RequestId = string

type RequiredHeaderError struct {
ParamName string
Err error
}

func (e *RequiredHeaderError) Error() string

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError struct {
ParamName string
}

func (e *RequiredParamError) Error() string

type RespondToElicitation202Response struct {
}

func (RespondToElicitation202Response) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation202Response) VisitRespondToElicitationResponse”
func (response RespondToElicitation202Response) VisitRespondToElicitationResponse(w http.ResponseWriter) error

type RespondToElicitation400JSONResponse struct{ BadRequestJSONResponse }

func (RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse”
func (response RespondToElicitation400JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) error

type RespondToElicitation401JSONResponse struct{ UnauthorizedJSONResponse }

func (RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse”
func (response RespondToElicitation401JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) error

type RespondToElicitation404JSONResponse struct{ NotFoundJSONResponse }

func (RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse”
func (response RespondToElicitation404JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) error

type RespondToElicitation502JSONResponse struct{ BadGatewayJSONResponse }

func (RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse”
func (response RespondToElicitation502JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) error

type RespondToElicitation503JSONResponse struct{ UnavailableJSONResponse }

func (RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse

Section titled “func (RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse”
func (response RespondToElicitation503JSONResponse) VisitRespondToElicitationResponse(w http.ResponseWriter) error

RespondToElicitationJSONRequestBody defines body for RespondToElicitation for application/json ContentType.

type RespondToElicitationJSONRequestBody = DecisionRequest

type RespondToElicitationRequestObject struct {
ChatId ChatId `json:"chatId"`
Id RequestId `json:"id"`
Body *RespondToElicitationJSONRequestBody
}

type RespondToElicitationResponseObject interface {
VisitRespondToElicitationResponse(w http.ResponseWriter) error
}

type RespondToPermission202Response struct {
}

func (RespondToPermission202Response) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission202Response) VisitRespondToPermissionResponse”
func (response RespondToPermission202Response) VisitRespondToPermissionResponse(w http.ResponseWriter) error

type RespondToPermission400JSONResponse struct{ BadRequestJSONResponse }

func (RespondToPermission400JSONResponse) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission400JSONResponse) VisitRespondToPermissionResponse”
func (response RespondToPermission400JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) error

type RespondToPermission401JSONResponse struct{ UnauthorizedJSONResponse }

func (RespondToPermission401JSONResponse) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission401JSONResponse) VisitRespondToPermissionResponse”
func (response RespondToPermission401JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) error

type RespondToPermission404JSONResponse struct{ NotFoundJSONResponse }

func (RespondToPermission404JSONResponse) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission404JSONResponse) VisitRespondToPermissionResponse”
func (response RespondToPermission404JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) error

type RespondToPermission502JSONResponse struct{ BadGatewayJSONResponse }

func (RespondToPermission502JSONResponse) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission502JSONResponse) VisitRespondToPermissionResponse”
func (response RespondToPermission502JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) error

type RespondToPermission503JSONResponse struct{ UnavailableJSONResponse }

func (RespondToPermission503JSONResponse) VisitRespondToPermissionResponse

Section titled “func (RespondToPermission503JSONResponse) VisitRespondToPermissionResponse”
func (response RespondToPermission503JSONResponse) VisitRespondToPermissionResponse(w http.ResponseWriter) error

RespondToPermissionJSONRequestBody defines body for RespondToPermission for application/json ContentType.

type RespondToPermissionJSONRequestBody = DecisionRequest

type RespondToPermissionRequestObject struct {
ChatId ChatId `json:"chatId"`
Id RequestId `json:"id"`
Body *RespondToPermissionJSONRequestBody
}

type RespondToPermissionResponseObject interface {
VisitRespondToPermissionResponse(w http.ResponseWriter) error
}

type RunScheduleNow202JSONResponse ScheduleRunAcceptedResponse

func (RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse

Section titled “func (RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse”
func (response RunScheduleNow202JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) error

type RunScheduleNow400JSONResponse struct{ BadRequestJSONResponse }

func (RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse

Section titled “func (RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse”
func (response RunScheduleNow400JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) error

type RunScheduleNow401JSONResponse struct{ UnauthorizedJSONResponse }

func (RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse

Section titled “func (RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse”
func (response RunScheduleNow401JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) error

type RunScheduleNow404JSONResponse struct{ NotFoundJSONResponse }

func (RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse

Section titled “func (RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse”
func (response RunScheduleNow404JSONResponse) VisitRunScheduleNowResponse(w http.ResponseWriter) error

type RunScheduleNowRequestObject struct {
ScheduleId string `json:"scheduleId"`
}

type RunScheduleNowResponseObject interface {
VisitRunScheduleNowResponse(w http.ResponseWriter) error
}

ScheduleRunAcceptedResponse defines model for ScheduleRunAcceptedResponse.

type ScheduleRunAcceptedResponse struct {
Status ScheduleRunAcceptedResponseStatus `json:"status"`
}

ScheduleRunAcceptedResponseStatus defines model for ScheduleRunAcceptedResponse.Status.

type ScheduleRunAcceptedResponseStatus string

Defines values for ScheduleRunAcceptedResponseStatus.

const (
Started ScheduleRunAcceptedResponseStatus = "started"
)

func (ScheduleRunAcceptedResponseStatus) Valid

Section titled “func (ScheduleRunAcceptedResponseStatus) Valid”
func (e ScheduleRunAcceptedResponseStatus) Valid() bool

Valid indicates whether the value is a known member of the ScheduleRunAcceptedResponseStatus enum.

type SendPushNotification200JSONResponse OkResponse

func (SendPushNotification200JSONResponse) VisitSendPushNotificationResponse

Section titled “func (SendPushNotification200JSONResponse) VisitSendPushNotificationResponse”
func (response SendPushNotification200JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) error

type SendPushNotification204Response struct {
}

func (SendPushNotification204Response) VisitSendPushNotificationResponse

Section titled “func (SendPushNotification204Response) VisitSendPushNotificationResponse”
func (response SendPushNotification204Response) VisitSendPushNotificationResponse(w http.ResponseWriter) error

type SendPushNotification400JSONResponse struct{ BadRequestJSONResponse }

func (SendPushNotification400JSONResponse) VisitSendPushNotificationResponse

Section titled “func (SendPushNotification400JSONResponse) VisitSendPushNotificationResponse”
func (response SendPushNotification400JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) error

type SendPushNotification401JSONResponse struct{ UnauthorizedJSONResponse }

func (SendPushNotification401JSONResponse) VisitSendPushNotificationResponse

Section titled “func (SendPushNotification401JSONResponse) VisitSendPushNotificationResponse”
func (response SendPushNotification401JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) error

type SendPushNotification404JSONResponse struct{ NotFoundJSONResponse }

func (SendPushNotification404JSONResponse) VisitSendPushNotificationResponse

Section titled “func (SendPushNotification404JSONResponse) VisitSendPushNotificationResponse”
func (response SendPushNotification404JSONResponse) VisitSendPushNotificationResponse(w http.ResponseWriter) error

SendPushNotificationJSONRequestBody defines body for SendPushNotification for application/json ContentType.

type SendPushNotificationJSONRequestBody = PushRequest

type SendPushNotificationRequestObject struct {
Body *SendPushNotificationJSONRequestBody
}

type SendPushNotificationResponseObject interface {
VisitSendPushNotificationResponse(w http.ResponseWriter) error
}

ServeMux is an abstraction of http.ServeMux.

type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
http.Handler
}

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(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

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 (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 struct {
}

func (SetChatConfigOption202Response) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption202Response) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption202Response) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

type SetChatConfigOption400JSONResponse struct{ BadRequestJSONResponse }

func (SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption400JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

type SetChatConfigOption401JSONResponse struct{ UnauthorizedJSONResponse }

func (SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption401JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

type SetChatConfigOption404JSONResponse struct{ NotFoundJSONResponse }

func (SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption404JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

type SetChatConfigOption502JSONResponse struct{ BadGatewayJSONResponse }

func (SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption502JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

type SetChatConfigOption503JSONResponse struct{ UnavailableJSONResponse }

func (SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse

Section titled “func (SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse”
func (response SetChatConfigOption503JSONResponse) VisitSetChatConfigOptionResponse(w http.ResponseWriter) error

SetChatConfigOptionJSONRequestBody defines body for SetChatConfigOption for application/json ContentType.

type SetChatConfigOptionJSONRequestBody = ConfigOptionRequest

type SetChatConfigOptionRequestObject struct {
ChatId ChatId `json:"chatId"`
Body *SetChatConfigOptionJSONRequestBody
}

type SetChatConfigOptionResponseObject interface {
VisitSetChatConfigOptionResponse(w http.ResponseWriter) error
}

type SetChatMode202Response struct {
}

func (SetChatMode202Response) VisitSetChatModeResponse

Section titled “func (SetChatMode202Response) VisitSetChatModeResponse”
func (response SetChatMode202Response) VisitSetChatModeResponse(w http.ResponseWriter) error

type SetChatMode400JSONResponse struct{ BadRequestJSONResponse }

func (SetChatMode400JSONResponse) VisitSetChatModeResponse

Section titled “func (SetChatMode400JSONResponse) VisitSetChatModeResponse”
func (response SetChatMode400JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) error

type SetChatMode401JSONResponse struct{ UnauthorizedJSONResponse }

func (SetChatMode401JSONResponse) VisitSetChatModeResponse

Section titled “func (SetChatMode401JSONResponse) VisitSetChatModeResponse”
func (response SetChatMode401JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) error

type SetChatMode404JSONResponse struct{ NotFoundJSONResponse }

func (SetChatMode404JSONResponse) VisitSetChatModeResponse

Section titled “func (SetChatMode404JSONResponse) VisitSetChatModeResponse”
func (response SetChatMode404JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) error

type SetChatMode502JSONResponse struct{ BadGatewayJSONResponse }

func (SetChatMode502JSONResponse) VisitSetChatModeResponse

Section titled “func (SetChatMode502JSONResponse) VisitSetChatModeResponse”
func (response SetChatMode502JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) error

type SetChatMode503JSONResponse struct{ UnavailableJSONResponse }

func (SetChatMode503JSONResponse) VisitSetChatModeResponse

Section titled “func (SetChatMode503JSONResponse) VisitSetChatModeResponse”
func (response SetChatMode503JSONResponse) VisitSetChatModeResponse(w http.ResponseWriter) error

SetChatModeJSONRequestBody defines body for SetChatMode for application/json ContentType.

type SetChatModeJSONRequestBody = ModeRequest

type SetChatModeRequestObject struct {
ChatId ChatId `json:"chatId"`
Body *SetChatModeJSONRequestBody
}

type SetChatModeResponseObject interface {
VisitSetChatModeResponse(w http.ResponseWriter) error
}

type SetLiveActivityToken200JSONResponse OkResponse

func (SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse

Section titled “func (SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse”
func (response SetLiveActivityToken200JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error

type SetLiveActivityToken400JSONResponse struct{ BadRequestJSONResponse }

func (SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse

Section titled “func (SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse”
func (response SetLiveActivityToken400JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error

type SetLiveActivityToken401JSONResponse struct{ UnauthorizedJSONResponse }

func (SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse

Section titled “func (SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse”
func (response SetLiveActivityToken401JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error

type SetLiveActivityToken404JSONResponse struct{ NotFoundJSONResponse }

func (SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse

Section titled “func (SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse”
func (response SetLiveActivityToken404JSONResponse) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error

type SetLiveActivityToken409Response struct {
}

func (SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse

Section titled “func (SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse”
func (response SetLiveActivityToken409Response) VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error

SetLiveActivityTokenJSONRequestBody defines body for SetLiveActivityToken for application/json ContentType.

type SetLiveActivityTokenJSONRequestBody = SetLiveActivityTokenRequest

SetLiveActivityTokenRequest defines model for SetLiveActivityTokenRequest.

type SetLiveActivityTokenRequest struct {
ActivityPushToken string `json:"activity_push_token"`
}

type SetLiveActivityTokenRequestObject struct {
Id RequestId `json:"id"`
Body *SetLiveActivityTokenJSONRequestBody
}

type SetLiveActivityTokenResponseObject interface {
VisitSetLiveActivityTokenResponse(w http.ResponseWriter) error
}

type StartHarnessAuth200JSONResponse HarnessAuthStatus

func (StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse

Section titled “func (StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse”
func (response StartHarnessAuth200JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) error

type StartHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }

func (StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse

Section titled “func (StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse”
func (response StartHarnessAuth400JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) error

type StartHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }

func (StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse

Section titled “func (StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse”
func (response StartHarnessAuth401JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) error

type StartHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }

func (StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse

Section titled “func (StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse”
func (response StartHarnessAuth404JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) error

type StartHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }

func (StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse

Section titled “func (StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse”
func (response StartHarnessAuth500JSONResponse) VisitStartHarnessAuthResponse(w http.ResponseWriter) error

StartHarnessAuthJSONRequestBody defines body for StartHarnessAuth for application/json ContentType.

type StartHarnessAuthJSONRequestBody = HarnessRequest

type StartHarnessAuthRequestObject struct {
Body *StartHarnessAuthJSONRequestBody
}

type StartHarnessAuthResponseObject interface {
VisitStartHarnessAuthResponse(w http.ResponseWriter) error
}

type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StoreMcpOAuthToken200JSONResponse StoreMcpOAuthTokenResponse

func (StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse

Section titled “func (StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse”
func (response StoreMcpOAuthToken200JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error

type StoreMcpOAuthToken400JSONResponse struct{ BadRequestJSONResponse }

func (StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse

Section titled “func (StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse”
func (response StoreMcpOAuthToken400JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error

type StoreMcpOAuthToken401JSONResponse struct{ UnauthorizedJSONResponse }

func (StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse

Section titled “func (StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse”
func (response StoreMcpOAuthToken401JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error

type StoreMcpOAuthToken404JSONResponse struct{ NotFoundJSONResponse }

func (StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse

Section titled “func (StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse”
func (response StoreMcpOAuthToken404JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error

type StoreMcpOAuthToken500JSONResponse struct{ InternalErrorJSONResponse }

func (StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse

Section titled “func (StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse”
func (response StoreMcpOAuthToken500JSONResponse) VisitStoreMcpOAuthTokenResponse(w http.ResponseWriter) error

StoreMcpOAuthTokenJSONRequestBody defines body for StoreMcpOAuthToken for application/json ContentType.

type StoreMcpOAuthTokenJSONRequestBody = McpOAuthRequest

type StoreMcpOAuthTokenRequestObject struct {
Body *StoreMcpOAuthTokenJSONRequestBody
}

StoreMcpOAuthTokenResponse defines model for StoreMcpOAuthTokenResponse.

type StoreMcpOAuthTokenResponse struct {
Stored bool `json:"stored"`
}

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) error

type StreamChatEvents401JSONResponse struct{ UnauthorizedJSONResponse }

func (StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse

Section titled “func (StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse”
func (response StreamChatEvents401JSONResponse) VisitStreamChatEventsResponse(w http.ResponseWriter) error

type StreamChatEvents404JSONResponse struct{ NotFoundJSONResponse }

func (StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse

Section titled “func (StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse”
func (response StreamChatEvents404JSONResponse) VisitStreamChatEventsResponse(w http.ResponseWriter) error

StreamChatEventsParams defines parameters for StreamChatEvents.

type StreamChatEventsParams struct {
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
}

type StreamChatEventsRequestObject struct {
ChatId ChatId `json:"chatId"`
Params StreamChatEventsParams
}

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) error

type StreamContainerLogs401JSONResponse struct{ UnauthorizedJSONResponse }

func (StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse

Section titled “func (StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse”
func (response StreamContainerLogs401JSONResponse) VisitStreamContainerLogsResponse(w http.ResponseWriter) error

type StreamContainerLogs404JSONResponse struct{ NotFoundJSONResponse }

func (StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse

Section titled “func (StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse”
func (response StreamContainerLogs404JSONResponse) VisitStreamContainerLogsResponse(w http.ResponseWriter) error

type StreamContainerLogsRequestObject struct {
ContainerName ContainerName `json:"containerName"`
}

type StreamContainerLogsResponseObject interface {
VisitStreamContainerLogsResponse(w http.ResponseWriter) error
}

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 func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

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 HarnessAuthStatus

func (SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse

Section titled “func (SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse”
func (response SubmitHarnessAuth200JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error

type SubmitHarnessAuth400JSONResponse struct{ BadRequestJSONResponse }

func (SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse

Section titled “func (SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse”
func (response SubmitHarnessAuth400JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error

type SubmitHarnessAuth401JSONResponse struct{ UnauthorizedJSONResponse }

func (SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse

Section titled “func (SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse”
func (response SubmitHarnessAuth401JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error

type SubmitHarnessAuth404JSONResponse struct{ NotFoundJSONResponse }

func (SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse

Section titled “func (SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse”
func (response SubmitHarnessAuth404JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error

type SubmitHarnessAuth500JSONResponse struct{ InternalErrorJSONResponse }

func (SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse

Section titled “func (SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse”
func (response SubmitHarnessAuth500JSONResponse) VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error

SubmitHarnessAuthJSONRequestBody defines body for SubmitHarnessAuth for application/json ContentType.

type SubmitHarnessAuthJSONRequestBody = HarnessRequest

type SubmitHarnessAuthRequestObject struct {
Body *SubmitHarnessAuthJSONRequestBody
}

type SubmitHarnessAuthResponseObject interface {
VisitSubmitHarnessAuthResponse(w http.ResponseWriter) error
}

type TooManyValuesForParamError struct {
ParamName string
Count int
}

func (e *TooManyValuesForParamError) Error() string

Unauthorized defines model for Unauthorized.

type Unauthorized = ErrorResponse

type UnauthorizedJSONResponse ErrorResponse

Unavailable defines model for Unavailable.

type Unavailable = ErrorResponse

type UnavailableJSONResponse ErrorResponse

type UnescapedCookieParamError struct {
ParamName string
Err error
}

func (e *UnescapedCookieParamError) Error() string

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError struct {
ParamName string
Err error
}

func (e *UnmarshalingParamError) Error() string

func (e *UnmarshalingParamError) Unwrap() error

Unprocessable defines model for Unprocessable.

type Unprocessable = ErrorResponse

type UnprocessableJSONResponse ErrorResponse

pocketbaseTokenContextKey is the context key for pocketbaseToken security scheme

type pocketbaseTokenContextKey string

const (
PocketbaseTokenScopes pocketbaseTokenContextKey = "pocketbaseToken.Scopes"
)

type strictHandler struct {
ssi StrictServerInterface
middlewares []StrictMiddlewareFunc
options StrictHTTPServerOptions
}

func (sh *strictHandler) CancelChatSession(w http.ResponseWriter, r *http.Request, chatId ChatId)

CancelChatSession operation middleware

func (sh *strictHandler) CancelHarnessAuth(w http.ResponseWriter, r *http.Request)

CancelHarnessAuth operation middleware

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 (sh *strictHandler) EndLiveActivity(w http.ResponseWriter, r *http.Request, id RequestId)

EndLiveActivity operation middleware

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 (sh *strictHandler) GetReleaseStatus(w http.ResponseWriter, r *http.Request)

GetReleaseStatus operation middleware

func (sh *strictHandler) GetWorkspaceFile(w http.ResponseWriter, r *http.Request, params GetWorkspaceFileParams)

GetWorkspaceFile operation middleware

func (sh *strictHandler) ListContainers(w http.ResponseWriter, r *http.Request)

ListContainers operation middleware

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 (sh *strictHandler) PollHarnessAuth(w http.ResponseWriter, r *http.Request)

PollHarnessAuth operation middleware

func (sh *strictHandler) PromptChat(w http.ResponseWriter, r *http.Request, chatId ChatId)

PromptChat operation middleware

func (sh *strictHandler) ProxyObservability(w http.ResponseWriter, r *http.Request, path string)

ProxyObservability operation middleware

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 (sh *strictHandler) RespondToPermission(w http.ResponseWriter, r *http.Request, chatId ChatId, id RequestId)

RespondToPermission operation middleware

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 (sh *strictHandler) SetChatConfigOption(w http.ResponseWriter, r *http.Request, chatId ChatId)

SetChatConfigOption operation middleware

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 (sh *strictHandler) StartHarnessAuth(w http.ResponseWriter, r *http.Request)

StartHarnessAuth operation middleware

func (sh *strictHandler) StoreMcpOAuthToken(w http.ResponseWriter, r *http.Request)

StoreMcpOAuthToken operation middleware

func (sh *strictHandler) StreamChatEvents(w http.ResponseWriter, r *http.Request, chatId ChatId, params StreamChatEventsParams)

StreamChatEvents operation middleware

func (sh *strictHandler) StreamContainerLogs(w http.ResponseWriter, r *http.Request, containerName ContainerName)

StreamContainerLogs operation middleware

func (sh *strictHandler) SubmitHarnessAuth(w http.ResponseWriter, r *http.Request)

SubmitHarnessAuth operation middleware

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)

MountDirect installs only transports that cannot safely pass through a buffered strict response: SSE, NDJSON, opaque proxying, and binary files.

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(e *core.ServeEvent, routes []Route, directOnly bool)

type Action func(*core.RequestEvent) error

type Registry struct {
routes map[string]Route
}

func NewRegistry() *Registry

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 (r *Registry) Get(operationID string) (Route, bool)

func (r *Registry) Routes() []Route

type Route struct {
OperationID string
Method string
Path string
Auth bool
Direct bool
Action Action
}
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.

var _ openapi.StrictServerInterface = (*server)(nil)

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(registry *operation.Registry) openapi.StrictMiddlewareFunc

authMiddleware 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(value string) *openapi.HarnessAuthChallengeCodeDestination

func challengeExpiresAtPtr(value string) *time.Time

challengeExpiresAtPtr 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(value string) *openapi.HarnessAuthChallengeKind

func convertFileTreeEntry(entry filesystem.FileTreeEntry) openapi.FileTreeEntry

convertFileTreeEntry 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(status api.HarnessAuthStatusResponse) openapi.HarnessAuthStatus

func intPtr(value int) *int

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(value string) *string

type requestEventContextKey struct{}

type server struct {
registry *operation.Registry
app core.App
agent coordinator.AgentRuntime
agentErr error
scheduleRunner *schedule.Runner
harnessRuntime api.HarnessAuthRuntime
}

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)
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.

const (
defaultPointerPath = "/var/lib/pocketcoder/release/current.json"
defaultArtifactDir = "/artifacts"
defaultReserveBytes = int64(1 << 30)
)

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(ctx context.Context, docker DockerLoader, harnessID, image string) error

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(image, release string) bool

ManagedReleaseImage reports whether image belongs to the active immutable PocketCoder release and therefore must come from its verified artifact.

func decodeStrictFile(path string, target any) error

func filesystemAvailableBytes(path string) (uint64, error)

func validateHarnessArtifact(candidate artifact, image string) error

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() Config

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 struct {
config Config
flights flightGroup
}

var (
defaultOnce sync.Once
defaultLoader *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 struct {
URL string `json:"url"`
SHA256 string `json:"sha256"`
DownloadBytes int64 `json:"downloadBytes"`
UnpackedBytes int64 `json:"unpackedBytes"`
Images []string `json:"images"`
}

type flight struct {
done chan struct{}
err error
}

type flightGroup struct {
mu sync.Mutex
flights map[string]*flight
}

func (g *flightGroup) Do(ctx context.Context, key string, work func() error) error

type progressReader struct {
reader io.Reader
label string
bytes, lastBytes int64
lastReport time.Time
}

func (r *progressReader) Read(p []byte) (int, error)

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 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"`
}
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/releaseidentity"

var releasePattern = regexp.MustCompile(`^[0-9a-f]{40}$`)

func SyncHarnessImages(app core.App, catalogPath, release string) error

type Catalog struct {
SchemaVersion int `json:"schemaVersion"`
DefaultHarness string `json:"defaultHarness"`
Harnesses []Harness `json:"harnesses"`
}

func LoadCatalog(path string) (Catalog, error)

type Harness struct {
ID string `json:"id"`
ComposeService string `json:"composeService"`
ImageRepository string `json:"imageRepository"`
UpstreamVersion string `json:"upstreamVersion"`
}
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.

var notifyRunFinished = hooks.NotifyRunFinished

var notifyRunStarted = hooks.NotifyRunStarted

func JobID(id string) string

func Register(runner *Runner, row *core.Record)

type Runner struct {
App core.App
Coord func() coordinator.AgentRuntime
OllamaBaseURL string
Now func() time.Time
}

func (r *Runner) Run(ctx context.Context, ownerID string) error

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 (r *Runner) now() time.Time
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/sessionprofile"

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"

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.Mutex

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)

SessionForChat resolves an existing ACP session for a chat owned by userID.

func credentialHash(providerID, credential string) string

func defaultPermissionModeID(app core.App, userID string) string

An 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(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(instanceID string) *sync.Mutex

func markCredentialSynced(app core.App, instanceID string, syncedCredentials map[string]string) error

markCredentialSynced 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(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(harness *core.Record) bool

func validateWorkspacePath(p string) error

validateWorkspacePath validates that a path is within the workspace root.

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

warmOpencodeModelCache 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(ctx context.Context, client *dockerapi.Client, image, authVolume, providerID, credential string) error

type CredentialSyncer interface {
Sync(ctx context.Context, app core.App, instance *core.Record, providerRec *core.Record, credential string) error
}

func selectCredentialSyncer(harness *core.Record) CredentialSyncer

type NoopCredentialSyncer struct{}

func (NoopCredentialSyncer) Sync(context.Context, core.App, *core.Record, *core.Record, string) error

type OpencodeAuthFileSyncer struct{}

func (OpencodeAuthFileSyncer) Sync(ctx context.Context, app core.App, instance *core.Record, providerRec *core.Record, credential string) error

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)

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 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(ctx context.Context, cfg DialConfig, client acpsdk.Client) (Conn, error)

type DialConfig struct{ URL, Secret string }

type sdkConn struct {
*acpsdk.ClientSideConnection
stream *wsStream
}

func (c *sdkConn) Close() error

type wsStream struct {
ctx context.Context
conn *websocket.Conn
rbuf bytes.Buffer
wmu sync.Mutex
wbuf bytes.Buffer
}

func dialWS(ctx context.Context, rawURL, secret string) (*wsStream, error)

func (w *wsStream) Close() error

func (w *wsStream) Read(p []byte) (int, error)

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.

“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(id, message, mode string, schema any, url string) map[string]any

ElicitationPayload 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(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) map[string]any

PermissionPayload 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(cmds []acpsdk.AvailableCommand) []map[string]any

commands projects an ACP available-commands slice into the AG-UI client’s expected shape (name + description).

func configOptions(opts []acpsdk.SessionConfigOption) []map[string]any

configOptions 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(messageID string, m MediaDescriptor) events.Event

customContent 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(toolCallID string, d ToolDiff) events.Event

customDiff emits `pocketcoder:diff` for a single tool-call diff hunk.

func customTerminal(toolCallID string, term ToolTerminal) events.Event

customTerminal emits `pocketcoder:terminal` to attach a terminal handle to a tool call so the UI can stream its output.

func customTool(id, title, kind, status string, locations []acpsdk.ToolCallLocation) events.Event

customTool emits `pocketcoder:tool` carrying identifier, title, kind, status, and follow-along file locations. Mirrors ACP’s startTool/updateTool arms.

func customToolContent(toolCallID string, m MediaDescriptor) events.Event

customToolContent 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(s *string) string

func isTerminalToolStatus(status string) bool

func planEntries(entries []acpsdk.PlanEntry) []map[string]any

planEntries 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(kind string, _ any) events.Event

rawEvent 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(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(opts acpsdk.SessionConfigSelectOptions) []map[string]any

selectOptions 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(modes []acpsdk.SessionMode) []map[string]any

sessionModes 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.

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(threadID, runID string) *Bridge

NewBridge starts an AG-UI run for one PocketCoder chat / Goose session pair.

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

ElicitationPending 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 (b *Bridge) Finished(stopReason acpsdk.StopReason) []events.Event

Finished closes all lifecycle events. Call this only after the correlated session/prompt response, never by guessing from the final text chunk.

func (b *Bridge) PermissionPending(requestID string, options []acpsdk.PermissionOption, toolCallID string, title *string, kind *acpsdk.ToolKind) events.Event

func (b *Bridge) ReplayStarted() events.Event

ReplayStarted 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 (b *Bridge) ResolveElicitation(id string) []events.Event

ResolveElicitation clears a pending elicitation from the projection. Same id-symmetry rationale as ResolvePermission.

func (b *Bridge) ResolvePermission(id string) []events.Event

ResolvePermission 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 (b *Bridge) SeedSession(modes *acpsdk.SessionModeState, config []acpsdk.SessionConfigOption) []events.Event

SeedSession 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 (b *Bridge) Snapshot() []events.Event

Snapshot 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 (b *Bridge) Started() events.Event

Started emits the first AG-UI event for a turn.

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 (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

endTool 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 (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

messageChunk 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 (b *Bridge) planUpdate(u *acpsdk.SessionPlanUpdate) []events.Event

planUpdate 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 (b *Bridge) startTool(tc *acpsdk.SessionUpdateToolCall) []events.Event

startTool 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 (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 (b *Bridge) updateTool(u *acpsdk.SessionToolCallUpdate) []events.Event

updateTool 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.

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(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.

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"`
}

ToolTerminal carries the terminal-id pointer for tools that return one.

type ToolTerminal struct {
TerminalID string `json:"terminalId"`
Type string `json:"type,omitempty"`
}

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 (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 (p *projection) remove(ns string) events.Event

remove 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 (p *projection) set(ns string, value any) events.Event

set 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 (p *projection) setSub(ns, key string, value any) events.Event

setSub 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 (p *projection) snapshot() []events.Event

snapshot 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 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
}
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.

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"

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() time.Duration

DefaultPermissionTimeout reads POCKETCODER_PERMISSION_TIMEOUT once, falling back to 5 minutes for an empty or invalid value.

func DefaultWorkspace() string

DefaultWorkspace reads POCKETCODER_WORKSPACE once, falling back to “/workspace”.

func actionRank(action ToolPermissionAction) int

func apiKeyInvalidMessage(harnessName string) string

apiKeyInvalidMessage 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(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)

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() acpsdk.InitializeRequest

func isConnDone(conn acp.Conn) bool

isConnDone 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(err error, mode acpsdk.SessionModeId) bool

Data.mode is checked before the message text, which can drift.

func isModelNotFoundError(err error, model string) bool

Data.modelId is checked before the message text, which can drift.

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

providerApiKeyFailure 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(accountLogin bool, err error) bool

providerAuthFailure 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(accountLogin bool, harnessName, fallback string, err error) events.Event

func reauthRequiredMessage(harnessName string) string

reauthRequiredMessage 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(ctx context.Context, conn acp.Conn, providerIDString, fieldName, fieldValue string) error

registerProviderCredential 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(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

setGooseDefaultProvider 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(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() error

func wildcardMatch(pattern, value string) bool

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 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 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(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()

evictNow forces the lingering run to be evicted immediately. Test-only.

func (h *ChatHub) nextSeq() int

nextSeq 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 (h *ChatHub) nextSeqLocked() int

nextSeqLocked allocates the next seq; caller must hold h.mu.

func (h *ChatHub) seqForTest(to int)

seqForTest advances the chat-global seq without buffering, simulating events evicted with a prior run. Test-only.

func (h *ChatHub) unsubscribe(s *subscriber)

type Clock interface {
Now() time.Time
AfterFunc(d time.Duration, f func()) Timer
}

func RealClock() Clock

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 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(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

Cancel 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 (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 (c *Coordinator) DeleteSession(ctx context.Context, app core.App, chatID string) error

func (c *Coordinator) DenyPermission(chatID, requestID string) error

DenyPermission 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 (c *Coordinator) NextSeq(chatID string) int

NextSeq 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 (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 (c *Coordinator) Reserve(chatID string) error

func (c *Coordinator) ResolveElicitation(chatID, id string, resp acpsdk.UnstableCreateElicitationResponse) error

ResolveElicitation delivers the user’s response to a pending elicitation (identified by id, scoped to chatID) so the blocked sessionClient.UnstableCreateElicitation call can return.

func (c *Coordinator) SetConfigOption(ctx context.Context, chatID string, req acpsdk.SetSessionConfigOptionRequest) error

SetConfigOption 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 (c *Coordinator) SetMode(ctx context.Context, chatID, modeID string) error

SetMode dispatches session/set_mode to the active run’s connection.

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 (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 (c *Coordinator) StreamColdReplay(ctx context.Context, chatID, sessionID string, profileFn ProfileFunc, emit func(seq int, ev events.Event) error) error

StreamColdReplay 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 (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)

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 (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)

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 (c *Coordinator) stopTimers(h *runHandle)

func (c *Coordinator) trackTimer(chatID, runID string, t Timer)

type DialFunc func(context.Context, acpsdk.Client, Target) (acp.Conn, error)

type Emit func(events.Event) error

GlobalConfigApplier delivers only what ACP allows post-create today: the session mode. Permission enforcement remains in RequestPermission below.

type GlobalConfigApplier struct{}

func (GlobalConfigApplier) Apply(ctx context.Context, conn acp.Conn, sessionID string, p SessionProfile, modes *acpsdk.SessionModeState) ([]acpsdk.SessionConfigOption, error)

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(ctx context.Context, conn acp.Conn, p SessionProfile) error

type OnRunFinished func(context.Context, acpsdk.StopReason) error

type OnSessionCreated func(context.Context, string) error

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(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.

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(profile SessionProfile) ProfileApplier

selectApplier 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.

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)

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(profile SessionProfile) ProviderBootstrap

selectProviderBootstrap 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 func(context.Context) (string, error)

type RunOption func(*runOptions)

func WithOnRunEnded(fn func(context.Context, string, RunOutcome)) RunOption

func WithUserMessageID(id string) RunOption

WithUserMessageID 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(id *string) RunOption

WithUserMessageIDOpt 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 string

const (
RunCompleted RunOutcome = "completed"
RunFailed RunOutcome = "failed"
RunCancelled RunOutcome = "cancelled"
)

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 (p SessionProfile) PermissionDecision(tool string, values ...string) ToolPermissionAction

PermissionDecision 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() []string

additionalDirectories returns the profile’s extra directories as a non-nil slice, for the same Goose-contract reason as mcpServers.

func (p SessionProfile) mcpServers() []acpsdk.McpServer

mcpServers 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 (p SessionProfile) sessionMeta() map[string]any

sessionMeta 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.

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(context.Context, acp.Conn, SessionProfile) error

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 interface{ Stop() bool }

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 string

const (
ToolPermissionAllow ToolPermissionAction = "allow"
ToolPermissionAsk ToolPermissionAction = "ask"
ToolPermissionDeny ToolPermissionAction = "deny"
)

type ToolPermissionRule struct {
Tool string
Pattern string
Action ToolPermissionAction
}

type defaultsSaveRequest struct {
ProviderID string `json:"providerId"`
ModelID string `json:"modelId,omitempty"`
}

type defaultsSaveResponse struct {
ProviderID string `json:"providerId"`
ModelID string `json:"modelId"`
}

type elicitationDecision struct {
resp acpsdk.UnstableCreateElicitationResponse
cancelled bool
}

fakeClock is a deterministic clock for tests. Advance drives all timers.

type fakeClock struct {
mu sync.Mutex
now time.Time
timers []*fakeTimer
}

func NewFakeClock(t time.Time) *fakeClock

func (c *fakeClock) Advance(d time.Duration)

Advance moves time forward and fires every timer whose deadline has passed.

func (c *fakeClock) AfterFunc(d time.Duration, f func()) Timer

func (c *fakeClock) Now() time.Time

type fakeTimer struct {
clk *fakeClock
deadline time.Time
fn func()
done bool
}

func (t *fakeTimer) Stop() bool

type idempotencySlot struct {
key string
result any
}

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 struct {
chatID, sessionID string
options map[string]struct{}
decision chan permissionDecision
timer *time.Timer
}

type permissionDecision struct {
option string
cancelled bool
}

type providerConfigFieldUpdate struct {
Key string `json:"key"`
Value string `json:"value"`
}

type providerConfigSaveRequest struct {
ProviderID string `json:"providerId"`
Fields []providerConfigFieldUpdate `json:"fields"`
}

type providerConfigSaveResponse struct {
Status providerConfigStatus `json:"status"`
}

type providerConfigStatus struct {
ProviderID string `json:"providerId"`
IsConfigured bool `json:"isConfigured"`
}

type providerInventoryEntry struct {
ProviderID string `json:"providerId"`
DefaultModel string `json:"defaultModel"`
}

type providersListRequest struct {
ProviderIDs []string `json:"providerIds"`
}

type providersListResponse struct {
Entries []providerInventoryEntry `json:"entries"`
}

realClock delegates to the stdlib.

type realClock struct{}

func (realClock) AfterFunc(d time.Duration, f func()) Timer

func (realClock) Now() time.Time

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 struct {
runID, sessionID string
cancel context.CancelFunc
conn acp.Conn
accepting *atomic.Bool
events atomic.Int64
timers []Timer
teardown func(release bool)
}

type runOptions struct {
onRunEnded func(context.Context, string, RunOutcome)
userMessageID string
}

type seqEvent struct {
Seq int
Ev events.Event
}

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 (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 (*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 (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 (*sessionClient) removePendingElicitation

Section titled “func (*sessionClient) removePendingElicitation”
func (s *sessionClient) removePendingElicitation(id string, expected *pendingElicitation)

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 struct {
live chan seqEvent
cursor int
}
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

Capabilities are advertised only because every handler below reaches the sandbox API and each requested path is restricted to Workspace.

type Config struct {
URL string
Workspace string
Client *http.Client
}

type Sandbox struct {
baseURL, workspace string
client *http.Client
}

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
import "github.com/qtpi-bonding-org/pocketcoder/backend/internal/agent/pocoprompt"

var Default string

Generated by gomarkdoc