client

package
v0.54.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Package client holds Peen's generated HTTP API client.

It is generated from the same `api/api.yml` document the server is generated from, so a caller and the service cannot drift: a change to the contract regenerates both or neither. Use this rather than hand-rolling requests against the documented paths.

For an in-process caller, `pkg/peen` is the supported entry point and needs no HTTP at all. This package is for talking to a Peen that runs somewhere else.

Pass the server's REST base, such as "http://127.0.0.1:8080/api/v1", to NewClient. Peen mounts REST under /api/v1 and the WebSocket separately under /ws/v1; this client only talks to the former.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCancelSessionAgentRunRequest

func NewCancelSessionAgentRunRequest(server string, agentRunId AgentRunID, params *CancelSessionAgentRunParams) (*http.Request, error)

NewCancelSessionAgentRunRequest constructs an http.Request for the CancelSessionAgentRun method

func NewCancelSessionRequest

func NewCancelSessionRequest(server string, params *CancelSessionParams) (*http.Request, error)

NewCancelSessionRequest constructs an http.Request for the CancelSession method

func NewDeleteSessionLearnedFileRequest added in v0.37.0

func NewDeleteSessionLearnedFileRequest(server string, params *DeleteSessionLearnedFileParams) (*http.Request, error)

NewDeleteSessionLearnedFileRequest constructs an http.Request for the DeleteSessionLearnedFile method

func NewDeleteWorkspaceFileRequest added in v0.51.0

func NewDeleteWorkspaceFileRequest(server string, params *DeleteWorkspaceFileParams) (*http.Request, error)

NewDeleteWorkspaceFileRequest constructs an http.Request for the DeleteWorkspaceFile method

func NewGetSessionAgentRunCompactionRequest added in v0.11.0

func NewGetSessionAgentRunCompactionRequest(server string, agentRunId AgentRunID, compactionId CompactionID, params *GetSessionAgentRunCompactionParams) (*http.Request, error)

NewGetSessionAgentRunCompactionRequest constructs an http.Request for the GetSessionAgentRunCompaction method

func NewGetSessionAgentRunRequest added in v0.4.0

func NewGetSessionAgentRunRequest(server string, agentRunId AgentRunID, params *GetSessionAgentRunParams) (*http.Request, error)

NewGetSessionAgentRunRequest constructs an http.Request for the GetSessionAgentRun method

func NewGetSessionCompactionRequest added in v0.4.0

func NewGetSessionCompactionRequest(server string, compactionId CompactionID, params *GetSessionCompactionParams) (*http.Request, error)

NewGetSessionCompactionRequest constructs an http.Request for the GetSessionCompaction method

func NewGetSessionContextSnapshotRequest added in v0.4.0

func NewGetSessionContextSnapshotRequest(server string, contextHash ContextHash, params *GetSessionContextSnapshotParams) (*http.Request, error)

NewGetSessionContextSnapshotRequest constructs an http.Request for the GetSessionContextSnapshot method

func NewGetSessionLearnedFileRequest added in v0.37.0

func NewGetSessionLearnedFileRequest(server string, params *GetSessionLearnedFileParams) (*http.Request, error)

NewGetSessionLearnedFileRequest constructs an http.Request for the GetSessionLearnedFile method

func NewGetSessionMCPStatusRequest added in v0.38.0

func NewGetSessionMCPStatusRequest(server string, params *GetSessionMCPStatusParams) (*http.Request, error)

NewGetSessionMCPStatusRequest constructs an http.Request for the GetSessionMCPStatus method

func NewGetSessionPromptSnapshotRequest added in v0.4.0

func NewGetSessionPromptSnapshotRequest(server string, promptHash PromptHash, params *GetSessionPromptSnapshotParams) (*http.Request, error)

NewGetSessionPromptSnapshotRequest constructs an http.Request for the GetSessionPromptSnapshot method

func NewGetSessionRequest

func NewGetSessionRequest(server string, params *GetSessionParams) (*http.Request, error)

NewGetSessionRequest constructs an http.Request for the GetSession method

func NewListAgentSpacesRequest added in v0.19.0

func NewListAgentSpacesRequest(server string) (*http.Request, error)

NewListAgentSpacesRequest constructs an http.Request for the ListAgentSpaces method

func NewListCronJobsRequest added in v0.51.0

func NewListCronJobsRequest(server string) (*http.Request, error)

NewListCronJobsRequest constructs an http.Request for the ListCronJobs method

func NewListCronRunsRequest added in v0.51.0

func NewListCronRunsRequest(server string, params *ListCronRunsParams) (*http.Request, error)

NewListCronRunsRequest constructs an http.Request for the ListCronRuns method

func NewListMessagesRequest

func NewListMessagesRequest(server string, params *ListMessagesParams) (*http.Request, error)

NewListMessagesRequest constructs an http.Request for the ListMessages method

func NewListModelsRequest added in v0.12.0

func NewListModelsRequest(server string) (*http.Request, error)

NewListModelsRequest constructs an http.Request for the ListModels method

func NewListSessionAgentRunCompactionsRequest added in v0.11.0

func NewListSessionAgentRunCompactionsRequest(server string, agentRunId AgentRunID, params *ListSessionAgentRunCompactionsParams) (*http.Request, error)

NewListSessionAgentRunCompactionsRequest constructs an http.Request for the ListSessionAgentRunCompactions method

func NewListSessionAgentRunEventsRequest

func NewListSessionAgentRunEventsRequest(server string, agentRunId AgentRunID, params *ListSessionAgentRunEventsParams) (*http.Request, error)

NewListSessionAgentRunEventsRequest constructs an http.Request for the ListSessionAgentRunEvents method

func NewListSessionAgentRunMessagesRequest added in v0.11.0

func NewListSessionAgentRunMessagesRequest(server string, agentRunId AgentRunID, params *ListSessionAgentRunMessagesParams) (*http.Request, error)

NewListSessionAgentRunMessagesRequest constructs an http.Request for the ListSessionAgentRunMessages method

func NewListSessionAgentRunsRequest

func NewListSessionAgentRunsRequest(server string, params *ListSessionAgentRunsParams) (*http.Request, error)

NewListSessionAgentRunsRequest constructs an http.Request for the ListSessionAgentRuns method

func NewListSessionAgentSpaceDecisionsRequest added in v0.19.0

func NewListSessionAgentSpaceDecisionsRequest(server string, params *ListSessionAgentSpaceDecisionsParams) (*http.Request, error)

NewListSessionAgentSpaceDecisionsRequest constructs an http.Request for the ListSessionAgentSpaceDecisions method

func NewListSessionCompactionsRequest added in v0.4.0

func NewListSessionCompactionsRequest(server string, params *ListSessionCompactionsParams) (*http.Request, error)

NewListSessionCompactionsRequest constructs an http.Request for the ListSessionCompactions method

func NewListSessionEventsRequest

func NewListSessionEventsRequest(server string, params *ListSessionEventsParams) (*http.Request, error)

NewListSessionEventsRequest constructs an http.Request for the ListSessionEvents method

func NewListSessionFeedRequest added in v0.26.0

func NewListSessionFeedRequest(server string, params *ListSessionFeedParams) (*http.Request, error)

NewListSessionFeedRequest constructs an http.Request for the ListSessionFeed method

func NewListSessionJobSignalRequestsRequest added in v0.4.0

func NewListSessionJobSignalRequestsRequest(server string, jobId JobID, params *ListSessionJobSignalRequestsParams) (*http.Request, error)

NewListSessionJobSignalRequestsRequest constructs an http.Request for the ListSessionJobSignalRequests method

func NewListSessionJobsRequest

func NewListSessionJobsRequest(server string, params *ListSessionJobsParams) (*http.Request, error)

NewListSessionJobsRequest constructs an http.Request for the ListSessionJobs method

func NewListSessionLearnedFilesRequest added in v0.37.0

func NewListSessionLearnedFilesRequest(server string, params *ListSessionLearnedFilesParams) (*http.Request, error)

NewListSessionLearnedFilesRequest constructs an http.Request for the ListSessionLearnedFiles method

func NewListSessionModelRunCallsRequest added in v0.4.0

func NewListSessionModelRunCallsRequest(server string, modelRunId ModelRunID, params *ListSessionModelRunCallsParams) (*http.Request, error)

NewListSessionModelRunCallsRequest constructs an http.Request for the ListSessionModelRunCalls method

func NewListSessionModelRunsRequest added in v0.4.0

func NewListSessionModelRunsRequest(server string, params *ListSessionModelRunsParams) (*http.Request, error)

NewListSessionModelRunsRequest constructs an http.Request for the ListSessionModelRuns method

func NewListSessionNoticesRequest added in v0.4.0

func NewListSessionNoticesRequest(server string, params *ListSessionNoticesParams) (*http.Request, error)

NewListSessionNoticesRequest constructs an http.Request for the ListSessionNotices method

func NewListSessionTurnsRequest added in v0.4.0

func NewListSessionTurnsRequest(server string, params *ListSessionTurnsParams) (*http.Request, error)

NewListSessionTurnsRequest constructs an http.Request for the ListSessionTurns method

func NewListSessionWorkersRequest added in v0.8.0

func NewListSessionWorkersRequest(server string, params *ListSessionWorkersParams) (*http.Request, error)

NewListSessionWorkersRequest constructs an http.Request for the ListSessionWorkers method

func NewListSessionsRequest added in v0.8.0

func NewListSessionsRequest(server string, params *ListSessionsParams) (*http.Request, error)

NewListSessionsRequest constructs an http.Request for the ListSessions method

func NewListWorkspaceFilesRequest added in v0.51.0

func NewListWorkspaceFilesRequest(server string, params *ListWorkspaceFilesParams) (*http.Request, error)

NewListWorkspaceFilesRequest constructs an http.Request for the ListWorkspaceFiles method

func NewListWorkspaceRootsRequest added in v0.13.0

func NewListWorkspaceRootsRequest(server string) (*http.Request, error)

NewListWorkspaceRootsRequest constructs an http.Request for the ListWorkspaceRoots method

func NewOpenSessionRequest added in v0.8.0

func NewOpenSessionRequest(server string, body OpenSessionJSONRequestBody) (*http.Request, error)

NewOpenSessionRequest calls the generic OpenSession builder with application/json body

func NewOpenSessionRequestWithBody added in v0.8.0

func NewOpenSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewOpenSessionRequestWithBody constructs an http.Request for the OpenSession method, with any body, and a specified content type

func NewOpenSystemSessionRequest added in v0.45.0

func NewOpenSystemSessionRequest(server string) (*http.Request, error)

NewOpenSystemSessionRequest constructs an http.Request for the OpenSystemSession method

func NewPublishSessionNoticeRequest added in v0.4.0

func NewPublishSessionNoticeRequest(server string, params *PublishSessionNoticeParams, body PublishSessionNoticeJSONRequestBody) (*http.Request, error)

NewPublishSessionNoticeRequest calls the generic PublishSessionNotice builder with application/json body

func NewPublishSessionNoticeRequestWithBody added in v0.4.0

func NewPublishSessionNoticeRequestWithBody(server string, params *PublishSessionNoticeParams, contentType string, body io.Reader) (*http.Request, error)

NewPublishSessionNoticeRequestWithBody constructs an http.Request for the PublishSessionNotice method, with any body, and a specified content type

func NewReadSessionJobOutputRequest

func NewReadSessionJobOutputRequest(server string, jobId JobID, params *ReadSessionJobOutputParams) (*http.Request, error)

NewReadSessionJobOutputRequest constructs an http.Request for the ReadSessionJobOutput method

func NewReadWorkspaceFileRequest added in v0.51.0

func NewReadWorkspaceFileRequest(server string, params *ReadWorkspaceFileParams) (*http.Request, error)

NewReadWorkspaceFileRequest constructs an http.Request for the ReadWorkspaceFile method

func NewReconfigureSessionRequest added in v0.8.0

func NewReconfigureSessionRequest(server string, params *ReconfigureSessionParams, body ReconfigureSessionJSONRequestBody) (*http.Request, error)

NewReconfigureSessionRequest calls the generic ReconfigureSession builder with application/json body

func NewReconfigureSessionRequestWithBody added in v0.8.0

func NewReconfigureSessionRequestWithBody(server string, params *ReconfigureSessionParams, contentType string, body io.Reader) (*http.Request, error)

NewReconfigureSessionRequestWithBody constructs an http.Request for the ReconfigureSession method, with any body, and a specified content type

func NewSignalSessionJobRequest

func NewSignalSessionJobRequest(server string, jobId JobID, params *SignalSessionJobParams, body SignalSessionJobJSONRequestBody) (*http.Request, error)

NewSignalSessionJobRequest calls the generic SignalSessionJob builder with application/json body

func NewSignalSessionJobRequestWithBody

func NewSignalSessionJobRequestWithBody(server string, jobId JobID, params *SignalSessionJobParams, contentType string, body io.Reader) (*http.Request, error)

NewSignalSessionJobRequestWithBody constructs an http.Request for the SignalSessionJob method, with any body, and a specified content type

func NewWriteWorkspaceFileRequest added in v0.51.0

func NewWriteWorkspaceFileRequest(server string, params *WriteWorkspaceFileParams, body WriteWorkspaceFileJSONRequestBody) (*http.Request, error)

NewWriteWorkspaceFileRequest calls the generic WriteWorkspaceFile builder with application/json body

func NewWriteWorkspaceFileRequestWithBody added in v0.51.0

func NewWriteWorkspaceFileRequestWithBody(server string, params *WriteWorkspaceFileParams, contentType string, body io.Reader) (*http.Request, error)

NewWriteWorkspaceFileRequestWithBody constructs an http.Request for the WriteWorkspaceFile method, with any body, and a specified content type

Types

type AgentRun

type AgentRun struct {
	// AgentRunId The run's ID. Agents and clients use it to address the child, for example as the `to` of a message.
	AgentRunId openapi_types.UUID `json:"agentRunId"`

	// AllowedTools The tool names the agent definition limits the child to. An empty array means the child may use every tool.
	AllowedTools []interface{} `json:"allowedTools"`

	// CancelRequested True once a cancellation was requested for the run, through `POST /session/agents/{agentRunId}/cancel`, the `stopAgent` tool, or the control surface.
	CancelRequested bool `json:"cancelRequested"`

	// CompletionTokenCount The completion tokens the provider reported for the run. 0 until the run ends.
	CompletionTokenCount int64 `json:"completionTokenCount"`

	// Definition Where the child's instructions came from.
	//
	// - `stored`: an agent file under `.agents/agents/` in a harness layer, or a core agent.
	// - `ad-hoc`: a one-off definition the launching agent passed inline to `launchAgent`, which is never written to disk.
	Definition AgentRunDefinition `json:"definition"`

	// Depth How deep the run sits below the root conversation. A child of the root has depth 1, its children depth 2, and so on, up to the deployment's maximum child agent depth.
	Depth int64 `json:"depth"`

	// EndedAt When the run ended, in RFC 3339 format. Absent while it is `running`.
	EndedAt *time.Time `json:"endedAt,omitempty"`

	// EventCount How many events the run has stored, which is also the `sequence` of its latest event.
	EventCount int64 `json:"eventCount"`

	// FailureClassification Why the run did not complete: `agentRun` when it failed, `cancelled` when it was stopped, or `interrupted` when a restart cut it off. Empty for a run that is running or completed.
	FailureClassification string `json:"failureClassification"`

	// FailureDetail The error text for a failed, cancelled, or interrupted run. Empty otherwise.
	FailureDetail string `json:"failureDetail"`

	// FinishReason The finish reason the provider reported for the final model response, such as `stop`. Empty until the run ends.
	FinishReason string `json:"finishReason"`

	// Instructions The child's agent instructions: the body of the stored agent file, or the inline definition's instructions.
	Instructions string `json:"instructions"`

	// Model The provider's model ID for `modelReference`.
	Model string `json:"model"`

	// ModelReference The qualified model reference the child runs on, in `provider/model` form. A child always uses the model of the turn that launched it.
	ModelReference string `json:"modelReference"`

	// Name The agent's name: the stored agent's name, or the name given in an inline definition.
	Name string `json:"name"`

	// ParentAgentRunId The agent run that launched this child. Absent when the session's root conversation launched it.
	ParentAgentRunId *openapi_types.UUID `json:"parentAgentRunId,omitempty"`

	// ParentToolCallId The ID of the `launchAgent` tool call that started this run. Absent when none was recorded.
	ParentToolCallId *string `json:"parentToolCallId,omitempty"`

	// ParentTurnId The session turn during which the run was launched. A child can keep running after that turn ends.
	ParentTurnId openapi_types.UUID `json:"parentTurnId"`

	// Paused True while the run is `running` but its work is paused by a Stop, a crash, or a failure. A message to the run resumes it. Absent when the run is not paused.
	Paused *bool `json:"paused,omitempty"`

	// PromptTokenCount The prompt tokens the provider reported for the run. 0 until the run ends.
	PromptTokenCount int64 `json:"promptTokenCount"`

	// Question The question a waiting run asked. Absent when `waiting` is false.
	Question *string `json:"question,omitempty"`

	// RequestId The request ID of the turn that launched the run.
	RequestId openapi_types.UUID `json:"requestId"`

	// ResponseMessages The model messages recorded when the run ended. An empty array until then.
	ResponseMessages []interface{} `json:"responseMessages"`

	// ResponseText The child's whole final answer. Empty until the run ends, and empty when it did not complete.
	ResponseText string `json:"responseText"`

	// ResponseThinking The reasoning text the model returned with the final answer, when the provider reports it. Empty otherwise.
	ResponseThinking string `json:"responseThinking"`

	// SessionId The session the run belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// StartedAt When the run started, in RFC 3339 format.
	StartedAt time.Time `json:"startedAt"`

	// State The stored state of the run.
	//
	// - `running`: the child is working, waiting on a question, or paused.
	// - `completed`: it gave its final answer.
	// - `failed`: it ended with an error.
	// - `cancelled`: it was stopped.
	// - `interrupted`: the controller restarted while the run was still marked running; the run stays readable and can be resumed, which returns it to `running`.
	State AgentRunState `json:"state"`

	// SystemPrompt The full system prompt the child runs with. It is updated when a `changeDirectory` call resolves a new harness.
	SystemPrompt string `json:"systemPrompt"`

	// Task The task text the launching agent gave the child.
	Task string `json:"task"`

	// Waiting True while the run is `running` and waits for an answer to a question it asked with the `ask` tool. Computed when you read the run, from its `agent.run.question` and `agent.run.answer` events.
	Waiting bool `json:"waiting"`

	// WorkerGenerationId The worker generation currently running this child, or the last one that ran it. Absent when none was recorded.
	WorkerGenerationId *string `json:"workerGenerationId,omitempty"`

	// Workspace The child's current directory, updated each time it changes directory with `changeDirectory`. It starts as the launching agent's current directory.
	Workspace string `json:"workspace"`
}

AgentRun One child agent run: a separate agent conversation that an agent in the session started with the `launchAgent` tool. The record is written before the child does any work and is updated as it runs and when it ends. Returned by `GET /session/agents` and `GET /session/agents/{agentRunId}`.

type AgentRunCancelResponse

type AgentRunCancelResponse struct {
	// AgentRunId The run the request named.
	AgentRunId openapi_types.UUID `json:"agentRunId"`

	// CancelRequested True when this request recorded the cancellation of a `running` or `interrupted` run. False when the run had already ended or a cancellation was already recorded; that is not an error, and `state` reports the current state. An unknown run returns `404` instead.
	CancelRequested bool `json:"cancelRequested"`

	// State The run's state after the request, with the same values as `AgentRun.state`. `cancelled` when the cancellation took effect at once. `running` while the worker is still stopping the child; follow its events or read the run to see it end.
	State AgentRunCancelResponseState `json:"state"`
}

AgentRunCancelResponse The outcome of a cancellation request for one child agent run. Returned by `POST /session/agents/{agentRunId}/cancel`.

type AgentRunCancelResponseState

type AgentRunCancelResponseState string

AgentRunCancelResponseState The run's state after the request, with the same values as `AgentRun.state`. `cancelled` when the cancellation took effect at once. `running` while the worker is still stopping the child; follow its events or read the run to see it end.

const (
	AgentRunCancelResponseStateCancelled   AgentRunCancelResponseState = "cancelled"
	AgentRunCancelResponseStateCompleted   AgentRunCancelResponseState = "completed"
	AgentRunCancelResponseStateFailed      AgentRunCancelResponseState = "failed"
	AgentRunCancelResponseStateInterrupted AgentRunCancelResponseState = "interrupted"
	AgentRunCancelResponseStateRunning     AgentRunCancelResponseState = "running"
)

Defines values for AgentRunCancelResponseState.

func (AgentRunCancelResponseState) Valid

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

type AgentRunCompaction added in v0.11.0

type AgentRunCompaction struct {
	// AgentRunId The child agent run whose transcript the compaction summarizes.
	AgentRunId openapi_types.UUID `json:"agentRunId"`

	// CreatedAt When the compaction was stored, in RFC 3339 format.
	CreatedAt time.Time `json:"createdAt"`

	// DirectFromSequence The `sequence` of the first raw message this compaction covered itself.
	DirectFromSequence int64 `json:"directFromSequence"`

	// DirectToSequence The `sequence` of the last raw message this compaction covered itself.
	DirectToSequence int64 `json:"directToSequence"`

	// FromMessageId The first child message of the whole lineage this summary covers, including what earlier summaries covered.
	FromMessageId openapi_types.UUID `json:"fromMessageId"`

	// FromSequence The `sequence` of the first message of the whole covered lineage.
	FromSequence int64 `json:"fromSequence"`

	// Id The compaction's ID.
	Id openapi_types.UUID `json:"id"`

	// InputTokenCount The prompt tokens the provider reported for the summarizing call.
	InputTokenCount int64 `json:"inputTokenCount"`

	// Model The model ID that wrote the summary.
	Model string `json:"model"`

	// ParentCompactionId The earlier compaction this one supersedes. Absent for the first compaction in the chain.
	ParentCompactionId *openapi_types.UUID `json:"parentCompactionId,omitempty"`

	// PromptHash The hex SHA-256 of the compaction instructions that produced the summary, so you can tell which instructions were used after the file changes.
	PromptHash string `json:"promptHash"`

	// SessionId The session the run belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// SourceMessageCount How many messages the summary covers, including those its predecessors covered.
	SourceMessageCount int64 `json:"sourceMessageCount"`

	// Summary The summary text that replaces the covered messages in the child's context.
	Summary string `json:"summary"`

	// SummaryTokenCount The completion tokens the provider reported for the summary.
	SummaryTokenCount int64 `json:"summaryTokenCount"`

	// ToMessageId The last child message this summary covers.
	ToMessageId openapi_types.UUID `json:"toMessageId"`

	// ToSequence The `sequence` of the last covered message. Messages after it stay raw.
	ToSequence int64 `json:"toSequence"`
}

AgentRunCompaction One immutable summary covering a completed prefix of one child agent run's transcript. `directFromSequence` and `directToSequence` name only the messages this row covered itself; `fromSequence` and `toSequence` span the whole superseded lineage. Returned by the child compaction endpoints.

type AgentRunCompactionPage added in v0.11.0

type AgentRunCompactionPage struct {
	// Compactions The compaction records on this page, newest first.
	Compactions []AgentRunCompaction `json:"compactions"`

	// HasMore True when more records follow this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of records skipped before this page.
	Offset int32 `json:"offset"`
}

AgentRunCompactionPage One page of a child agent run's compaction records, newest first. Returned by `GET /session/agents/{agentRunId}/compactions`.

type AgentRunDefinition

type AgentRunDefinition string

AgentRunDefinition Where the child's instructions came from.

- `stored`: an agent file under `.agents/agents/` in a harness layer, or a core agent. - `ad-hoc`: a one-off definition the launching agent passed inline to `launchAgent`, which is never written to disk.

const (
	AgentRunDefinitionAdHoc  AgentRunDefinition = "ad-hoc"
	AgentRunDefinitionStored AgentRunDefinition = "stored"
)

Defines values for AgentRunDefinition.

func (AgentRunDefinition) Valid

func (e AgentRunDefinition) Valid() bool

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

type AgentRunEvent

type AgentRunEvent struct {
	// CreatedAt When the event was recorded, in RFC 3339 format.
	CreatedAt time.Time `json:"createdAt"`

	// Payload Child step data. Queued, delivered and undelivered message events carry `message` and an optional `acceptanceId` UUID linking the same accepted message. Question and answer events carry an optional `callId` linking the `ask` tool call. Older stored events omit these IDs. Absent when the event has no data.
	Payload *map[string]interface{} `json:"payload,omitempty"`

	// Sequence The event's position in this run's own event stream, starting at 1. It is separate from the session feed sequence.
	Sequence int64 `json:"sequence"`

	// Type The event type: `agent.run.started`, `agent.run.text.delta`, `agent.run.thinking.delta`, `agent.run.tool.use`, `agent.run.tool.result`, `agent.run.assistant.message`, `agent.run.message.injected`, `agent.run.message.queued`, `agent.run.message.delivered`, `agent.run.message.undelivered`, `agent.run.question`, `agent.run.answer`, `agent.run.provider.retry`, or one of the terminal types `agent.run.completed`, `agent.run.failed`, and `agent.run.cancelled`.
	Type string `json:"type"`
}

AgentRunEvent One stored step of a child agent run, such as `agent.run.text.delta` or `agent.run.tool.use`. The same step reaches connected WebSocket clients live as an `agent.run.*` frame.

type AgentRunEventPage

type AgentRunEventPage struct {
	// AgentRunId The run the events belong to.
	AgentRunId openapi_types.UUID `json:"agentRunId"`

	// Events The events on this page, oldest first.
	Events []AgentRunEvent `json:"events"`

	// HasMore True when more events already exist after this page. False does not mean the run has ended; check `state`.
	HasMore bool `json:"hasMore"`

	// NextCursor Pass this back as `cursor` to continue after this page. It is the `sequence` of the last event returned, or the `cursor` you sent when the page is empty.
	NextCursor int64 `json:"nextCursor"`

	// State The run's stored state when the page was read, with the same values as `AgentRun.state`. A run waiting on a question reports `running`.
	State AgentRunEventPageState `json:"state"`
}

AgentRunEventPage One page of a child agent run's events in ascending `sequence` order, with a cursor to continue from. Returned by `GET /session/agents/{agentRunId}/events`.

type AgentRunEventPageState

type AgentRunEventPageState string

AgentRunEventPageState The run's stored state when the page was read, with the same values as `AgentRun.state`. A run waiting on a question reports `running`.

const (
	AgentRunEventPageStateCancelled   AgentRunEventPageState = "cancelled"
	AgentRunEventPageStateCompleted   AgentRunEventPageState = "completed"
	AgentRunEventPageStateFailed      AgentRunEventPageState = "failed"
	AgentRunEventPageStateInterrupted AgentRunEventPageState = "interrupted"
	AgentRunEventPageStateRunning     AgentRunEventPageState = "running"
)

Defines values for AgentRunEventPageState.

func (AgentRunEventPageState) Valid

func (e AgentRunEventPageState) Valid() bool

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

type AgentRunID

type AgentRunID = openapi_types.UUID

AgentRunID defines model for AgentRunID.

type AgentRunMessage added in v0.11.0

type AgentRunMessage struct {
	// AgentRunId The child agent run whose transcript holds the message.
	AgentRunId openapi_types.UUID `json:"agentRunId"`

	// CompactionId The child compaction that directly covered this message. Absent while the message is still raw.
	CompactionId *openapi_types.UUID `json:"compactionId,omitempty"`

	// Content The message text. For a received message, a `<message>` block that names the sender.
	Content string `json:"content"`

	// CreatedAt When the message was stored, in RFC 3339 format.
	CreatedAt time.Time `json:"createdAt"`

	// Id The message's ID.
	Id openapi_types.UUID `json:"id"`

	// Images The images the message carries, without their bytes, such as an image the child's readFile read. Absent when it has none.
	Images *[]MessageImageInfo `json:"images,omitempty"`

	// Incomplete True when the run was interrupted by a restart before it finished. Peen clears the flag when the run resumes.
	Incomplete bool `json:"incomplete"`

	// IsError True when a tool result reports an error.
	IsError bool `json:"isError"`

	// Model The qualified model reference that produced an assistant message, in `provider/model` form. Absent on other messages.
	Model *string `json:"model,omitempty"`

	// Role Who the message is from.
	//
	// - `user`: the task, or a message the child received from another agent, from you, or an injected image.
	// - `assistant`: a model reply.
	// - `tool`: a tool result.
	Role AgentRunMessageRole `json:"role"`

	// Sequence The message's position in the child's transcript, starting at 1.
	Sequence int64 `json:"sequence"`

	// SessionId The session the run belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// Thinking The reasoning text the model returned with an assistant message. Absent when there is none.
	Thinking *string `json:"thinking,omitempty"`

	// ToolCallId The ID of the tool call a `tool` message answers. Absent on other messages.
	ToolCallId *string `json:"toolCallId,omitempty"`

	// ToolCalls The tool calls an assistant message made, in the same shape as a session message's `toolCalls`. An empty array when it made none.
	ToolCalls *[]MessageToolCall `json:"toolCalls,omitempty"`
}

AgentRunMessage One prompt-visible record in a child agent run's own transcript. It carries no turn: a child belongs to its agent run, not to a session turn's message sequence. Returned by `GET /session/agents/{agentRunId}/messages`.

type AgentRunMessagePage added in v0.11.0

type AgentRunMessagePage struct {
	// HasMore True when more messages follow this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Messages The messages on this page, in `sequence` order.
	Messages []AgentRunMessage `json:"messages"`

	// Offset The number of messages skipped before this page.
	Offset int32 `json:"offset"`
}

AgentRunMessagePage One page of a child agent run's transcript, oldest first. Returned by `GET /session/agents/{agentRunId}/messages`.

type AgentRunMessageRole added in v0.11.0

type AgentRunMessageRole string

AgentRunMessageRole Who the message is from.

- `user`: the task, or a message the child received from another agent, from you, or an injected image. - `assistant`: a model reply. - `tool`: a tool result.

const (
	AgentRunMessageRoleAssistant AgentRunMessageRole = "assistant"
	AgentRunMessageRoleTool      AgentRunMessageRole = "tool"
	AgentRunMessageRoleUser      AgentRunMessageRole = "user"
)

Defines values for AgentRunMessageRole.

func (AgentRunMessageRole) Valid added in v0.11.0

func (e AgentRunMessageRole) Valid() bool

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

type AgentRunPage

type AgentRunPage struct {
	// Agents The runs on this page, newest first.
	Agents []AgentRun `json:"agents"`

	// HasMore True when more runs follow this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of runs skipped before this page.
	Offset int32 `json:"offset"`
}

AgentRunPage One page of a session's child agent runs, newest first. Returned by `GET /session/agents`.

type AgentRunState

type AgentRunState string

AgentRunState The stored state of the run.

- `running`: the child is working, waiting on a question, or paused. - `completed`: it gave its final answer. - `failed`: it ended with an error. - `cancelled`: it was stopped. - `interrupted`: the controller restarted while the run was still marked running; the run stays readable and can be resumed, which returns it to `running`.

const (
	AgentRunStateCancelled   AgentRunState = "cancelled"
	AgentRunStateCompleted   AgentRunState = "completed"
	AgentRunStateFailed      AgentRunState = "failed"
	AgentRunStateInterrupted AgentRunState = "interrupted"
	AgentRunStateRunning     AgentRunState = "running"
)

Defines values for AgentRunState.

func (AgentRunState) Valid

func (e AgentRunState) Valid() bool

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

type AgentSpace added in v0.19.0

type AgentSpace struct {
	// CapabilityWarnings One operator-facing sentence for each risky grant this space makes (`docker: full`, `docker: readonly`, `network: host`, `sudo: true`). Empty for a space that grants nothing risky.
	CapabilityWarnings []string `json:"capabilityWarnings"`

	// Docker How much of the host Docker daemon the space reaches. Set only for kind `docker`.
	//
	// - `none`: no access.
	// - `readonly`: the worker gets a controller-run proxy that answers only read requests (list and inspect containers, images, networks, and volumes, and watch events), with environment values redacted from inspect output.
	// - `full`: the controller's Docker socket is mounted, which is host root.
	Docker *AgentSpaceDocker `json:"docker,omitempty"`

	// HostRootEquivalent True when this space grants access that is effectively host root, which is `docker: full`.
	HostRootEquivalent bool `json:"hostRootEquivalent"`

	// Kind Where the agent runs.
	//
	// - `control`: where the controller runs. Offered only when the controller cannot reach a Docker daemon.
	// - `docker`: in its own container, shaped by a Docker profile.
	Kind AgentSpaceKind `json:"kind"`

	// Name What a client names to pick this agent space: `control` or `docker:<profile>`.
	Name string `json:"name"`

	// Network The network the worker container gets. Set only for kind `docker`.
	//
	// - `none`: no network.
	// - `bridge`: Docker's default bridge network.
	// - `host`: the host's network, so the worker can reach every service the host can.
	Network *AgentSpaceNetwork `json:"network,omitempty"`

	// Profile The Docker profile behind the space, the part of `name` after `docker:`. Set only for kind `docker`.
	Profile *string `json:"profile,omitempty"`

	// Revision The revision the operator gave this Docker profile in its configuration, `0` when unset and for `control`. Each worker generation records the revision it started under, so a durable record says which definition ran.
	Revision int64 `json:"revision"`

	// Sudo True when the agent may run commands as root inside the worker container. Set only for kind `docker`.
	Sudo *bool `json:"sudo,omitempty"`
}

AgentSpace One place a session's agent can run, as listed by `GET /agent-spaces`. Every field comes from deployment configuration; a client only names the space.

type AgentSpaceDocker added in v0.19.0

type AgentSpaceDocker string

AgentSpaceDocker How much of the host Docker daemon the space reaches. Set only for kind `docker`.

- `none`: no access. - `readonly`: the worker gets a controller-run proxy that answers only read requests (list and inspect containers, images, networks, and volumes, and watch events), with environment values redacted from inspect output. - `full`: the controller's Docker socket is mounted, which is host root.

const (
	AgentSpaceDockerFull     AgentSpaceDocker = "full"
	AgentSpaceDockerNone     AgentSpaceDocker = "none"
	AgentSpaceDockerReadonly AgentSpaceDocker = "readonly"
)

Defines values for AgentSpaceDocker.

func (AgentSpaceDocker) Valid added in v0.19.0

func (e AgentSpaceDocker) Valid() bool

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

type AgentSpaceKind added in v0.19.0

type AgentSpaceKind string

AgentSpaceKind Where the agent runs.

- `control`: where the controller runs. Offered only when the controller cannot reach a Docker daemon. - `docker`: in its own container, shaped by a Docker profile.

const (
	AgentSpaceKindControl AgentSpaceKind = "control"
	AgentSpaceKindDocker  AgentSpaceKind = "docker"
)

Defines values for AgentSpaceKind.

func (AgentSpaceKind) Valid added in v0.19.0

func (e AgentSpaceKind) Valid() bool

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

type AgentSpaceList added in v0.19.0

type AgentSpaceList struct {
	// Default The agent space a workspace's first session gets when `POST /sessions/open` names none. `docker:default` when the controller can reach a Docker daemon, `control` when it cannot, unless `PEEN_DEFAULT_AGENT_SPACE` names another.
	Default string `json:"default"`

	// Items The offered agent spaces, sorted by `name`.
	Items []AgentSpace `json:"items"`
}

AgentSpaceList The response of `GET /agent-spaces`: every agent space the deployment offers, sorted by name, and the default.

type AgentSpaceNetwork added in v0.19.0

type AgentSpaceNetwork string

AgentSpaceNetwork The network the worker container gets. Set only for kind `docker`.

- `none`: no network. - `bridge`: Docker's default bridge network. - `host`: the host's network, so the worker can reach every service the host can.

const (
	AgentSpaceNetworkBridge AgentSpaceNetwork = "bridge"
	AgentSpaceNetworkHost   AgentSpaceNetwork = "host"
	AgentSpaceNetworkNone   AgentSpaceNetwork = "none"
)

Defines values for AgentSpaceNetwork.

func (AgentSpaceNetwork) Valid added in v0.19.0

func (e AgentSpaceNetwork) Valid() bool

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

type CancelResponse

type CancelResponse struct {
	// CancelRequested True when the call found something to stop: a message waiting to start a turn, a running turn, a running child agent, or an unfinished workflow. False when the session was already idle.
	CancelRequested bool `json:"cancelRequested"`
}

CancelResponse The response of `POST /session/cancel`.

type CancelSessionAgentRunParams

type CancelSessionAgentRunParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

CancelSessionAgentRunParams defines parameters for CancelSessionAgentRun.

type CancelSessionAgentRunResponse

type CancelSessionAgentRunResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *AgentRunCancelResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers202 the parsed response headers for an HTTP 202 response
	Headers202 *CancelSessionAgentRunResponse202Headers
}

func ParseCancelSessionAgentRunResponse

func ParseCancelSessionAgentRunResponse(rsp *http.Response) (*CancelSessionAgentRunResponse, error)

ParseCancelSessionAgentRunResponse parses an HTTP response from a CancelSessionAgentRunWithResponse call

func (CancelSessionAgentRunResponse) ContentType

func (r CancelSessionAgentRunResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelSessionAgentRunResponse) GetBody

func (r CancelSessionAgentRunResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelSessionAgentRunResponse) GetJSON202

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (CancelSessionAgentRunResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CancelSessionAgentRunResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (CancelSessionAgentRunResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (CancelSessionAgentRunResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (CancelSessionAgentRunResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (CancelSessionAgentRunResponse) Status

Status returns HTTPResponse.Status

func (CancelSessionAgentRunResponse) StatusCode

func (r CancelSessionAgentRunResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelSessionAgentRunResponse202Headers

type CancelSessionAgentRunResponse202Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

CancelSessionAgentRunResponse202Headers the declared response headers of an HTTP 202 response for CancelSessionAgentRun

type CancelSessionParams

type CancelSessionParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

CancelSessionParams defines parameters for CancelSession.

type CancelSessionResponse

type CancelSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *CancelResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers202 the parsed response headers for an HTTP 202 response
	Headers202 *CancelSessionResponse202Headers
}

func ParseCancelSessionResponse

func ParseCancelSessionResponse(rsp *http.Response) (*CancelSessionResponse, error)

ParseCancelSessionResponse parses an HTTP response from a CancelSessionWithResponse call

func (CancelSessionResponse) ContentType

func (r CancelSessionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelSessionResponse) GetBody

func (r CancelSessionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelSessionResponse) GetJSON202

func (r CancelSessionResponse) GetJSON202() *CancelResponse

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (CancelSessionResponse) GetJSON400

func (r CancelSessionResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CancelSessionResponse) GetJSON401

func (r CancelSessionResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (CancelSessionResponse) GetJSON404

func (r CancelSessionResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (CancelSessionResponse) GetJSON406 added in v0.52.0

func (r CancelSessionResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (CancelSessionResponse) GetJSON500

func (r CancelSessionResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (CancelSessionResponse) Status

func (r CancelSessionResponse) Status() string

Status returns HTTPResponse.Status

func (CancelSessionResponse) StatusCode

func (r CancelSessionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelSessionResponse202Headers

type CancelSessionResponse202Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

CancelSessionResponse202Headers the declared response headers of an HTTP 202 response for CancelSession

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CancelSession

func (c *Client) CancelSession(ctx context.Context, params *CancelSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelSession Stop the session's running work

Stops the work of the session named by `X-Session-ID` without deleting anything. It cancels a message still waiting to start a turn, interrupts the running turn in the session's worker, pauses unfinished workflows, and cancels every child agent still running, including children of turns that already ended. It takes no request body.

Peen records the stop before it interrupts the worker, and the call returns without waiting for the work to wind down. A request accepted before the stop cannot start afterward, and reconnecting does not resume paused work. A foreground `runCommand` kills its process group; background jobs already handed back keep running.

It answers 202 whether or not anything was running, so repeating it is safe. Returns 404 `SESSION_NOT_FOUND` when the session does not exist.

Corresponds with POST /session/cancel (the `CancelSession` operationId).

func (*Client) CancelSessionAgentRun

func (c *Client) CancelSessionAgentRun(ctx context.Context, agentRunId AgentRunID, params *CancelSessionAgentRunParams, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelSessionAgentRun Cancel one child agent run without ending its parent turn

Cancels one child agent run and the unfinished children it launched. The parent turn and the rest of the session keep running. The request has no body.

Peen records the cancellation in the database first, then asks the session's live worker to stop the child. A child that runs as a session-worker workflow is settled as `cancelled` in the same step, so the response often already reports `cancelled`. Otherwise the run stays `running` until the worker stops it, and its events end with `agent.run.cancelled`. Repeating the request is safe: it changes nothing in the database, reports `cancelRequested: false` with the current state, and retries delivery to the worker. A session with no live worker records the cancellation, and a replacement worker applies it before starting work.

- Select the session with the `X-Session-ID` header. - A run that already ended (`completed`, `failed`, or `cancelled`) is not an error: the response reports `cancelRequested: false` and its current state. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it.

Corresponds with POST /session/agents/{agentRunId}/cancel (the `CancelSessionAgentRun` operationId).

func (*Client) DeleteSessionLearnedFile added in v0.37.0

func (c *Client) DeleteSessionLearnedFile(ctx context.Context, params *DeleteSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteSessionLearnedFile Delete one learned rule or skill

Deletes one learned rule's file, or one learned skill's whole directory (`skills/<name>/` with everything in it). The deletion is immediate and cannot be undone. The next turn and the next `changeDirectory` call resolve the harness without it; a conversation that already resolved it keeps what it loaded until then. Only files under a learned directory can be deleted this way.

- Select the session with the `X-Session-ID` header. - Returns `204` with no body on success. - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.

Corresponds with DELETE /session/learned/file (the `DeleteSessionLearnedFile` operationId).

func (*Client) DeleteWorkspaceFile added in v0.51.0

func (c *Client) DeleteWorkspaceFile(ctx context.Context, params *DeleteWorkspaceFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteWorkspaceFile Delete a file or empty workspace directory

Deletes one file, symbolic link or empty directory in the session's workspace and answers `204` with no body. A symbolic link is removed itself; its target is left alone, and a link whose target no longer exists can still be removed. Nothing is deleted recursively.

- A directory that still has entries answers `409 CONFLICT`. - The path follows the rules of `GET /session/files`. The workspace root cannot be deleted: an empty path or `.` answers `403 WORKSPACE_NOT_ALLOWED`. - A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.

Corresponds with DELETE /session/files (the `DeleteWorkspaceFile` operationId).

func (*Client) GetSession

func (c *Client) GetSession(ctx context.Context, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSession Read one session

Reads the session named by `X-Session-ID`: its counters, its agent, model, workspace, and agent space, whether a turn is running, and its newest feed sequence.

This is the only operation that sets `activeTurnFeedSequence`, the first feed sequence of the running turn. A client that connects while a turn runs can call `GET /session/feed` with `cursor` set to one less than that value to rebuild the turn's live view, then follow the WebSocket.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 `INVALID_SESSION_ID` for a malformed header.

Corresponds with GET /session (the `GetSession` operationId).

func (*Client) GetSessionAgentRun added in v0.4.0

func (c *Client) GetSessionAgentRun(ctx context.Context, agentRunId AgentRunID, params *GetSessionAgentRunParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionAgentRun Read one durable child agent run

Returns every stored detail of one child agent run: its parent turn and tool call, depth, task, instructions, allowed tools, system prompt, model, state, final answer, token counts, failure details, and start and end times. `waiting`, `question`, and `paused` are computed when you read the run.

`responseText` holds the whole final answer, even when the `agent.finished` session event that reported it to the root conversation was cut to fit the event size limit.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it. A run ID from another session answers the same as an unknown one.

Corresponds with GET /session/agents/{agentRunId} (the `GetSessionAgentRun` operationId).

func (*Client) GetSessionAgentRunCompaction added in v0.11.0

func (c *Client) GetSessionAgentRunCompaction(ctx context.Context, agentRunId AgentRunID, compactionId CompactionID, params *GetSessionAgentRunCompactionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionAgentRunCompaction Read one immutable child compaction record

Returns one child compaction record. The record must belong to both the session and the agent run in the path.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`compaction not found`) when the run does not belong to it or the compaction belongs to another session or another run. A caller cannot use this to probe for records it does not own.

Corresponds with GET /session/agents/{agentRunId}/compactions/{compactionId} (the `GetSessionAgentRunCompaction` operationId).

func (*Client) GetSessionCompaction added in v0.4.0

func (c *Client) GetSessionCompaction(ctx context.Context, compactionId CompactionID, params *GetSessionCompactionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionCompaction Read one durable compaction record

Reads one of the session's compaction records by ID. The record includes the message range it covers and its optional `parentCompactionId`, so you can read any point in the lineage without inferring it from message order.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`compaction not found`) when it has no compaction with this ID. A compaction of another session answers the same as an unknown one.

Corresponds with GET /session/compactions/{compactionId} (the `GetSessionCompaction` operationId).

func (*Client) GetSessionContextSnapshot added in v0.4.0

func (c *Client) GetSessionContextSnapshot(ctx context.Context, contextHash ContextHash, params *GetSessionContextSnapshotParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionContextSnapshot Read a context snapshot referenced by this session

Reads the context snapshot a turn's `contextSnapshotHash` names: the harness sources the turn resolved, as a manifest, and the content Peen built from them. Snapshots are stored once by hash and shared by every session that produced the same content.

You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.

Corresponds with GET /session/context-snapshots/{contextHash} (the `GetSessionContextSnapshot` operationId).

func (*Client) GetSessionLearnedFile added in v0.37.0

func (c *Client) GetSessionLearnedFile(ctx context.Context, params *GetSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionLearnedFile Read one learned rule or skill

Returns one learned rule's file, or one learned skill's `SKILL.md`, as the agent saved it, with the same metadata the list returns. Name the file with `scope`, `kind`, and `name`.

A file larger than 128 KiB, which the harness skips, comes back with empty `content` and an `estimatedTokens` of 0.

- Select the session with the `X-Session-ID` header. - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep (a skill name is one segment; a rule name is at most 9). - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.

Corresponds with GET /session/learned/file (the `GetSessionLearnedFile` operationId).

func (*Client) GetSessionMCPStatus added in v0.38.0

func (c *Client) GetSessionMCPStatus(ctx context.Context, params *GetSessionMCPStatusParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionMCPStatus Report the session's MCP servers

Returns the MCP servers the session's worker last reported: which ones started, the tools each offers, and why one failed. MCP servers are configured in `.agents/mcp.json` in the config directory and, when the deployment allows workspace servers, in the session workspace.

At the start of every turn the worker reloads `mcp.json`, starts the configured servers, and records an `mcp.status` session event. A turn with no MCP configuration records an empty server list, so once `mcp.json` is removed the next turn's report is empty. This endpoint returns the servers from the most recent such event, and `reportedAt` says when it was recorded. A server that stopped after that turn started still shows as `ready` until the next turn reports.

- Select the session with the `X-Session-ID` header. - A session that has not run a turn yet returns an empty `servers` array and a null `reportedAt`. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.

Corresponds with GET /session/mcp (the `GetSessionMCPStatus` operationId).

func (*Client) GetSessionPromptSnapshot added in v0.4.0

func (c *Client) GetSessionPromptSnapshot(ctx context.Context, promptHash PromptHash, params *GetSessionPromptSnapshotParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSessionPromptSnapshot Read a prompt snapshot referenced by this session

Reads the prompt snapshot a turn's `promptSnapshotHash` names: the exact system prompt the model received for that turn. Snapshots are stored once by hash and shared by every session that produced the same prompt.

You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`. A compaction's `promptHash` is a different hash and does not name a prompt snapshot.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.

Corresponds with GET /session/prompt-snapshots/{promptHash} (the `GetSessionPromptSnapshot` operationId).

func (*Client) ListAgentSpaces added in v0.19.0

func (c *Client) ListAgentSpaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListAgentSpaces List the agent spaces a client may name

Lists the agent spaces a session may run in, sorted by name, and the default a session gets when it is opened without naming one. It takes no `X-Session-ID` header, because a client reads it before it has a session.

- `control` runs the agent where the controller runs. It is listed only when the controller cannot reach a Docker daemon. - `docker:<profile>` runs the agent in its own container, one space per Docker profile the operator configured, plus the built-in `default` profile (no Docker access, bridge network, no sudo) unless the operator redefines it.

A client names an agent space when it opens a workspace or reconfigures a session, and never sends an image, mount, network setting, or capability: the operator's configuration decides what each name means. Each Docker space reports its grants (`docker`, `network`, `sudo`), and `capabilityWarnings` carries one sentence for each risky grant.

Corresponds with GET /agent-spaces (the `ListAgentSpaces` operationId).

func (*Client) ListCronJobs added in v0.51.0

func (c *Client) ListCronJobs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCronJobs List configured scheduled jobs

Returns every scheduled job Peen loaded from the operator's cron file at startup, sorted by name, each with its next scheduled occurrence and its most recent run. Takes no session header and no paging; the list is the whole configuration.

- While `PEEN_CRON` is off, the list is empty. Past runs stay readable through `GET /cron/runs`. - Jobs change only when Peen restarts with an edited cron file. The API cannot add, change or trigger a job.

Corresponds with GET /cron/jobs (the `ListCronJobs` operationId).

func (*Client) ListCronRuns added in v0.51.0

func (c *Client) ListCronRuns(ctx context.Context, params *ListCronRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCronRuns List scheduled run history

Returns the durable history of scheduled runs, newest scheduled occurrence first, for every job or for one job. Each run records when it was due, how it ended, and the session it ran in. Takes no session header.

- History includes jobs that are no longer configured, and it stays readable while `PEEN_CRON` is off. - Pages with `limit` and `offset`. A `job` value that does not match the name pattern answers `400 VALIDATION_FAILED`; a valid name with no runs returns an empty page. - Open a run's conversation with its `sessionId` as `X-Session-ID` on `GET /messages`.

Corresponds with GET /cron/runs (the `ListCronRuns` operationId).

func (*Client) ListMessages

func (c *Client) ListMessages(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListMessages List a session's conversation messages

Lists the stored conversation messages of the session named by `X-Session-ID`, ordered by `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.

This is the root conversation only. A child agent's transcript is read with `GET /session/agents/{agentRunId}/messages`, and Peen's internal harness records, such as context changes and resolved prompts, are not messages and never appear here. Image bytes are never returned; `images` lists each image's media type and size.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.

Corresponds with GET /messages (the `ListMessages` operationId).

func (*Client) ListModels added in v0.12.0

func (c *Client) ListModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListModels List the models discovered from configured connections

Lists the models Peen found on its configured connections at controller startup, sorted by `name`. It takes no `X-Session-ID` header, never makes a provider call, and never returns provider credentials.

Pass a model's `name` as `data.model` in a WebSocket `message.send` frame to run that one turn on it. The list is empty when the controller has no model catalog.

Corresponds with GET /models (the `ListModels` operationId).

func (*Client) ListSessionAgentRunCompactions added in v0.11.0

func (c *Client) ListSessionAgentRunCompactions(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunCompactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionAgentRunCompactions List one child agent run's compaction lineage

Lists one child agent run's compaction records, newest first (by `createdAt`, then ID). A child compaction summarizes a prefix of the child's own transcript. It never covers a session message and never replaces a session compaction, so this list and `GET /session/compactions` describe separate lineages.

A later compaction summarizes the earlier summary plus newer raw messages and points at the earlier record through `parentCompactionId`. The earlier record stays unchanged.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more records follow this page. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.

Corresponds with GET /session/agents/{agentRunId}/compactions (the `ListSessionAgentRunCompactions` operationId).

func (*Client) ListSessionAgentRunEvents

func (c *Client) ListSessionAgentRunEvents(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionAgentRunEvents Follow what one child agent run is doing

Returns one child agent run's stored events in order, read from the database, so the answer is complete even after a restart. These are the same `agent.run.*` steps connected WebSocket clients receive live, such as `agent.run.started`, `agent.run.text.delta`, `agent.run.tool.use`, `agent.run.tool.result`, `agent.run.question`, and the terminal `agent.run.completed`, `agent.run.failed`, or `agent.run.cancelled`. They are not part of `GET /session/events`, which lists only root-turn events.

Each run numbers its events from 1. To follow a run, start with `cursor=0`, then pass each page's `nextCursor` back as `cursor`. Poll again while `hasMore` is true or the run's `state` is still `running`.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for an out-of-range `cursor` or `limit`.

Corresponds with GET /session/agents/{agentRunId}/events (the `ListSessionAgentRunEvents` operationId).

func (*Client) ListSessionAgentRunMessages added in v0.11.0

func (c *Client) ListSessionAgentRunMessages(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionAgentRunMessages List one child agent run's own durable transcript

Lists one child agent run's own transcript, oldest first (by `sequence`). A child agent runs in a separate model context, so its transcript is stored apart from the session transcript, never appears under `GET /messages`, and is never absorbed by a session compaction.

The first record is the task the launching agent gave the child, as a user message in a `<message>` block that names the sender. The rest are the child's assistant messages, tool results, and the messages it received from other agents or from you. A child transcript never contains `system` messages.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more messages follow this page. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.

Corresponds with GET /session/agents/{agentRunId}/messages (the `ListSessionAgentRunMessages` operationId).

func (*Client) ListSessionAgentRuns

func (c *Client) ListSessionAgentRuns(ctx context.Context, params *ListSessionAgentRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionAgentRuns List the child agent runs this session has started

Lists the session's child agent runs, newest first (by `startedAt`, then ID). A child agent run starts when an agent in the session calls the `launchAgent` tool, either with a stored agent definition or with an inline one. Each entry is the whole stored run record, the same object `GET /session/agents/{agentRunId}` returns, including the derived `waiting`, `question`, and `paused` fields.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more runs follow this page. - A session that never launched a child returns an empty `agents` array, not an error. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `400` with code `VALIDATION_FAILED` when a query parameter or the header fails validation, including a `parentAgentRunId` that is neither an agent run ID nor `root`.

Corresponds with GET /session/agents (the `ListSessionAgentRuns` operationId).

func (*Client) ListSessionAgentSpaceDecisions added in v0.19.0

func (c *Client) ListSessionAgentSpaceDecisions(ctx context.Context, params *ListSessionAgentSpaceDecisionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionAgentSpaceDecisions List a session's agent space decisions

Lists every agent space change recorded for the session named by `X-Session-ID`, newest first (by decision time, then ID). Each entry names the agent space the session moved from, the one it moved to, and the reason the caller gave. A successful `POST /session/reconfigure` adds one entry.

Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Corresponds with GET /session/agent-space-decisions (the `ListSessionAgentSpaceDecisions` operationId).

func (*Client) ListSessionCompactions added in v0.4.0

func (c *Client) ListSessionCompactions(ctx context.Context, params *ListSessionCompactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionCompactions List durable compaction records

Lists the session's compaction records, newest first. When a conversation grows close to the model's context limit, Peen asks a model to summarize the oldest messages and sends the summary in their place from then on. Each compaction record holds that summary and the exact range of stored messages it replaced. A record never changes once written.

A later compaction summarizes the current summary plus the next messages, so its range starts where the earlier one started, and `parentCompactionId` points at the record it replaces. Follow the parent links to rebuild the whole lineage. Messages keep the `compactionId` of the compaction that first summarized them. Child agents keep their own compactions, under `GET /session/agents/{agentRunId}/compactions`, not here.

- Ordering: by `createdAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more record exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Corresponds with GET /session/compactions (the `ListSessionCompactions` operationId).

func (*Client) ListSessionEvents

func (c *Client) ListSessionEvents(ctx context.Context, params *ListSessionEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionEvents List stored protocol events

Lists the protocol events Peen stored while it ran the session's turns, such as `tool.use`, ordered by their per-session `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.

These are records of what happened, not a queue: listing never consumes or changes them. The WebSocket protocol event types table lists every `type`. To replay exactly what a live client saw, including child agent steps and notices, use `GET /session/feed` instead.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.

Corresponds with GET /session/events (the `ListSessionEvents` operationId).

func (*Client) ListSessionFeed added in v0.26.0

func (c *Client) ListSessionFeed(ctx context.Context, params *ListSessionFeedParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionFeed Replay a session's live feed from a sequence

Returns the session's sequenced live frames with a sequence greater than `cursor`, oldest first. The feed merges three kinds of frame: root protocol events, child agent run steps (`agent.run.*`), and notices (`notice.created`). Each item has the same `type`, `data`, and `sequence` its live WebSocket frame carried, and `id` is the stored record's ID, so a client that reconnects passes the last sequence it applied as `cursor` and continues without a gap or a duplicate.

Continue with `nextCursor` while `hasMore` is true. A cursor at or past the head returns an empty page with `nextCursor` equal to the `cursor` sent. `message.completed` and `message.failed` never appear here, because they are unsequenced acknowledgements of one request.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID`, a negative `cursor`, or a `limit` outside 1 to 200.

Corresponds with GET /session/feed (the `ListSessionFeed` operationId).

func (*Client) ListSessionJobSignalRequests added in v0.4.0

func (c *Client) ListSessionJobSignalRequests(ctx context.Context, jobId JobID, params *ListSessionJobSignalRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionJobSignalRequests List the durable signal-request history for one job

Lists every request to stop or kill one job, oldest first, together with the job's own record. Peen records a request whether or not it reached a running process, so the history shows requests that arrived after the job had already ended. The history stays readable after the job ends and after Peen restarts.

Requests come from `POST /session/jobs/{jobId}/signal`, from the agent's own job tools, and from Peen itself when it stops a foreground command whose turn was cancelled.

- Ordering: by `requestedAt` ascending, then `id` ascending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more request exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Corresponds with GET /session/jobs/{jobId}/signals (the `ListSessionJobSignalRequests` operationId).

func (*Client) ListSessionJobs

func (c *Client) ListSessionJobs(ctx context.Context, params *ListSessionJobsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionJobs List the commands this session has started

Lists the session's process jobs, newest first. A job is one shell command the agent started with the `runCommand` tool, in the foreground or the background. Peen records it before the process produces output and keeps the record after the process ends, after the worker stops and after Peen restarts. A job started in one turn stays listed, readable and signallable from later turns.

- Ordering: by `startedAt` descending, then `jobId` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more job exists after this page. - Filter: `state` keeps jobs in one state. - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Corresponds with GET /session/jobs (the `ListSessionJobs` operationId).

func (*Client) ListSessionLearnedFiles added in v0.37.0

func (c *Client) ListSessionLearnedFiles(ctx context.Context, params *ListSessionLearnedFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionLearnedFiles List the learned rules and skills this session loads

Lists the learned rules and skills the session loads, so you can review what an auto-evolving agent saved. Learned files live in two learned directories: `.agents/learned/` in the session's workspace (scope `workspace`), and the deployment's global learned directory that every session reads (scope `global`). Each holds rules under `rules/` and skills under `skills/<name>/SKILL.md`.

Workspace files come first, then global ones, each group sorted by kind (`rule` before `skill`) and then by name. Each rule says whether it loads on every turn and its estimated token count.

- Select the session with the `X-Session-ID` header. - Only regular files count. Symbolic links are left out, rule files must end in `.md`, and rule directories nested deeper than 8 levels are not read, matching what the harness loads. - A learned directory that does not exist lists nothing. The list is not paged. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.

Corresponds with GET /session/learned (the `ListSessionLearnedFiles` operationId).

func (*Client) ListSessionModelRunCalls added in v0.4.0

func (c *Client) ListSessionModelRunCalls(ctx context.Context, modelRunId ModelRunID, params *ListSessionModelRunCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionModelRunCalls Read every provider round for one model invocation

Lists the provider rounds of one model run, with the run itself. A round is one request to the provider: Peen stores the exact messages and the tool definitions the provider saw before the request is sent, then the response message, usage, retries and costs when the round ends.

Request messages repeat the whole conversation each round, and images in them are returned base64 encoded, so a page can be large. Treat the content as sensitive: it holds everything the agent read and sent.

- Ordering: by `round` ascending, then `id` ascending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more round exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`model run not found`) when it has no model run with this ID. A model run of another session answers the same as an unknown one.

Corresponds with GET /session/model-runs/{modelRunId}/calls (the `ListSessionModelRunCalls` operationId).

func (*Client) ListSessionModelRuns added in v0.4.0

func (c *Client) ListSessionModelRuns(ctx context.Context, params *ListSessionModelRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionModelRuns List complete durable model invocations

Lists the session's model runs, newest first. A model run is one logical request Peen made to a model: a root turn's conversation with the model, a child agent's, or a compaction summary. One run can take several provider rounds, one per model call in a tool loop, and each round is listed by `GET /session/model-runs/{modelRunId}/calls`. Peen writes the run before any provider work starts and finalizes it when the run ends.

A run records the model it asked for and the model that answered, the settings in effect without secrets, the final text and thinking, the response messages, the summed usage, the cost amounts when the model has prices, and failure details.

- Ordering: by `startedAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more run exists after this page. - Filters: `stage` and `state`, which combine. - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset`, `stage` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Corresponds with GET /session/model-runs (the `ListSessionModelRuns` operationId).

func (*Client) ListSessionNotices added in v0.4.0

func (c *Client) ListSessionNotices(ctx context.Context, params *ListSessionNoticesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionNotices List a session's notices

Lists every notice recorded for the session named by `X-Session-ID`, oldest first, whether or not it has been delivered to the model yet. Notices come from Peen's own producers (for example `tools.job` for process jobs, `agent.launchAgent` for child agents, `session.turn` for how a turn ended) and from outside callers through `POST /session/notices` (source `api`). Listing never consumes them. Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Corresponds with GET /session/notices (the `ListSessionNotices` operationId).

func (*Client) ListSessionTurns added in v0.4.0

func (c *Client) ListSessionTurns(ctx context.Context, params *ListSessionTurnsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionTurns List durable turns

Lists the session's stored turns, newest first. A turn is one run of the agent in response to a message, from the moment Peen accepts it until it completes, fails, is cancelled or is interrupted. Each turn names the context and prompt snapshots it ran with, which you can read from `GET /session/context-snapshots/{contextHash}` and `GET /session/prompt-snapshots/{promptHash}`.

- Ordering: by `startedAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more turn exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Corresponds with GET /session/turns (the `ListSessionTurns` operationId).

func (*Client) ListSessionWorkers added in v0.8.0

func (c *Client) ListSessionWorkers(ctx context.Context, params *ListSessionWorkersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessionWorkers List a session's worker generations

Lists the worker generations of the session named by `X-Session-ID`, newest first (by creation time, then ID). A generation is one worker process or container that ran the session's turns. It records the agent space and the agent space revision it started under, its lifecycle state, and for a Docker generation its container ID and image digest. A new generation starts when a session's next turn needs a worker and none is running, for example after `POST /session/reconfigure` stopped the previous one.

Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Corresponds with GET /session/workers (the `ListSessionWorkers` operationId).

func (*Client) ListSessions added in v0.8.0

func (c *Client) ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSessions List every session

Lists every session this controller holds, newest updated first (ties broken by session ID, descending). This includes one session for each opened workspace and the system session when one exists. It takes no `X-Session-ID` header, because it is how a client discovers which sessions exist.

Each item has the same shape as `GET /session`, except that `activeTurnFeedSequence` is never set here. Page with `limit` and `offset`; `hasMore` is true when at least one more session follows this page.

Returns 400 `VALIDATION_FAILED` for a `limit` or `offset` outside its range.

Corresponds with GET /sessions (the `ListSessions` operationId).

func (*Client) ListWorkspaceFiles added in v0.51.0

func (c *Client) ListWorkspaceFiles(ctx context.Context, params *ListWorkspaceFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListWorkspaceFiles List a workspace directory or inspect a file

Returns metadata for one path in the session's workspace directory and, when the path is a directory, its direct entries sorted by name. Hidden files are included. The listing is not recursive and not paged. A file path returns its own metadata with an empty `entries` list.

Path rules, shared by every workspace file operation:

- `path` is relative to the workspace and uses `/` separators. It must already be clean: no leading `/`, no `.` or `..` segment, no empty segment or trailing `/`, no NUL byte. A path that breaks these rules answers `403 WORKSPACE_NOT_ALLOWED` with the message `path must be a clean relative path inside the workspace`. - Symbolic links are followed while they stay inside the workspace. Naming a path that goes through a link with an absolute target, or one that resolves outside the workspace, answers the same `403`. - Entries are reported without following links: a link is `symlink`, with the size of the link itself, wherever it points. A directory that contains a link leading outside the workspace still lists, with that entry as `symlink`; its target is never read or returned. A listed path that is a link to a directory reports `symlink` and no entries. - A path that runs through a regular file, such as `README.md/x`, does not exist and answers `404 NOT_FOUND`. - The operations work on the workspace directory itself, the one the agent works in, whether or not a turn is running. They never address the system session, which answers `403 WORKSPACE_NOT_ALLOWED`.

Errors: `404 SESSION_NOT_FOUND` when the session does not exist, `404 NOT_FOUND` (`workspace path not found`) when the path does not exist, `403` as above, `400` for a malformed request.

Corresponds with GET /session/files (the `ListWorkspaceFiles` operationId).

func (*Client) ListWorkspaceRoots added in v0.13.0

func (c *Client) ListWorkspaceRoots(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListWorkspaceRoots List the workspace roots this controller may open

Lists the workspace roots configured for this controller, so a client can offer a valid directory before it opens its first session instead of guessing a host path. It takes no `X-Session-ID` header.

Peen currently supports one root: `PEEN_WORKSPACE_ROOT`, or the controller's working directory when that is unset, resolved through its symbolic links. `POST /sessions/open` accepts any existing directory beneath it, apart from the controller's own state and configuration directories.

This is the deliberate, authenticated disclosure of the controller's workspace boundary. A refused `POST /sessions/open` never names a root.

Corresponds with GET /workspace-roots (the `ListWorkspaceRoots` operationId).

func (*Client) OpenSession added in v0.8.0

func (c *Client) OpenSession(ctx context.Context, body OpenSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

OpenSession Open or resume the session for a workspace

Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.

The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.

Each workspace session has one agent space.

- For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`). - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.

Errors, none of which creates a session:

- 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory. - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session. - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root. - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist. - 409 `AGENT_SPACE_CONFLICT`: see above.

Takes a body of the `application/json` content type.

Corresponds with POST /sessions/open (the `OpenSession` operationId).

func (*Client) OpenSessionWithBody added in v0.8.0

func (c *Client) OpenSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

OpenSessionWithBody Open or resume the session for a workspace

Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.

The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.

Each workspace session has one agent space.

- For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`). - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.

Errors, none of which creates a session:

- 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory. - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session. - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root. - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist. - 409 `AGENT_SPACE_CONFLICT`: see above.

Takes any type of body and a specified content type.

Corresponds with POST /sessions/open (the `OpenSession` operationId).

func (*Client) OpenSystemSession added in v0.45.0

func (c *Client) OpenSystemSession(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

OpenSystemSession Open or resume the system session

Returns the deployment's one system session, creating it the first time, and starts no turn. The system session runs the system agent in the `control` agent space, in a directory under the controller's state directory that no client can open with `POST /sessions/open`. It takes no request body and no `X-Session-ID` header; the response carries the session ID in its body and in the `X-Session-ID` response header.

Send the system session messages over the WebSocket with `system` set. Its agent space cannot be changed with `POST /session/reconfigure`.

While `PEEN_SYSTEM_AGENT` is off this returns 403 `SYSTEM_AGENT_OFF` and creates nothing.

Corresponds with POST /sessions/system (the `OpenSystemSession` operationId).

func (*Client) PublishSessionNotice added in v0.4.0

func (c *Client) PublishSessionNotice(ctx context.Context, params *PublishSessionNoticeParams, body PublishSessionNoticeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PublishSessionNotice Report a notice to a session

Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.

`delivery` decides when the model sees it:

- `queue` (the default) delivers it at the session's next turn or tool boundary. - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.

Errors:

- 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes). - 404 `SESSION_NOT_FOUND`: the session does not exist.

Takes a body of the `application/json` content type.

Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).

func (*Client) PublishSessionNoticeWithBody added in v0.4.0

func (c *Client) PublishSessionNoticeWithBody(ctx context.Context, params *PublishSessionNoticeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PublishSessionNoticeWithBody Report a notice to a session

Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.

`delivery` decides when the model sees it:

- `queue` (the default) delivers it at the session's next turn or tool boundary. - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.

Errors:

- 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes). - 404 `SESSION_NOT_FOUND`: the session does not exist.

Takes any type of body and a specified content type.

Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).

func (*Client) ReadSessionJobOutput

func (c *Client) ReadSessionJobOutput(ctx context.Context, jobId JobID, params *ReadSessionJobOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ReadSessionJobOutput Read a bounded window of one job's output

Reads a window of one job's stdout and stderr lines from the database without waiting for the job to finish. Peen stores every line before any client can see it, so a running job's output grows as you read it, and the same lines stay readable after the job ends or Peen restarts.

Each line carries a `sequence` number. stdout and stderr share one counter per job, starting at 1, so the sequence keeps the order Peen saw the lines in across both streams.

- Cursor: the response holds lines whose `sequence` is greater than `cursor`, oldest first. Pass `nextCursor` back as `cursor` to read the next window. To follow a running job, repeat the call until `state` is no longer `running` and `hasMore` is `false`. - Window size: `limit` lines at most, 1 to 200, default 50. - Errors: `400 VALIDATION_FAILED` for an unknown `stream`, a negative `cursor`, or a `limit` outside 1 to 200. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Corresponds with GET /session/jobs/{jobId}/output (the `ReadSessionJobOutput` operationId).

func (*Client) ReadWorkspaceFile added in v0.51.0

func (c *Client) ReadWorkspaceFile(ctx context.Context, params *ReadWorkspaceFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ReadWorkspaceFile Read a workspace file as base64

Returns the full bytes of one regular file in the session's workspace, base64 encoded, so text and binary files read the same way. A symbolic link inside the workspace is followed to its target.

- The file can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. A larger file answers `400 VALIDATION_FAILED`; there is no partial or ranged read. - A directory, device, socket or pipe answers `400 VALIDATION_FAILED`. - The path follows the rules of `GET /session/files`. A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.

Corresponds with GET /session/files/content (the `ReadWorkspaceFile` operationId).

func (*Client) ReconfigureSession added in v0.8.0

func (c *Client) ReconfigureSession(ctx context.Context, params *ReconfigureSessionParams, body ReconfigureSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ReconfigureSession Move a workspace session to another agent space

Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.

On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.

Errors, none of which changes anything:

- 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace. - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer. - 404 `SESSION_NOT_FOUND`: the session does not exist. - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker. - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.

Takes a body of the `application/json` content type.

Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).

func (*Client) ReconfigureSessionWithBody added in v0.8.0

func (c *Client) ReconfigureSessionWithBody(ctx context.Context, params *ReconfigureSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ReconfigureSessionWithBody Move a workspace session to another agent space

Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.

On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.

Errors, none of which changes anything:

- 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace. - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer. - 404 `SESSION_NOT_FOUND`: the session does not exist. - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker. - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.

Takes any type of body and a specified content type.

Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).

func (*Client) SignalSessionJob

func (c *Client) SignalSessionJob(ctx context.Context, jobId JobID, params *SignalSessionJobParams, body SignalSessionJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

SignalSessionJob Stop one running job

Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.

The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.

Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.

- Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Takes a body of the `application/json` content type.

Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).

func (*Client) SignalSessionJobWithBody

func (c *Client) SignalSessionJobWithBody(ctx context.Context, jobId JobID, params *SignalSessionJobParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

SignalSessionJobWithBody Stop one running job

Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.

The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.

Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.

- Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Takes any type of body and a specified content type.

Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).

func (*Client) WriteWorkspaceFile added in v0.51.0

func (c *Client) WriteWorkspaceFile(ctx context.Context, params *WriteWorkspaceFileParams, body WriteWorkspaceFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

WriteWorkspaceFile Write a workspace file atomically

Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.

- A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept. - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced. - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`. - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way. - A session that does not exist answers `404 SESSION_NOT_FOUND`. - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB. - There is no conditional write: the last write wins. - The path follows the rules of `GET /session/files`.

Takes a body of the `application/json` content type.

Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).

func (*Client) WriteWorkspaceFileWithBody added in v0.51.0

func (c *Client) WriteWorkspaceFileWithBody(ctx context.Context, params *WriteWorkspaceFileParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

WriteWorkspaceFileWithBody Write a workspace file atomically

Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.

- A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept. - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced. - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`. - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way. - A session that does not exist answers `404 SESSION_NOT_FOUND`. - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB. - There is no conditional write: the last write wins. - The path follows the rules of `GET /session/files`.

Takes any type of body and a specified content type.

Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).

type ClientInterface

type ClientInterface interface {

	// ListAgentSpaces List the agent spaces a client may name
	//
	// Lists the agent spaces a session may run in, sorted by name, and the default a session gets when it is opened without naming one. It takes no `X-Session-ID` header, because a client reads it before it has a session.
	//
	// - `control` runs the agent where the controller runs. It is listed only when the controller cannot reach a Docker daemon.
	// - `docker:<profile>` runs the agent in its own container, one space per Docker profile the operator configured, plus the built-in `default` profile (no Docker access, bridge network, no sudo) unless the operator redefines it.
	//
	// A client names an agent space when it opens a workspace or reconfigures a session, and never sends an image, mount, network setting, or capability: the operator's configuration decides what each name means. Each Docker space reports its grants (`docker`, `network`, `sudo`), and `capabilityWarnings` carries one sentence for each risky grant.
	//
	// Corresponds with GET /agent-spaces (the `ListAgentSpaces` operationId).
	ListAgentSpaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCronJobs List configured scheduled jobs
	//
	// Returns every scheduled job Peen loaded from the operator's cron file at startup, sorted by name, each with its next scheduled occurrence and its most recent run. Takes no session header and no paging; the list is the whole configuration.
	//
	// - While `PEEN_CRON` is off, the list is empty. Past runs stay readable through `GET /cron/runs`.
	// - Jobs change only when Peen restarts with an edited cron file. The API cannot add, change or trigger a job.
	//
	// Corresponds with GET /cron/jobs (the `ListCronJobs` operationId).
	ListCronJobs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCronRuns List scheduled run history
	//
	// Returns the durable history of scheduled runs, newest scheduled occurrence first, for every job or for one job. Each run records when it was due, how it ended, and the session it ran in. Takes no session header.
	//
	// - History includes jobs that are no longer configured, and it stays readable while `PEEN_CRON` is off.
	// - Pages with `limit` and `offset`. A `job` value that does not match the name pattern answers `400 VALIDATION_FAILED`; a valid name with no runs returns an empty page.
	// - Open a run's conversation with its `sessionId` as `X-Session-ID` on `GET /messages`.
	//
	// Corresponds with GET /cron/runs (the `ListCronRuns` operationId).
	ListCronRuns(ctx context.Context, params *ListCronRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListMessages List a session's conversation messages
	//
	// Lists the stored conversation messages of the session named by `X-Session-ID`, ordered by `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.
	//
	// This is the root conversation only. A child agent's transcript is read with `GET /session/agents/{agentRunId}/messages`, and Peen's internal harness records, such as context changes and resolved prompts, are not messages and never appear here. Image bytes are never returned; `images` lists each image's media type and size.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.
	//
	// Corresponds with GET /messages (the `ListMessages` operationId).
	ListMessages(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListModels List the models discovered from configured connections
	//
	// Lists the models Peen found on its configured connections at controller startup, sorted by `name`. It takes no `X-Session-ID` header, never makes a provider call, and never returns provider credentials.
	//
	// Pass a model's `name` as `data.model` in a WebSocket `message.send` frame to run that one turn on it. The list is empty when the controller has no model catalog.
	//
	// Corresponds with GET /models (the `ListModels` operationId).
	ListModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSession Read one session
	//
	// Reads the session named by `X-Session-ID`: its counters, its agent, model, workspace, and agent space, whether a turn is running, and its newest feed sequence.
	//
	// This is the only operation that sets `activeTurnFeedSequence`, the first feed sequence of the running turn. A client that connects while a turn runs can call `GET /session/feed` with `cursor` set to one less than that value to rebuild the turn's live view, then follow the WebSocket.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 `INVALID_SESSION_ID` for a malformed header.
	//
	// Corresponds with GET /session (the `GetSession` operationId).
	GetSession(ctx context.Context, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionAgentSpaceDecisions List a session's agent space decisions
	//
	// Lists every agent space change recorded for the session named by `X-Session-ID`, newest first (by decision time, then ID). Each entry names the agent space the session moved from, the one it moved to, and the reason the caller gave. A successful `POST /session/reconfigure` adds one entry.
	//
	// Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Corresponds with GET /session/agent-space-decisions (the `ListSessionAgentSpaceDecisions` operationId).
	ListSessionAgentSpaceDecisions(ctx context.Context, params *ListSessionAgentSpaceDecisionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionAgentRuns List the child agent runs this session has started
	//
	// Lists the session's child agent runs, newest first (by `startedAt`, then ID). A child agent run starts when an agent in the session calls the `launchAgent` tool, either with a stored agent definition or with an inline one. Each entry is the whole stored run record, the same object `GET /session/agents/{agentRunId}` returns, including the derived `waiting`, `question`, and `paused` fields.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more runs follow this page.
	// - A session that never launched a child returns an empty `agents` array, not an error.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `400` with code `VALIDATION_FAILED` when a query parameter or the header fails validation, including a `parentAgentRunId` that is neither an agent run ID nor `root`.
	//
	// Corresponds with GET /session/agents (the `ListSessionAgentRuns` operationId).
	ListSessionAgentRuns(ctx context.Context, params *ListSessionAgentRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionAgentRun Read one durable child agent run
	//
	// Returns every stored detail of one child agent run: its parent turn and tool call, depth, task, instructions, allowed tools, system prompt, model, state, final answer, token counts, failure details, and start and end times. `waiting`, `question`, and `paused` are computed when you read the run.
	//
	// `responseText` holds the whole final answer, even when the `agent.finished` session event that reported it to the root conversation was cut to fit the event size limit.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it. A run ID from another session answers the same as an unknown one.
	//
	// Corresponds with GET /session/agents/{agentRunId} (the `GetSessionAgentRun` operationId).
	GetSessionAgentRun(ctx context.Context, agentRunId AgentRunID, params *GetSessionAgentRunParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelSessionAgentRun Cancel one child agent run without ending its parent turn
	//
	// Cancels one child agent run and the unfinished children it launched. The parent turn and the rest of the session keep running. The request has no body.
	//
	// Peen records the cancellation in the database first, then asks the session's live worker to stop the child. A child that runs as a session-worker workflow is settled as `cancelled` in the same step, so the response often already reports `cancelled`. Otherwise the run stays `running` until the worker stops it, and its events end with `agent.run.cancelled`. Repeating the request is safe: it changes nothing in the database, reports `cancelRequested: false` with the current state, and retries delivery to the worker. A session with no live worker records the cancellation, and a replacement worker applies it before starting work.
	//
	// - Select the session with the `X-Session-ID` header.
	// - A run that already ended (`completed`, `failed`, or `cancelled`) is not an error: the response reports `cancelRequested: false` and its current state.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it.
	//
	// Corresponds with POST /session/agents/{agentRunId}/cancel (the `CancelSessionAgentRun` operationId).
	CancelSessionAgentRun(ctx context.Context, agentRunId AgentRunID, params *CancelSessionAgentRunParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionAgentRunCompactions List one child agent run's compaction lineage
	//
	// Lists one child agent run's compaction records, newest first (by `createdAt`, then ID). A child compaction summarizes a prefix of the child's own transcript. It never covers a session message and never replaces a session compaction, so this list and `GET /session/compactions` describe separate lineages.
	//
	// A later compaction summarizes the earlier summary plus newer raw messages and points at the earlier record through `parentCompactionId`. The earlier record stays unchanged.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more records follow this page.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.
	//
	// Corresponds with GET /session/agents/{agentRunId}/compactions (the `ListSessionAgentRunCompactions` operationId).
	ListSessionAgentRunCompactions(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunCompactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionAgentRunCompaction Read one immutable child compaction record
	//
	// Returns one child compaction record. The record must belong to both the session and the agent run in the path.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`compaction not found`) when the run does not belong to it or the compaction belongs to another session or another run. A caller cannot use this to probe for records it does not own.
	//
	// Corresponds with GET /session/agents/{agentRunId}/compactions/{compactionId} (the `GetSessionAgentRunCompaction` operationId).
	GetSessionAgentRunCompaction(ctx context.Context, agentRunId AgentRunID, compactionId CompactionID, params *GetSessionAgentRunCompactionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionAgentRunEvents Follow what one child agent run is doing
	//
	// Returns one child agent run's stored events in order, read from the database, so the answer is complete even after a restart. These are the same `agent.run.*` steps connected WebSocket clients receive live, such as `agent.run.started`, `agent.run.text.delta`, `agent.run.tool.use`, `agent.run.tool.result`, `agent.run.question`, and the terminal `agent.run.completed`, `agent.run.failed`, or `agent.run.cancelled`. They are not part of `GET /session/events`, which lists only root-turn events.
	//
	// Each run numbers its events from 1. To follow a run, start with `cursor=0`, then pass each page's `nextCursor` back as `cursor`. Poll again while `hasMore` is true or the run's `state` is still `running`.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for an out-of-range `cursor` or `limit`.
	//
	// Corresponds with GET /session/agents/{agentRunId}/events (the `ListSessionAgentRunEvents` operationId).
	ListSessionAgentRunEvents(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionAgentRunMessages List one child agent run's own durable transcript
	//
	// Lists one child agent run's own transcript, oldest first (by `sequence`). A child agent runs in a separate model context, so its transcript is stored apart from the session transcript, never appears under `GET /messages`, and is never absorbed by a session compaction.
	//
	// The first record is the task the launching agent gave the child, as a user message in a `<message>` block that names the sender. The rest are the child's assistant messages, tool results, and the messages it received from other agents or from you. A child transcript never contains `system` messages.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more messages follow this page.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.
	//
	// Corresponds with GET /session/agents/{agentRunId}/messages (the `ListSessionAgentRunMessages` operationId).
	ListSessionAgentRunMessages(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelSession Stop the session's running work
	//
	// Stops the work of the session named by `X-Session-ID` without deleting anything. It cancels a message still waiting to start a turn, interrupts the running turn in the session's worker, pauses unfinished workflows, and cancels every child agent still running, including children of turns that already ended. It takes no request body.
	//
	// Peen records the stop before it interrupts the worker, and the call returns without waiting for the work to wind down. A request accepted before the stop cannot start afterward, and reconnecting does not resume paused work. A foreground `runCommand` kills its process group; background jobs already handed back keep running.
	//
	// It answers 202 whether or not anything was running, so repeating it is safe. Returns 404 `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Corresponds with POST /session/cancel (the `CancelSession` operationId).
	CancelSession(ctx context.Context, params *CancelSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionCompactions List durable compaction records
	//
	// Lists the session's compaction records, newest first. When a conversation grows close to the model's context limit, Peen asks a model to summarize the oldest messages and sends the summary in their place from then on. Each compaction record holds that summary and the exact range of stored messages it replaced. A record never changes once written.
	//
	// A later compaction summarizes the current summary plus the next messages, so its range starts where the earlier one started, and `parentCompactionId` points at the record it replaces. Follow the parent links to rebuild the whole lineage. Messages keep the `compactionId` of the compaction that first summarized them. Child agents keep their own compactions, under `GET /session/agents/{agentRunId}/compactions`, not here.
	//
	// - Ordering: by `createdAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more record exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Corresponds with GET /session/compactions (the `ListSessionCompactions` operationId).
	ListSessionCompactions(ctx context.Context, params *ListSessionCompactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionCompaction Read one durable compaction record
	//
	// Reads one of the session's compaction records by ID. The record includes the message range it covers and its optional `parentCompactionId`, so you can read any point in the lineage without inferring it from message order.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`compaction not found`) when it has no compaction with this ID. A compaction of another session answers the same as an unknown one.
	//
	// Corresponds with GET /session/compactions/{compactionId} (the `GetSessionCompaction` operationId).
	GetSessionCompaction(ctx context.Context, compactionId CompactionID, params *GetSessionCompactionParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionContextSnapshot Read a context snapshot referenced by this session
	//
	// Reads the context snapshot a turn's `contextSnapshotHash` names: the harness sources the turn resolved, as a manifest, and the content Peen built from them. Snapshots are stored once by hash and shared by every session that produced the same content.
	//
	// You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.
	//
	// Corresponds with GET /session/context-snapshots/{contextHash} (the `GetSessionContextSnapshot` operationId).
	GetSessionContextSnapshot(ctx context.Context, contextHash ContextHash, params *GetSessionContextSnapshotParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionEvents List stored protocol events
	//
	// Lists the protocol events Peen stored while it ran the session's turns, such as `tool.use`, ordered by their per-session `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.
	//
	// These are records of what happened, not a queue: listing never consumes or changes them. The WebSocket protocol event types table lists every `type`. To replay exactly what a live client saw, including child agent steps and notices, use `GET /session/feed` instead.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.
	//
	// Corresponds with GET /session/events (the `ListSessionEvents` operationId).
	ListSessionEvents(ctx context.Context, params *ListSessionEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionFeed Replay a session's live feed from a sequence
	//
	// Returns the session's sequenced live frames with a sequence greater than `cursor`, oldest first. The feed merges three kinds of frame: root protocol events, child agent run steps (`agent.run.*`), and notices (`notice.created`). Each item has the same `type`, `data`, and `sequence` its live WebSocket frame carried, and `id` is the stored record's ID, so a client that reconnects passes the last sequence it applied as `cursor` and continues without a gap or a duplicate.
	//
	// Continue with `nextCursor` while `hasMore` is true. A cursor at or past the head returns an empty page with `nextCursor` equal to the `cursor` sent. `message.completed` and `message.failed` never appear here, because they are unsequenced acknowledgements of one request.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID`, a negative `cursor`, or a `limit` outside 1 to 200.
	//
	// Corresponds with GET /session/feed (the `ListSessionFeed` operationId).
	ListSessionFeed(ctx context.Context, params *ListSessionFeedParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteWorkspaceFile Delete a file or empty workspace directory
	//
	// Deletes one file, symbolic link or empty directory in the session's workspace and answers `204` with no body. A symbolic link is removed itself; its target is left alone, and a link whose target no longer exists can still be removed. Nothing is deleted recursively.
	//
	// - A directory that still has entries answers `409 CONFLICT`.
	// - The path follows the rules of `GET /session/files`. The workspace root cannot be deleted: an empty path or `.` answers `403 WORKSPACE_NOT_ALLOWED`.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.
	//
	// Corresponds with DELETE /session/files (the `DeleteWorkspaceFile` operationId).
	DeleteWorkspaceFile(ctx context.Context, params *DeleteWorkspaceFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListWorkspaceFiles List a workspace directory or inspect a file
	//
	// Returns metadata for one path in the session's workspace directory and, when the path is a directory, its direct entries sorted by name. Hidden files are included. The listing is not recursive and not paged. A file path returns its own metadata with an empty `entries` list.
	//
	// Path rules, shared by every workspace file operation:
	//
	// - `path` is relative to the workspace and uses `/` separators. It must already be clean: no leading `/`, no `.` or `..` segment, no empty segment or trailing `/`, no NUL byte. A path that breaks these rules answers `403 WORKSPACE_NOT_ALLOWED` with the message `path must be a clean relative path inside the workspace`.
	// - Symbolic links are followed while they stay inside the workspace. Naming a path that goes through a link with an absolute target, or one that resolves outside the workspace, answers the same `403`.
	// - Entries are reported without following links: a link is `symlink`, with the size of the link itself, wherever it points. A directory that contains a link leading outside the workspace still lists, with that entry as `symlink`; its target is never read or returned. A listed path that is a link to a directory reports `symlink` and no entries.
	// - A path that runs through a regular file, such as `README.md/x`, does not exist and answers `404 NOT_FOUND`.
	// - The operations work on the workspace directory itself, the one the agent works in, whether or not a turn is running. They never address the system session, which answers `403 WORKSPACE_NOT_ALLOWED`.
	//
	// Errors: `404 SESSION_NOT_FOUND` when the session does not exist, `404 NOT_FOUND` (`workspace path not found`) when the path does not exist, `403` as above, `400` for a malformed request.
	//
	// Corresponds with GET /session/files (the `ListWorkspaceFiles` operationId).
	ListWorkspaceFiles(ctx context.Context, params *ListWorkspaceFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReadWorkspaceFile Read a workspace file as base64
	//
	// Returns the full bytes of one regular file in the session's workspace, base64 encoded, so text and binary files read the same way. A symbolic link inside the workspace is followed to its target.
	//
	// - The file can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. A larger file answers `400 VALIDATION_FAILED`; there is no partial or ranged read.
	// - A directory, device, socket or pipe answers `400 VALIDATION_FAILED`.
	// - The path follows the rules of `GET /session/files`. A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.
	//
	// Corresponds with GET /session/files/content (the `ReadWorkspaceFile` operationId).
	ReadWorkspaceFile(ctx context.Context, params *ReadWorkspaceFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// WriteWorkspaceFileWithBody Write a workspace file atomically
	//
	// Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.
	//
	// - A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept.
	// - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced.
	// - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`.
	// - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`.
	// - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB.
	// - There is no conditional write: the last write wins.
	// - The path follows the rules of `GET /session/files`.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).
	WriteWorkspaceFileWithBody(ctx context.Context, params *WriteWorkspaceFileParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// WriteWorkspaceFile Write a workspace file atomically
	//
	// Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.
	//
	// - A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept.
	// - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced.
	// - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`.
	// - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`.
	// - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB.
	// - There is no conditional write: the last write wins.
	// - The path follows the rules of `GET /session/files`.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).
	WriteWorkspaceFile(ctx context.Context, params *WriteWorkspaceFileParams, body WriteWorkspaceFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionJobs List the commands this session has started
	//
	// Lists the session's process jobs, newest first. A job is one shell command the agent started with the `runCommand` tool, in the foreground or the background. Peen records it before the process produces output and keeps the record after the process ends, after the worker stops and after Peen restarts. A job started in one turn stays listed, readable and signallable from later turns.
	//
	// - Ordering: by `startedAt` descending, then `jobId` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more job exists after this page.
	// - Filter: `state` keeps jobs in one state.
	// - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Corresponds with GET /session/jobs (the `ListSessionJobs` operationId).
	ListSessionJobs(ctx context.Context, params *ListSessionJobsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReadSessionJobOutput Read a bounded window of one job's output
	//
	// Reads a window of one job's stdout and stderr lines from the database without waiting for the job to finish. Peen stores every line before any client can see it, so a running job's output grows as you read it, and the same lines stay readable after the job ends or Peen restarts.
	//
	// Each line carries a `sequence` number. stdout and stderr share one counter per job, starting at 1, so the sequence keeps the order Peen saw the lines in across both streams.
	//
	// - Cursor: the response holds lines whose `sequence` is greater than `cursor`, oldest first. Pass `nextCursor` back as `cursor` to read the next window. To follow a running job, repeat the call until `state` is no longer `running` and `hasMore` is `false`.
	// - Window size: `limit` lines at most, 1 to 200, default 50.
	// - Errors: `400 VALIDATION_FAILED` for an unknown `stream`, a negative `cursor`, or a `limit` outside 1 to 200. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Corresponds with GET /session/jobs/{jobId}/output (the `ReadSessionJobOutput` operationId).
	ReadSessionJobOutput(ctx context.Context, jobId JobID, params *ReadSessionJobOutputParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SignalSessionJobWithBody Stop one running job
	//
	// Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.
	//
	// The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.
	//
	// Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.
	//
	// - Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).
	SignalSessionJobWithBody(ctx context.Context, jobId JobID, params *SignalSessionJobParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SignalSessionJob Stop one running job
	//
	// Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.
	//
	// The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.
	//
	// Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.
	//
	// - Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).
	SignalSessionJob(ctx context.Context, jobId JobID, params *SignalSessionJobParams, body SignalSessionJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionJobSignalRequests List the durable signal-request history for one job
	//
	// Lists every request to stop or kill one job, oldest first, together with the job's own record. Peen records a request whether or not it reached a running process, so the history shows requests that arrived after the job had already ended. The history stays readable after the job ends and after Peen restarts.
	//
	// Requests come from `POST /session/jobs/{jobId}/signal`, from the agent's own job tools, and from Peen itself when it stops a foreground command whose turn was cancelled.
	//
	// - Ordering: by `requestedAt` ascending, then `id` ascending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more request exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Corresponds with GET /session/jobs/{jobId}/signals (the `ListSessionJobSignalRequests` operationId).
	ListSessionJobSignalRequests(ctx context.Context, jobId JobID, params *ListSessionJobSignalRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionLearnedFiles List the learned rules and skills this session loads
	//
	// Lists the learned rules and skills the session loads, so you can review what an auto-evolving agent saved. Learned files live in two learned directories: `.agents/learned/` in the session's workspace (scope `workspace`), and the deployment's global learned directory that every session reads (scope `global`). Each holds rules under `rules/` and skills under `skills/<name>/SKILL.md`.
	//
	// Workspace files come first, then global ones, each group sorted by kind (`rule` before `skill`) and then by name. Each rule says whether it loads on every turn and its estimated token count.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Only regular files count. Symbolic links are left out, rule files must end in `.md`, and rule directories nested deeper than 8 levels are not read, matching what the harness loads.
	// - A learned directory that does not exist lists nothing. The list is not paged.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Corresponds with GET /session/learned (the `ListSessionLearnedFiles` operationId).
	ListSessionLearnedFiles(ctx context.Context, params *ListSessionLearnedFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteSessionLearnedFile Delete one learned rule or skill
	//
	// Deletes one learned rule's file, or one learned skill's whole directory (`skills/<name>/` with everything in it). The deletion is immediate and cannot be undone. The next turn and the next `changeDirectory` call resolve the harness without it; a conversation that already resolved it keeps what it loaded until then. Only files under a learned directory can be deleted this way.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `204` with no body on success.
	// - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.
	//
	// Corresponds with DELETE /session/learned/file (the `DeleteSessionLearnedFile` operationId).
	DeleteSessionLearnedFile(ctx context.Context, params *DeleteSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionLearnedFile Read one learned rule or skill
	//
	// Returns one learned rule's file, or one learned skill's `SKILL.md`, as the agent saved it, with the same metadata the list returns. Name the file with `scope`, `kind`, and `name`.
	//
	// A file larger than 128 KiB, which the harness skips, comes back with empty `content` and an `estimatedTokens` of 0.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep (a skill name is one segment; a rule name is at most 9).
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.
	//
	// Corresponds with GET /session/learned/file (the `GetSessionLearnedFile` operationId).
	GetSessionLearnedFile(ctx context.Context, params *GetSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionMCPStatus Report the session's MCP servers
	//
	// Returns the MCP servers the session's worker last reported: which ones started, the tools each offers, and why one failed. MCP servers are configured in `.agents/mcp.json` in the config directory and, when the deployment allows workspace servers, in the session workspace.
	//
	// At the start of every turn the worker reloads `mcp.json`, starts the configured servers, and records an `mcp.status` session event. A turn with no MCP configuration records an empty server list, so once `mcp.json` is removed the next turn's report is empty. This endpoint returns the servers from the most recent such event, and `reportedAt` says when it was recorded. A server that stopped after that turn started still shows as `ready` until the next turn reports.
	//
	// - Select the session with the `X-Session-ID` header.
	// - A session that has not run a turn yet returns an empty `servers` array and a null `reportedAt`.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Corresponds with GET /session/mcp (the `GetSessionMCPStatus` operationId).
	GetSessionMCPStatus(ctx context.Context, params *GetSessionMCPStatusParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionModelRuns List complete durable model invocations
	//
	// Lists the session's model runs, newest first. A model run is one logical request Peen made to a model: a root turn's conversation with the model, a child agent's, or a compaction summary. One run can take several provider rounds, one per model call in a tool loop, and each round is listed by `GET /session/model-runs/{modelRunId}/calls`. Peen writes the run before any provider work starts and finalizes it when the run ends.
	//
	// A run records the model it asked for and the model that answered, the settings in effect without secrets, the final text and thinking, the response messages, the summed usage, the cost amounts when the model has prices, and failure details.
	//
	// - Ordering: by `startedAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more run exists after this page.
	// - Filters: `stage` and `state`, which combine.
	// - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset`, `stage` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Corresponds with GET /session/model-runs (the `ListSessionModelRuns` operationId).
	ListSessionModelRuns(ctx context.Context, params *ListSessionModelRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionModelRunCalls Read every provider round for one model invocation
	//
	// Lists the provider rounds of one model run, with the run itself. A round is one request to the provider: Peen stores the exact messages and the tool definitions the provider saw before the request is sent, then the response message, usage, retries and costs when the round ends.
	//
	// Request messages repeat the whole conversation each round, and images in them are returned base64 encoded, so a page can be large. Treat the content as sensitive: it holds everything the agent read and sent.
	//
	// - Ordering: by `round` ascending, then `id` ascending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more round exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`model run not found`) when it has no model run with this ID. A model run of another session answers the same as an unknown one.
	//
	// Corresponds with GET /session/model-runs/{modelRunId}/calls (the `ListSessionModelRunCalls` operationId).
	ListSessionModelRunCalls(ctx context.Context, modelRunId ModelRunID, params *ListSessionModelRunCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionNotices List a session's notices
	//
	// Lists every notice recorded for the session named by `X-Session-ID`, oldest first, whether or not it has been delivered to the model yet. Notices come from Peen's own producers (for example `tools.job` for process jobs, `agent.launchAgent` for child agents, `session.turn` for how a turn ended) and from outside callers through `POST /session/notices` (source `api`). Listing never consumes them. Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Corresponds with GET /session/notices (the `ListSessionNotices` operationId).
	ListSessionNotices(ctx context.Context, params *ListSessionNoticesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PublishSessionNoticeWithBody Report a notice to a session
	//
	// Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.
	//
	// `delivery` decides when the model sees it:
	//
	// - `queue` (the default) delivers it at the session's next turn or tool boundary.
	// - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.
	//
	// Errors:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes).
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).
	PublishSessionNoticeWithBody(ctx context.Context, params *PublishSessionNoticeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PublishSessionNotice Report a notice to a session
	//
	// Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.
	//
	// `delivery` decides when the model sees it:
	//
	// - `queue` (the default) delivers it at the session's next turn or tool boundary.
	// - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.
	//
	// Errors:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes).
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).
	PublishSessionNotice(ctx context.Context, params *PublishSessionNoticeParams, body PublishSessionNoticeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSessionPromptSnapshot Read a prompt snapshot referenced by this session
	//
	// Reads the prompt snapshot a turn's `promptSnapshotHash` names: the exact system prompt the model received for that turn. Snapshots are stored once by hash and shared by every session that produced the same prompt.
	//
	// You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`. A compaction's `promptHash` is a different hash and does not name a prompt snapshot.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.
	//
	// Corresponds with GET /session/prompt-snapshots/{promptHash} (the `GetSessionPromptSnapshot` operationId).
	GetSessionPromptSnapshot(ctx context.Context, promptHash PromptHash, params *GetSessionPromptSnapshotParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReconfigureSessionWithBody Move a workspace session to another agent space
	//
	// Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.
	//
	// On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.
	//
	// Errors, none of which changes anything:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer.
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	// - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker.
	// - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).
	ReconfigureSessionWithBody(ctx context.Context, params *ReconfigureSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReconfigureSession Move a workspace session to another agent space
	//
	// Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.
	//
	// On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.
	//
	// Errors, none of which changes anything:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer.
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	// - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker.
	// - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).
	ReconfigureSession(ctx context.Context, params *ReconfigureSessionParams, body ReconfigureSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionTurns List durable turns
	//
	// Lists the session's stored turns, newest first. A turn is one run of the agent in response to a message, from the moment Peen accepts it until it completes, fails, is cancelled or is interrupted. Each turn names the context and prompt snapshots it ran with, which you can read from `GET /session/context-snapshots/{contextHash}` and `GET /session/prompt-snapshots/{promptHash}`.
	//
	// - Ordering: by `startedAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more turn exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Corresponds with GET /session/turns (the `ListSessionTurns` operationId).
	ListSessionTurns(ctx context.Context, params *ListSessionTurnsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessionWorkers List a session's worker generations
	//
	// Lists the worker generations of the session named by `X-Session-ID`, newest first (by creation time, then ID). A generation is one worker process or container that ran the session's turns. It records the agent space and the agent space revision it started under, its lifecycle state, and for a Docker generation its container ID and image digest. A new generation starts when a session's next turn needs a worker and none is running, for example after `POST /session/reconfigure` stopped the previous one.
	//
	// Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Corresponds with GET /session/workers (the `ListSessionWorkers` operationId).
	ListSessionWorkers(ctx context.Context, params *ListSessionWorkersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSessions List every session
	//
	// Lists every session this controller holds, newest updated first (ties broken by session ID, descending). This includes one session for each opened workspace and the system session when one exists. It takes no `X-Session-ID` header, because it is how a client discovers which sessions exist.
	//
	// Each item has the same shape as `GET /session`, except that `activeTurnFeedSequence` is never set here. Page with `limit` and `offset`; `hasMore` is true when at least one more session follows this page.
	//
	// Returns 400 `VALIDATION_FAILED` for a `limit` or `offset` outside its range.
	//
	// Corresponds with GET /sessions (the `ListSessions` operationId).
	ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// OpenSessionWithBody Open or resume the session for a workspace
	//
	// Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.
	//
	// The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.
	//
	// Each workspace session has one agent space.
	//
	// - For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`).
	// - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.
	//
	// Errors, none of which creates a session:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session.
	// - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root.
	// - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist.
	// - 409 `AGENT_SPACE_CONFLICT`: see above.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /sessions/open (the `OpenSession` operationId).
	OpenSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// OpenSession Open or resume the session for a workspace
	//
	// Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.
	//
	// The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.
	//
	// Each workspace session has one agent space.
	//
	// - For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`).
	// - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.
	//
	// Errors, none of which creates a session:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session.
	// - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root.
	// - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist.
	// - 409 `AGENT_SPACE_CONFLICT`: see above.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /sessions/open (the `OpenSession` operationId).
	OpenSession(ctx context.Context, body OpenSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// OpenSystemSession Open or resume the system session
	//
	// Returns the deployment's one system session, creating it the first time, and starts no turn. The system session runs the system agent in the `control` agent space, in a directory under the controller's state directory that no client can open with `POST /sessions/open`. It takes no request body and no `X-Session-ID` header; the response carries the session ID in its body and in the `X-Session-ID` response header.
	//
	// Send the system session messages over the WebSocket with `system` set. Its agent space cannot be changed with `POST /session/reconfigure`.
	//
	// While `PEEN_SYSTEM_AGENT` is off this returns 403 `SYSTEM_AGENT_OFF` and creates nothing.
	//
	// Corresponds with POST /sessions/system (the `OpenSystemSession` operationId).
	OpenSystemSession(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListWorkspaceRoots List the workspace roots this controller may open
	//
	// Lists the workspace roots configured for this controller, so a client can offer a valid directory before it opens its first session instead of guessing a host path. It takes no `X-Session-ID` header.
	//
	// Peen currently supports one root: `PEEN_WORKSPACE_ROOT`, or the controller's working directory when that is unset, resolved through its symbolic links. `POST /sessions/open` accepts any existing directory beneath it, apart from the controller's own state and configuration directories.
	//
	// This is the deliberate, authenticated disclosure of the controller's workspace boundary. A refused `POST /sessions/open` never names a root.
	//
	// Corresponds with GET /workspace-roots (the `ListWorkspaceRoots` operationId).
	ListWorkspaceRoots(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CancelSessionAgentRunWithResponse

func (c *ClientWithResponses) CancelSessionAgentRunWithResponse(ctx context.Context, agentRunId AgentRunID, params *CancelSessionAgentRunParams, reqEditors ...RequestEditorFn) (*CancelSessionAgentRunResponse, error)

CancelSessionAgentRunWithResponse Cancel one child agent run without ending its parent turn

Cancels one child agent run and the unfinished children it launched. The parent turn and the rest of the session keep running. The request has no body.

Peen records the cancellation in the database first, then asks the session's live worker to stop the child. A child that runs as a session-worker workflow is settled as `cancelled` in the same step, so the response often already reports `cancelled`. Otherwise the run stays `running` until the worker stops it, and its events end with `agent.run.cancelled`. Repeating the request is safe: it changes nothing in the database, reports `cancelRequested: false` with the current state, and retries delivery to the worker. A session with no live worker records the cancellation, and a replacement worker applies it before starting work.

- Select the session with the `X-Session-ID` header. - A run that already ended (`completed`, `failed`, or `cancelled`) is not an error: the response reports `cancelRequested: false` and its current state. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /session/agents/{agentRunId}/cancel (the `CancelSessionAgentRun` operationId).

func (*ClientWithResponses) CancelSessionWithResponse

func (c *ClientWithResponses) CancelSessionWithResponse(ctx context.Context, params *CancelSessionParams, reqEditors ...RequestEditorFn) (*CancelSessionResponse, error)

CancelSessionWithResponse Stop the session's running work

Stops the work of the session named by `X-Session-ID` without deleting anything. It cancels a message still waiting to start a turn, interrupts the running turn in the session's worker, pauses unfinished workflows, and cancels every child agent still running, including children of turns that already ended. It takes no request body.

Peen records the stop before it interrupts the worker, and the call returns without waiting for the work to wind down. A request accepted before the stop cannot start afterward, and reconnecting does not resume paused work. A foreground `runCommand` kills its process group; background jobs already handed back keep running.

It answers 202 whether or not anything was running, so repeating it is safe. Returns 404 `SESSION_NOT_FOUND` when the session does not exist.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /session/cancel (the `CancelSession` operationId).

func (*ClientWithResponses) DeleteSessionLearnedFileWithResponse added in v0.37.0

func (c *ClientWithResponses) DeleteSessionLearnedFileWithResponse(ctx context.Context, params *DeleteSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*DeleteSessionLearnedFileResponse, error)

DeleteSessionLearnedFileWithResponse Delete one learned rule or skill

Deletes one learned rule's file, or one learned skill's whole directory (`skills/<name>/` with everything in it). The deletion is immediate and cannot be undone. The next turn and the next `changeDirectory` call resolve the harness without it; a conversation that already resolved it keeps what it loaded until then. Only files under a learned directory can be deleted this way.

- Select the session with the `X-Session-ID` header. - Returns `204` with no body on success. - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /session/learned/file (the `DeleteSessionLearnedFile` operationId).

func (*ClientWithResponses) DeleteWorkspaceFileWithResponse added in v0.51.0

func (c *ClientWithResponses) DeleteWorkspaceFileWithResponse(ctx context.Context, params *DeleteWorkspaceFileParams, reqEditors ...RequestEditorFn) (*DeleteWorkspaceFileResponse, error)

DeleteWorkspaceFileWithResponse Delete a file or empty workspace directory

Deletes one file, symbolic link or empty directory in the session's workspace and answers `204` with no body. A symbolic link is removed itself; its target is left alone, and a link whose target no longer exists can still be removed. Nothing is deleted recursively.

- A directory that still has entries answers `409 CONFLICT`. - The path follows the rules of `GET /session/files`. The workspace root cannot be deleted: an empty path or `.` answers `403 WORKSPACE_NOT_ALLOWED`. - A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /session/files (the `DeleteWorkspaceFile` operationId).

func (*ClientWithResponses) GetSessionAgentRunCompactionWithResponse added in v0.11.0

func (c *ClientWithResponses) GetSessionAgentRunCompactionWithResponse(ctx context.Context, agentRunId AgentRunID, compactionId CompactionID, params *GetSessionAgentRunCompactionParams, reqEditors ...RequestEditorFn) (*GetSessionAgentRunCompactionResponse, error)

GetSessionAgentRunCompactionWithResponse Read one immutable child compaction record

Returns one child compaction record. The record must belong to both the session and the agent run in the path.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`compaction not found`) when the run does not belong to it or the compaction belongs to another session or another run. A caller cannot use this to probe for records it does not own.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents/{agentRunId}/compactions/{compactionId} (the `GetSessionAgentRunCompaction` operationId).

func (*ClientWithResponses) GetSessionAgentRunWithResponse added in v0.4.0

func (c *ClientWithResponses) GetSessionAgentRunWithResponse(ctx context.Context, agentRunId AgentRunID, params *GetSessionAgentRunParams, reqEditors ...RequestEditorFn) (*GetSessionAgentRunResponse, error)

GetSessionAgentRunWithResponse Read one durable child agent run

Returns every stored detail of one child agent run: its parent turn and tool call, depth, task, instructions, allowed tools, system prompt, model, state, final answer, token counts, failure details, and start and end times. `waiting`, `question`, and `paused` are computed when you read the run.

`responseText` holds the whole final answer, even when the `agent.finished` session event that reported it to the root conversation was cut to fit the event size limit.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it. A run ID from another session answers the same as an unknown one.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents/{agentRunId} (the `GetSessionAgentRun` operationId).

func (*ClientWithResponses) GetSessionCompactionWithResponse added in v0.4.0

func (c *ClientWithResponses) GetSessionCompactionWithResponse(ctx context.Context, compactionId CompactionID, params *GetSessionCompactionParams, reqEditors ...RequestEditorFn) (*GetSessionCompactionResponse, error)

GetSessionCompactionWithResponse Read one durable compaction record

Reads one of the session's compaction records by ID. The record includes the message range it covers and its optional `parentCompactionId`, so you can read any point in the lineage without inferring it from message order.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`compaction not found`) when it has no compaction with this ID. A compaction of another session answers the same as an unknown one.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/compactions/{compactionId} (the `GetSessionCompaction` operationId).

func (*ClientWithResponses) GetSessionContextSnapshotWithResponse added in v0.4.0

func (c *ClientWithResponses) GetSessionContextSnapshotWithResponse(ctx context.Context, contextHash ContextHash, params *GetSessionContextSnapshotParams, reqEditors ...RequestEditorFn) (*GetSessionContextSnapshotResponse, error)

GetSessionContextSnapshotWithResponse Read a context snapshot referenced by this session

Reads the context snapshot a turn's `contextSnapshotHash` names: the harness sources the turn resolved, as a manifest, and the content Peen built from them. Snapshots are stored once by hash and shared by every session that produced the same content.

You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/context-snapshots/{contextHash} (the `GetSessionContextSnapshot` operationId).

func (*ClientWithResponses) GetSessionLearnedFileWithResponse added in v0.37.0

func (c *ClientWithResponses) GetSessionLearnedFileWithResponse(ctx context.Context, params *GetSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*GetSessionLearnedFileResponse, error)

GetSessionLearnedFileWithResponse Read one learned rule or skill

Returns one learned rule's file, or one learned skill's `SKILL.md`, as the agent saved it, with the same metadata the list returns. Name the file with `scope`, `kind`, and `name`.

A file larger than 128 KiB, which the harness skips, comes back with empty `content` and an `estimatedTokens` of 0.

- Select the session with the `X-Session-ID` header. - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep (a skill name is one segment; a rule name is at most 9). - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/learned/file (the `GetSessionLearnedFile` operationId).

func (*ClientWithResponses) GetSessionMCPStatusWithResponse added in v0.38.0

func (c *ClientWithResponses) GetSessionMCPStatusWithResponse(ctx context.Context, params *GetSessionMCPStatusParams, reqEditors ...RequestEditorFn) (*GetSessionMCPStatusResponse, error)

GetSessionMCPStatusWithResponse Report the session's MCP servers

Returns the MCP servers the session's worker last reported: which ones started, the tools each offers, and why one failed. MCP servers are configured in `.agents/mcp.json` in the config directory and, when the deployment allows workspace servers, in the session workspace.

At the start of every turn the worker reloads `mcp.json`, starts the configured servers, and records an `mcp.status` session event. A turn with no MCP configuration records an empty server list, so once `mcp.json` is removed the next turn's report is empty. This endpoint returns the servers from the most recent such event, and `reportedAt` says when it was recorded. A server that stopped after that turn started still shows as `ready` until the next turn reports.

- Select the session with the `X-Session-ID` header. - A session that has not run a turn yet returns an empty `servers` array and a null `reportedAt`. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/mcp (the `GetSessionMCPStatus` operationId).

func (*ClientWithResponses) GetSessionPromptSnapshotWithResponse added in v0.4.0

func (c *ClientWithResponses) GetSessionPromptSnapshotWithResponse(ctx context.Context, promptHash PromptHash, params *GetSessionPromptSnapshotParams, reqEditors ...RequestEditorFn) (*GetSessionPromptSnapshotResponse, error)

GetSessionPromptSnapshotWithResponse Read a prompt snapshot referenced by this session

Reads the prompt snapshot a turn's `promptSnapshotHash` names: the exact system prompt the model received for that turn. Snapshots are stored once by hash and shared by every session that produced the same prompt.

You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`. A compaction's `promptHash` is a different hash and does not name a prompt snapshot.

- Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/prompt-snapshots/{promptHash} (the `GetSessionPromptSnapshot` operationId).

func (*ClientWithResponses) GetSessionWithResponse

func (c *ClientWithResponses) GetSessionWithResponse(ctx context.Context, params *GetSessionParams, reqEditors ...RequestEditorFn) (*GetSessionResponse, error)

GetSessionWithResponse Read one session

Reads the session named by `X-Session-ID`: its counters, its agent, model, workspace, and agent space, whether a turn is running, and its newest feed sequence.

This is the only operation that sets `activeTurnFeedSequence`, the first feed sequence of the running turn. A client that connects while a turn runs can call `GET /session/feed` with `cursor` set to one less than that value to rebuild the turn's live view, then follow the WebSocket.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 `INVALID_SESSION_ID` for a malformed header.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session (the `GetSession` operationId).

func (*ClientWithResponses) ListAgentSpacesWithResponse added in v0.19.0

func (c *ClientWithResponses) ListAgentSpacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAgentSpacesResponse, error)

ListAgentSpacesWithResponse List the agent spaces a client may name

Lists the agent spaces a session may run in, sorted by name, and the default a session gets when it is opened without naming one. It takes no `X-Session-ID` header, because a client reads it before it has a session.

- `control` runs the agent where the controller runs. It is listed only when the controller cannot reach a Docker daemon. - `docker:<profile>` runs the agent in its own container, one space per Docker profile the operator configured, plus the built-in `default` profile (no Docker access, bridge network, no sudo) unless the operator redefines it.

A client names an agent space when it opens a workspace or reconfigures a session, and never sends an image, mount, network setting, or capability: the operator's configuration decides what each name means. Each Docker space reports its grants (`docker`, `network`, `sudo`), and `capabilityWarnings` carries one sentence for each risky grant.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /agent-spaces (the `ListAgentSpaces` operationId).

func (*ClientWithResponses) ListCronJobsWithResponse added in v0.51.0

func (c *ClientWithResponses) ListCronJobsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListCronJobsResponse, error)

ListCronJobsWithResponse List configured scheduled jobs

Returns every scheduled job Peen loaded from the operator's cron file at startup, sorted by name, each with its next scheduled occurrence and its most recent run. Takes no session header and no paging; the list is the whole configuration.

- While `PEEN_CRON` is off, the list is empty. Past runs stay readable through `GET /cron/runs`. - Jobs change only when Peen restarts with an edited cron file. The API cannot add, change or trigger a job.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /cron/jobs (the `ListCronJobs` operationId).

func (*ClientWithResponses) ListCronRunsWithResponse added in v0.51.0

func (c *ClientWithResponses) ListCronRunsWithResponse(ctx context.Context, params *ListCronRunsParams, reqEditors ...RequestEditorFn) (*ListCronRunsResponse, error)

ListCronRunsWithResponse List scheduled run history

Returns the durable history of scheduled runs, newest scheduled occurrence first, for every job or for one job. Each run records when it was due, how it ended, and the session it ran in. Takes no session header.

- History includes jobs that are no longer configured, and it stays readable while `PEEN_CRON` is off. - Pages with `limit` and `offset`. A `job` value that does not match the name pattern answers `400 VALIDATION_FAILED`; a valid name with no runs returns an empty page. - Open a run's conversation with its `sessionId` as `X-Session-ID` on `GET /messages`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /cron/runs (the `ListCronRuns` operationId).

func (*ClientWithResponses) ListMessagesWithResponse

func (c *ClientWithResponses) ListMessagesWithResponse(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*ListMessagesResponse, error)

ListMessagesWithResponse List a session's conversation messages

Lists the stored conversation messages of the session named by `X-Session-ID`, ordered by `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.

This is the root conversation only. A child agent's transcript is read with `GET /session/agents/{agentRunId}/messages`, and Peen's internal harness records, such as context changes and resolved prompts, are not messages and never appear here. Image bytes are never returned; `images` lists each image's media type and size.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /messages (the `ListMessages` operationId).

func (*ClientWithResponses) ListModelsWithResponse added in v0.12.0

func (c *ClientWithResponses) ListModelsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsResponse, error)

ListModelsWithResponse List the models discovered from configured connections

Lists the models Peen found on its configured connections at controller startup, sorted by `name`. It takes no `X-Session-ID` header, never makes a provider call, and never returns provider credentials.

Pass a model's `name` as `data.model` in a WebSocket `message.send` frame to run that one turn on it. The list is empty when the controller has no model catalog.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /models (the `ListModels` operationId).

func (*ClientWithResponses) ListSessionAgentRunCompactionsWithResponse added in v0.11.0

func (c *ClientWithResponses) ListSessionAgentRunCompactionsWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunCompactionsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunCompactionsResponse, error)

ListSessionAgentRunCompactionsWithResponse List one child agent run's compaction lineage

Lists one child agent run's compaction records, newest first (by `createdAt`, then ID). A child compaction summarizes a prefix of the child's own transcript. It never covers a session message and never replaces a session compaction, so this list and `GET /session/compactions` describe separate lineages.

A later compaction summarizes the earlier summary plus newer raw messages and points at the earlier record through `parentCompactionId`. The earlier record stays unchanged.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more records follow this page. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents/{agentRunId}/compactions (the `ListSessionAgentRunCompactions` operationId).

func (*ClientWithResponses) ListSessionAgentRunEventsWithResponse

func (c *ClientWithResponses) ListSessionAgentRunEventsWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunEventsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunEventsResponse, error)

ListSessionAgentRunEventsWithResponse Follow what one child agent run is doing

Returns one child agent run's stored events in order, read from the database, so the answer is complete even after a restart. These are the same `agent.run.*` steps connected WebSocket clients receive live, such as `agent.run.started`, `agent.run.text.delta`, `agent.run.tool.use`, `agent.run.tool.result`, `agent.run.question`, and the terminal `agent.run.completed`, `agent.run.failed`, or `agent.run.cancelled`. They are not part of `GET /session/events`, which lists only root-turn events.

Each run numbers its events from 1. To follow a run, start with `cursor=0`, then pass each page's `nextCursor` back as `cursor`. Poll again while `hasMore` is true or the run's `state` is still `running`.

- Select the session with the `X-Session-ID` header. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for an out-of-range `cursor` or `limit`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents/{agentRunId}/events (the `ListSessionAgentRunEvents` operationId).

func (*ClientWithResponses) ListSessionAgentRunMessagesWithResponse added in v0.11.0

func (c *ClientWithResponses) ListSessionAgentRunMessagesWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunMessagesParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunMessagesResponse, error)

ListSessionAgentRunMessagesWithResponse List one child agent run's own durable transcript

Lists one child agent run's own transcript, oldest first (by `sequence`). A child agent runs in a separate model context, so its transcript is stored apart from the session transcript, never appears under `GET /messages`, and is never absorbed by a session compaction.

The first record is the task the launching agent gave the child, as a user message in a `<message>` block that names the sender. The rest are the child's assistant messages, tool results, and the messages it received from other agents or from you. A child transcript never contains `system` messages.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more messages follow this page. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents/{agentRunId}/messages (the `ListSessionAgentRunMessages` operationId).

func (*ClientWithResponses) ListSessionAgentRunsWithResponse

func (c *ClientWithResponses) ListSessionAgentRunsWithResponse(ctx context.Context, params *ListSessionAgentRunsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunsResponse, error)

ListSessionAgentRunsWithResponse List the child agent runs this session has started

Lists the session's child agent runs, newest first (by `startedAt`, then ID). A child agent run starts when an agent in the session calls the `launchAgent` tool, either with a stored agent definition or with an inline one. Each entry is the whole stored run record, the same object `GET /session/agents/{agentRunId}` returns, including the derived `waiting`, `question`, and `paused` fields.

- Select the session with the `X-Session-ID` header. - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more runs follow this page. - A session that never launched a child returns an empty `agents` array, not an error. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `400` with code `VALIDATION_FAILED` when a query parameter or the header fails validation, including a `parentAgentRunId` that is neither an agent run ID nor `root`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agents (the `ListSessionAgentRuns` operationId).

func (*ClientWithResponses) ListSessionAgentSpaceDecisionsWithResponse added in v0.19.0

func (c *ClientWithResponses) ListSessionAgentSpaceDecisionsWithResponse(ctx context.Context, params *ListSessionAgentSpaceDecisionsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentSpaceDecisionsResponse, error)

ListSessionAgentSpaceDecisionsWithResponse List a session's agent space decisions

Lists every agent space change recorded for the session named by `X-Session-ID`, newest first (by decision time, then ID). Each entry names the agent space the session moved from, the one it moved to, and the reason the caller gave. A successful `POST /session/reconfigure` adds one entry.

Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/agent-space-decisions (the `ListSessionAgentSpaceDecisions` operationId).

func (*ClientWithResponses) ListSessionCompactionsWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionCompactionsWithResponse(ctx context.Context, params *ListSessionCompactionsParams, reqEditors ...RequestEditorFn) (*ListSessionCompactionsResponse, error)

ListSessionCompactionsWithResponse List durable compaction records

Lists the session's compaction records, newest first. When a conversation grows close to the model's context limit, Peen asks a model to summarize the oldest messages and sends the summary in their place from then on. Each compaction record holds that summary and the exact range of stored messages it replaced. A record never changes once written.

A later compaction summarizes the current summary plus the next messages, so its range starts where the earlier one started, and `parentCompactionId` points at the record it replaces. Follow the parent links to rebuild the whole lineage. Messages keep the `compactionId` of the compaction that first summarized them. Child agents keep their own compactions, under `GET /session/agents/{agentRunId}/compactions`, not here.

- Ordering: by `createdAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more record exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/compactions (the `ListSessionCompactions` operationId).

func (*ClientWithResponses) ListSessionEventsWithResponse

func (c *ClientWithResponses) ListSessionEventsWithResponse(ctx context.Context, params *ListSessionEventsParams, reqEditors ...RequestEditorFn) (*ListSessionEventsResponse, error)

ListSessionEventsWithResponse List stored protocol events

Lists the protocol events Peen stored while it ran the session's turns, such as `tool.use`, ordered by their per-session `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.

These are records of what happened, not a queue: listing never consumes or changes them. The WebSocket protocol event types table lists every `type`. To replay exactly what a live client saw, including child agent steps and notices, use `GET /session/feed` instead.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/events (the `ListSessionEvents` operationId).

func (*ClientWithResponses) ListSessionFeedWithResponse added in v0.26.0

func (c *ClientWithResponses) ListSessionFeedWithResponse(ctx context.Context, params *ListSessionFeedParams, reqEditors ...RequestEditorFn) (*ListSessionFeedResponse, error)

ListSessionFeedWithResponse Replay a session's live feed from a sequence

Returns the session's sequenced live frames with a sequence greater than `cursor`, oldest first. The feed merges three kinds of frame: root protocol events, child agent run steps (`agent.run.*`), and notices (`notice.created`). Each item has the same `type`, `data`, and `sequence` its live WebSocket frame carried, and `id` is the stored record's ID, so a client that reconnects passes the last sequence it applied as `cursor` and continues without a gap or a duplicate.

Continue with `nextCursor` while `hasMore` is true. A cursor at or past the head returns an empty page with `nextCursor` equal to the `cursor` sent. `message.completed` and `message.failed` never appear here, because they are unsequenced acknowledgements of one request.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID`, a negative `cursor`, or a `limit` outside 1 to 200.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/feed (the `ListSessionFeed` operationId).

func (*ClientWithResponses) ListSessionJobSignalRequestsWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionJobSignalRequestsWithResponse(ctx context.Context, jobId JobID, params *ListSessionJobSignalRequestsParams, reqEditors ...RequestEditorFn) (*ListSessionJobSignalRequestsResponse, error)

ListSessionJobSignalRequestsWithResponse List the durable signal-request history for one job

Lists every request to stop or kill one job, oldest first, together with the job's own record. Peen records a request whether or not it reached a running process, so the history shows requests that arrived after the job had already ended. The history stays readable after the job ends and after Peen restarts.

Requests come from `POST /session/jobs/{jobId}/signal`, from the agent's own job tools, and from Peen itself when it stops a foreground command whose turn was cancelled.

- Ordering: by `requestedAt` ascending, then `id` ascending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more request exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/jobs/{jobId}/signals (the `ListSessionJobSignalRequests` operationId).

func (*ClientWithResponses) ListSessionJobsWithResponse

func (c *ClientWithResponses) ListSessionJobsWithResponse(ctx context.Context, params *ListSessionJobsParams, reqEditors ...RequestEditorFn) (*ListSessionJobsResponse, error)

ListSessionJobsWithResponse List the commands this session has started

Lists the session's process jobs, newest first. A job is one shell command the agent started with the `runCommand` tool, in the foreground or the background. Peen records it before the process produces output and keeps the record after the process ends, after the worker stops and after Peen restarts. A job started in one turn stays listed, readable and signallable from later turns.

- Ordering: by `startedAt` descending, then `jobId` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more job exists after this page. - Filter: `state` keeps jobs in one state. - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/jobs (the `ListSessionJobs` operationId).

func (*ClientWithResponses) ListSessionLearnedFilesWithResponse added in v0.37.0

func (c *ClientWithResponses) ListSessionLearnedFilesWithResponse(ctx context.Context, params *ListSessionLearnedFilesParams, reqEditors ...RequestEditorFn) (*ListSessionLearnedFilesResponse, error)

ListSessionLearnedFilesWithResponse List the learned rules and skills this session loads

Lists the learned rules and skills the session loads, so you can review what an auto-evolving agent saved. Learned files live in two learned directories: `.agents/learned/` in the session's workspace (scope `workspace`), and the deployment's global learned directory that every session reads (scope `global`). Each holds rules under `rules/` and skills under `skills/<name>/SKILL.md`.

Workspace files come first, then global ones, each group sorted by kind (`rule` before `skill`) and then by name. Each rule says whether it loads on every turn and its estimated token count.

- Select the session with the `X-Session-ID` header. - Only regular files count. Symbolic links are left out, rule files must end in `.md`, and rule directories nested deeper than 8 levels are not read, matching what the harness loads. - A learned directory that does not exist lists nothing. The list is not paged. - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/learned (the `ListSessionLearnedFiles` operationId).

func (*ClientWithResponses) ListSessionModelRunCallsWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionModelRunCallsWithResponse(ctx context.Context, modelRunId ModelRunID, params *ListSessionModelRunCallsParams, reqEditors ...RequestEditorFn) (*ListSessionModelRunCallsResponse, error)

ListSessionModelRunCallsWithResponse Read every provider round for one model invocation

Lists the provider rounds of one model run, with the run itself. A round is one request to the provider: Peen stores the exact messages and the tool definitions the provider saw before the request is sent, then the response message, usage, retries and costs when the round ends.

Request messages repeat the whole conversation each round, and images in them are returned base64 encoded, so a page can be large. Treat the content as sensitive: it holds everything the agent read and sent.

- Ordering: by `round` ascending, then `id` ascending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more round exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`model run not found`) when it has no model run with this ID. A model run of another session answers the same as an unknown one.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/model-runs/{modelRunId}/calls (the `ListSessionModelRunCalls` operationId).

func (*ClientWithResponses) ListSessionModelRunsWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionModelRunsWithResponse(ctx context.Context, params *ListSessionModelRunsParams, reqEditors ...RequestEditorFn) (*ListSessionModelRunsResponse, error)

ListSessionModelRunsWithResponse List complete durable model invocations

Lists the session's model runs, newest first. A model run is one logical request Peen made to a model: a root turn's conversation with the model, a child agent's, or a compaction summary. One run can take several provider rounds, one per model call in a tool loop, and each round is listed by `GET /session/model-runs/{modelRunId}/calls`. Peen writes the run before any provider work starts and finalizes it when the run ends.

A run records the model it asked for and the model that answered, the settings in effect without secrets, the final text and thinking, the response messages, the summed usage, the cost amounts when the model has prices, and failure details.

- Ordering: by `startedAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more run exists after this page. - Filters: `stage` and `state`, which combine. - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset`, `stage` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/model-runs (the `ListSessionModelRuns` operationId).

func (*ClientWithResponses) ListSessionNoticesWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionNoticesWithResponse(ctx context.Context, params *ListSessionNoticesParams, reqEditors ...RequestEditorFn) (*ListSessionNoticesResponse, error)

ListSessionNoticesWithResponse List a session's notices

Lists every notice recorded for the session named by `X-Session-ID`, oldest first, whether or not it has been delivered to the model yet. Notices come from Peen's own producers (for example `tools.job` for process jobs, `agent.launchAgent` for child agents, `session.turn` for how a turn ended) and from outside callers through `POST /session/notices` (source `api`). Listing never consumes them. Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/notices (the `ListSessionNotices` operationId).

func (*ClientWithResponses) ListSessionTurnsWithResponse added in v0.4.0

func (c *ClientWithResponses) ListSessionTurnsWithResponse(ctx context.Context, params *ListSessionTurnsParams, reqEditors ...RequestEditorFn) (*ListSessionTurnsResponse, error)

ListSessionTurnsWithResponse List durable turns

Lists the session's stored turns, newest first. A turn is one run of the agent in response to a message, from the moment Peen accepts it until it completes, fails, is cancelled or is interrupted. Each turn names the context and prompt snapshots it ran with, which you can read from `GET /session/context-snapshots/{contextHash}` and `GET /session/prompt-snapshots/{promptHash}`.

- Ordering: by `startedAt` descending, then `id` descending. - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more turn exists after this page. - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/turns (the `ListSessionTurns` operationId).

func (*ClientWithResponses) ListSessionWorkersWithResponse added in v0.8.0

func (c *ClientWithResponses) ListSessionWorkersWithResponse(ctx context.Context, params *ListSessionWorkersParams, reqEditors ...RequestEditorFn) (*ListSessionWorkersResponse, error)

ListSessionWorkersWithResponse List a session's worker generations

Lists the worker generations of the session named by `X-Session-ID`, newest first (by creation time, then ID). A generation is one worker process or container that ran the session's turns. It records the agent space and the agent space revision it started under, its lifecycle state, and for a Docker generation its container ID and image digest. A new generation starts when a session's next turn needs a worker and none is running, for example after `POST /session/reconfigure` stopped the previous one.

Page with `limit` and `offset`.

Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/workers (the `ListSessionWorkers` operationId).

func (*ClientWithResponses) ListSessionsWithResponse added in v0.8.0

func (c *ClientWithResponses) ListSessionsWithResponse(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*ListSessionsResponse, error)

ListSessionsWithResponse List every session

Lists every session this controller holds, newest updated first (ties broken by session ID, descending). This includes one session for each opened workspace and the system session when one exists. It takes no `X-Session-ID` header, because it is how a client discovers which sessions exist.

Each item has the same shape as `GET /session`, except that `activeTurnFeedSequence` is never set here. Page with `limit` and `offset`; `hasMore` is true when at least one more session follows this page.

Returns 400 `VALIDATION_FAILED` for a `limit` or `offset` outside its range.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /sessions (the `ListSessions` operationId).

func (*ClientWithResponses) ListWorkspaceFilesWithResponse added in v0.51.0

func (c *ClientWithResponses) ListWorkspaceFilesWithResponse(ctx context.Context, params *ListWorkspaceFilesParams, reqEditors ...RequestEditorFn) (*ListWorkspaceFilesResponse, error)

ListWorkspaceFilesWithResponse List a workspace directory or inspect a file

Returns metadata for one path in the session's workspace directory and, when the path is a directory, its direct entries sorted by name. Hidden files are included. The listing is not recursive and not paged. A file path returns its own metadata with an empty `entries` list.

Path rules, shared by every workspace file operation:

- `path` is relative to the workspace and uses `/` separators. It must already be clean: no leading `/`, no `.` or `..` segment, no empty segment or trailing `/`, no NUL byte. A path that breaks these rules answers `403 WORKSPACE_NOT_ALLOWED` with the message `path must be a clean relative path inside the workspace`. - Symbolic links are followed while they stay inside the workspace. Naming a path that goes through a link with an absolute target, or one that resolves outside the workspace, answers the same `403`. - Entries are reported without following links: a link is `symlink`, with the size of the link itself, wherever it points. A directory that contains a link leading outside the workspace still lists, with that entry as `symlink`; its target is never read or returned. A listed path that is a link to a directory reports `symlink` and no entries. - A path that runs through a regular file, such as `README.md/x`, does not exist and answers `404 NOT_FOUND`. - The operations work on the workspace directory itself, the one the agent works in, whether or not a turn is running. They never address the system session, which answers `403 WORKSPACE_NOT_ALLOWED`.

Errors: `404 SESSION_NOT_FOUND` when the session does not exist, `404 NOT_FOUND` (`workspace path not found`) when the path does not exist, `403` as above, `400` for a malformed request.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/files (the `ListWorkspaceFiles` operationId).

func (*ClientWithResponses) ListWorkspaceRootsWithResponse added in v0.13.0

func (c *ClientWithResponses) ListWorkspaceRootsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkspaceRootsResponse, error)

ListWorkspaceRootsWithResponse List the workspace roots this controller may open

Lists the workspace roots configured for this controller, so a client can offer a valid directory before it opens its first session instead of guessing a host path. It takes no `X-Session-ID` header.

Peen currently supports one root: `PEEN_WORKSPACE_ROOT`, or the controller's working directory when that is unset, resolved through its symbolic links. `POST /sessions/open` accepts any existing directory beneath it, apart from the controller's own state and configuration directories.

This is the deliberate, authenticated disclosure of the controller's workspace boundary. A refused `POST /sessions/open` never names a root.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /workspace-roots (the `ListWorkspaceRoots` operationId).

func (*ClientWithResponses) OpenSessionWithBodyWithResponse added in v0.8.0

func (c *ClientWithResponses) OpenSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*OpenSessionResponse, error)

OpenSessionWithBodyWithResponse Open or resume the session for a workspace

Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.

The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.

Each workspace session has one agent space.

- For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`). - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.

Errors, none of which creates a session:

- 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory. - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session. - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root. - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist. - 409 `AGENT_SPACE_CONFLICT`: see above.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /sessions/open (the `OpenSession` operationId).

func (*ClientWithResponses) OpenSessionWithResponse added in v0.8.0

func (c *ClientWithResponses) OpenSessionWithResponse(ctx context.Context, body OpenSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*OpenSessionResponse, error)

OpenSessionWithResponse Open or resume the session for a workspace

Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.

The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.

Each workspace session has one agent space.

- For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`). - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.

Errors, none of which creates a session:

- 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory. - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session. - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root. - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist. - 409 `AGENT_SPACE_CONFLICT`: see above.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /sessions/open (the `OpenSession` operationId).

func (*ClientWithResponses) OpenSystemSessionWithResponse added in v0.45.0

func (c *ClientWithResponses) OpenSystemSessionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenSystemSessionResponse, error)

OpenSystemSessionWithResponse Open or resume the system session

Returns the deployment's one system session, creating it the first time, and starts no turn. The system session runs the system agent in the `control` agent space, in a directory under the controller's state directory that no client can open with `POST /sessions/open`. It takes no request body and no `X-Session-ID` header; the response carries the session ID in its body and in the `X-Session-ID` response header.

Send the system session messages over the WebSocket with `system` set. Its agent space cannot be changed with `POST /session/reconfigure`.

While `PEEN_SYSTEM_AGENT` is off this returns 403 `SYSTEM_AGENT_OFF` and creates nothing.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /sessions/system (the `OpenSystemSession` operationId).

func (*ClientWithResponses) PublishSessionNoticeWithBodyWithResponse added in v0.4.0

func (c *ClientWithResponses) PublishSessionNoticeWithBodyWithResponse(ctx context.Context, params *PublishSessionNoticeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PublishSessionNoticeResponse, error)

PublishSessionNoticeWithBodyWithResponse Report a notice to a session

Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.

`delivery` decides when the model sees it:

- `queue` (the default) delivers it at the session's next turn or tool boundary. - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.

Errors:

- 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes). - 404 `SESSION_NOT_FOUND`: the session does not exist.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).

func (*ClientWithResponses) PublishSessionNoticeWithResponse added in v0.4.0

PublishSessionNoticeWithResponse Report a notice to a session

Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.

`delivery` decides when the model sees it:

- `queue` (the default) delivers it at the session's next turn or tool boundary. - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.

Errors:

- 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes). - 404 `SESSION_NOT_FOUND`: the session does not exist.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).

func (*ClientWithResponses) ReadSessionJobOutputWithResponse

func (c *ClientWithResponses) ReadSessionJobOutputWithResponse(ctx context.Context, jobId JobID, params *ReadSessionJobOutputParams, reqEditors ...RequestEditorFn) (*ReadSessionJobOutputResponse, error)

ReadSessionJobOutputWithResponse Read a bounded window of one job's output

Reads a window of one job's stdout and stderr lines from the database without waiting for the job to finish. Peen stores every line before any client can see it, so a running job's output grows as you read it, and the same lines stay readable after the job ends or Peen restarts.

Each line carries a `sequence` number. stdout and stderr share one counter per job, starting at 1, so the sequence keeps the order Peen saw the lines in across both streams.

- Cursor: the response holds lines whose `sequence` is greater than `cursor`, oldest first. Pass `nextCursor` back as `cursor` to read the next window. To follow a running job, repeat the call until `state` is no longer `running` and `hasMore` is `false`. - Window size: `limit` lines at most, 1 to 200, default 50. - Errors: `400 VALIDATION_FAILED` for an unknown `stream`, a negative `cursor`, or a `limit` outside 1 to 200. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/jobs/{jobId}/output (the `ReadSessionJobOutput` operationId).

func (*ClientWithResponses) ReadWorkspaceFileWithResponse added in v0.51.0

func (c *ClientWithResponses) ReadWorkspaceFileWithResponse(ctx context.Context, params *ReadWorkspaceFileParams, reqEditors ...RequestEditorFn) (*ReadWorkspaceFileResponse, error)

ReadWorkspaceFileWithResponse Read a workspace file as base64

Returns the full bytes of one regular file in the session's workspace, base64 encoded, so text and binary files read the same way. A symbolic link inside the workspace is followed to its target.

- The file can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. A larger file answers `400 VALIDATION_FAILED`; there is no partial or ranged read. - A directory, device, socket or pipe answers `400 VALIDATION_FAILED`. - The path follows the rules of `GET /session/files`. A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /session/files/content (the `ReadWorkspaceFile` operationId).

func (*ClientWithResponses) ReconfigureSessionWithBodyWithResponse added in v0.8.0

func (c *ClientWithResponses) ReconfigureSessionWithBodyWithResponse(ctx context.Context, params *ReconfigureSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReconfigureSessionResponse, error)

ReconfigureSessionWithBodyWithResponse Move a workspace session to another agent space

Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.

On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.

Errors, none of which changes anything:

- 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace. - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer. - 404 `SESSION_NOT_FOUND`: the session does not exist. - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker. - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).

func (*ClientWithResponses) ReconfigureSessionWithResponse added in v0.8.0

ReconfigureSessionWithResponse Move a workspace session to another agent space

Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.

On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.

Errors, none of which changes anything:

- 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace. - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer. - 404 `SESSION_NOT_FOUND`: the session does not exist. - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker. - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).

func (*ClientWithResponses) SignalSessionJobWithBodyWithResponse

func (c *ClientWithResponses) SignalSessionJobWithBodyWithResponse(ctx context.Context, jobId JobID, params *SignalSessionJobParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignalSessionJobResponse, error)

SignalSessionJobWithBodyWithResponse Stop one running job

Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.

The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.

Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.

- Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).

func (*ClientWithResponses) SignalSessionJobWithResponse

func (c *ClientWithResponses) SignalSessionJobWithResponse(ctx context.Context, jobId JobID, params *SignalSessionJobParams, body SignalSessionJobJSONRequestBody, reqEditors ...RequestEditorFn) (*SignalSessionJobResponse, error)

SignalSessionJobWithResponse Stop one running job

Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.

The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.

Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.

- Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).

func (*ClientWithResponses) WriteWorkspaceFileWithBodyWithResponse added in v0.51.0

func (c *ClientWithResponses) WriteWorkspaceFileWithBodyWithResponse(ctx context.Context, params *WriteWorkspaceFileParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteWorkspaceFileResponse, error)

WriteWorkspaceFileWithBodyWithResponse Write a workspace file atomically

Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.

- A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept. - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced. - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`. - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way. - A session that does not exist answers `404 SESSION_NOT_FOUND`. - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB. - There is no conditional write: the last write wins. - The path follows the rules of `GET /session/files`.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).

func (*ClientWithResponses) WriteWorkspaceFileWithResponse added in v0.51.0

WriteWorkspaceFileWithResponse Write a workspace file atomically

Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.

- A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept. - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced. - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`. - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way. - A session that does not exist answers `404 SESSION_NOT_FOUND`. - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB. - There is no conditional write: the last write wins. - The path follows the rules of `GET /session/files`.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// ListAgentSpacesWithResponse List the agent spaces a client may name
	//
	// Lists the agent spaces a session may run in, sorted by name, and the default a session gets when it is opened without naming one. It takes no `X-Session-ID` header, because a client reads it before it has a session.
	//
	// - `control` runs the agent where the controller runs. It is listed only when the controller cannot reach a Docker daemon.
	// - `docker:<profile>` runs the agent in its own container, one space per Docker profile the operator configured, plus the built-in `default` profile (no Docker access, bridge network, no sudo) unless the operator redefines it.
	//
	// A client names an agent space when it opens a workspace or reconfigures a session, and never sends an image, mount, network setting, or capability: the operator's configuration decides what each name means. Each Docker space reports its grants (`docker`, `network`, `sudo`), and `capabilityWarnings` carries one sentence for each risky grant.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /agent-spaces (the `ListAgentSpaces` operationId).
	ListAgentSpacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAgentSpacesResponse, error)

	// ListCronJobsWithResponse List configured scheduled jobs
	//
	// Returns every scheduled job Peen loaded from the operator's cron file at startup, sorted by name, each with its next scheduled occurrence and its most recent run. Takes no session header and no paging; the list is the whole configuration.
	//
	// - While `PEEN_CRON` is off, the list is empty. Past runs stay readable through `GET /cron/runs`.
	// - Jobs change only when Peen restarts with an edited cron file. The API cannot add, change or trigger a job.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /cron/jobs (the `ListCronJobs` operationId).
	ListCronJobsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListCronJobsResponse, error)

	// ListCronRunsWithResponse List scheduled run history
	//
	// Returns the durable history of scheduled runs, newest scheduled occurrence first, for every job or for one job. Each run records when it was due, how it ended, and the session it ran in. Takes no session header.
	//
	// - History includes jobs that are no longer configured, and it stays readable while `PEEN_CRON` is off.
	// - Pages with `limit` and `offset`. A `job` value that does not match the name pattern answers `400 VALIDATION_FAILED`; a valid name with no runs returns an empty page.
	// - Open a run's conversation with its `sessionId` as `X-Session-ID` on `GET /messages`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /cron/runs (the `ListCronRuns` operationId).
	ListCronRunsWithResponse(ctx context.Context, params *ListCronRunsParams, reqEditors ...RequestEditorFn) (*ListCronRunsResponse, error)

	// ListMessagesWithResponse List a session's conversation messages
	//
	// Lists the stored conversation messages of the session named by `X-Session-ID`, ordered by `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.
	//
	// This is the root conversation only. A child agent's transcript is read with `GET /session/agents/{agentRunId}/messages`, and Peen's internal harness records, such as context changes and resolved prompts, are not messages and never appear here. Image bytes are never returned; `images` lists each image's media type and size.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /messages (the `ListMessages` operationId).
	ListMessagesWithResponse(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*ListMessagesResponse, error)

	// ListModelsWithResponse List the models discovered from configured connections
	//
	// Lists the models Peen found on its configured connections at controller startup, sorted by `name`. It takes no `X-Session-ID` header, never makes a provider call, and never returns provider credentials.
	//
	// Pass a model's `name` as `data.model` in a WebSocket `message.send` frame to run that one turn on it. The list is empty when the controller has no model catalog.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /models (the `ListModels` operationId).
	ListModelsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsResponse, error)

	// GetSessionWithResponse Read one session
	//
	// Reads the session named by `X-Session-ID`: its counters, its agent, model, workspace, and agent space, whether a turn is running, and its newest feed sequence.
	//
	// This is the only operation that sets `activeTurnFeedSequence`, the first feed sequence of the running turn. A client that connects while a turn runs can call `GET /session/feed` with `cursor` set to one less than that value to rebuild the turn's live view, then follow the WebSocket.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 `INVALID_SESSION_ID` for a malformed header.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session (the `GetSession` operationId).
	GetSessionWithResponse(ctx context.Context, params *GetSessionParams, reqEditors ...RequestEditorFn) (*GetSessionResponse, error)

	// ListSessionAgentSpaceDecisionsWithResponse List a session's agent space decisions
	//
	// Lists every agent space change recorded for the session named by `X-Session-ID`, newest first (by decision time, then ID). Each entry names the agent space the session moved from, the one it moved to, and the reason the caller gave. A successful `POST /session/reconfigure` adds one entry.
	//
	// Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agent-space-decisions (the `ListSessionAgentSpaceDecisions` operationId).
	ListSessionAgentSpaceDecisionsWithResponse(ctx context.Context, params *ListSessionAgentSpaceDecisionsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentSpaceDecisionsResponse, error)

	// ListSessionAgentRunsWithResponse List the child agent runs this session has started
	//
	// Lists the session's child agent runs, newest first (by `startedAt`, then ID). A child agent run starts when an agent in the session calls the `launchAgent` tool, either with a stored agent definition or with an inline one. Each entry is the whole stored run record, the same object `GET /session/agents/{agentRunId}` returns, including the derived `waiting`, `question`, and `paused` fields.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more runs follow this page.
	// - A session that never launched a child returns an empty `agents` array, not an error.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `400` with code `VALIDATION_FAILED` when a query parameter or the header fails validation, including a `parentAgentRunId` that is neither an agent run ID nor `root`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents (the `ListSessionAgentRuns` operationId).
	ListSessionAgentRunsWithResponse(ctx context.Context, params *ListSessionAgentRunsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunsResponse, error)

	// GetSessionAgentRunWithResponse Read one durable child agent run
	//
	// Returns every stored detail of one child agent run: its parent turn and tool call, depth, task, instructions, allowed tools, system prompt, model, state, final answer, token counts, failure details, and start and end times. `waiting`, `question`, and `paused` are computed when you read the run.
	//
	// `responseText` holds the whole final answer, even when the `agent.finished` session event that reported it to the root conversation was cut to fit the event size limit.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it. A run ID from another session answers the same as an unknown one.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents/{agentRunId} (the `GetSessionAgentRun` operationId).
	GetSessionAgentRunWithResponse(ctx context.Context, agentRunId AgentRunID, params *GetSessionAgentRunParams, reqEditors ...RequestEditorFn) (*GetSessionAgentRunResponse, error)

	// CancelSessionAgentRunWithResponse Cancel one child agent run without ending its parent turn
	//
	// Cancels one child agent run and the unfinished children it launched. The parent turn and the rest of the session keep running. The request has no body.
	//
	// Peen records the cancellation in the database first, then asks the session's live worker to stop the child. A child that runs as a session-worker workflow is settled as `cancelled` in the same step, so the response often already reports `cancelled`. Otherwise the run stays `running` until the worker stops it, and its events end with `agent.run.cancelled`. Repeating the request is safe: it changes nothing in the database, reports `cancelRequested: false` with the current state, and retries delivery to the worker. A session with no live worker records the cancellation, and a replacement worker applies it before starting work.
	//
	// - Select the session with the `X-Session-ID` header.
	// - A run that already ended (`completed`, `failed`, or `cancelled`) is not an error: the response reports `cancelRequested: false` and its current state.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/agents/{agentRunId}/cancel (the `CancelSessionAgentRun` operationId).
	CancelSessionAgentRunWithResponse(ctx context.Context, agentRunId AgentRunID, params *CancelSessionAgentRunParams, reqEditors ...RequestEditorFn) (*CancelSessionAgentRunResponse, error)

	// ListSessionAgentRunCompactionsWithResponse List one child agent run's compaction lineage
	//
	// Lists one child agent run's compaction records, newest first (by `createdAt`, then ID). A child compaction summarizes a prefix of the child's own transcript. It never covers a session message and never replaces a session compaction, so this list and `GET /session/compactions` describe separate lineages.
	//
	// A later compaction summarizes the earlier summary plus newer raw messages and points at the earlier record through `parentCompactionId`. The earlier record stays unchanged.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more records follow this page.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents/{agentRunId}/compactions (the `ListSessionAgentRunCompactions` operationId).
	ListSessionAgentRunCompactionsWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunCompactionsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunCompactionsResponse, error)

	// GetSessionAgentRunCompactionWithResponse Read one immutable child compaction record
	//
	// Returns one child compaction record. The record must belong to both the session and the agent run in the path.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`compaction not found`) when the run does not belong to it or the compaction belongs to another session or another run. A caller cannot use this to probe for records it does not own.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents/{agentRunId}/compactions/{compactionId} (the `GetSessionAgentRunCompaction` operationId).
	GetSessionAgentRunCompactionWithResponse(ctx context.Context, agentRunId AgentRunID, compactionId CompactionID, params *GetSessionAgentRunCompactionParams, reqEditors ...RequestEditorFn) (*GetSessionAgentRunCompactionResponse, error)

	// ListSessionAgentRunEventsWithResponse Follow what one child agent run is doing
	//
	// Returns one child agent run's stored events in order, read from the database, so the answer is complete even after a restart. These are the same `agent.run.*` steps connected WebSocket clients receive live, such as `agent.run.started`, `agent.run.text.delta`, `agent.run.tool.use`, `agent.run.tool.result`, `agent.run.question`, and the terminal `agent.run.completed`, `agent.run.failed`, or `agent.run.cancelled`. They are not part of `GET /session/events`, which lists only root-turn events.
	//
	// Each run numbers its events from 1. To follow a run, start with `cursor=0`, then pass each page's `nextCursor` back as `cursor`. Poll again while `hasMore` is true or the run's `state` is still `running`.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for an out-of-range `cursor` or `limit`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents/{agentRunId}/events (the `ListSessionAgentRunEvents` operationId).
	ListSessionAgentRunEventsWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunEventsParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunEventsResponse, error)

	// ListSessionAgentRunMessagesWithResponse List one child agent run's own durable transcript
	//
	// Lists one child agent run's own transcript, oldest first (by `sequence`). A child agent runs in a separate model context, so its transcript is stored apart from the session transcript, never appears under `GET /messages`, and is never absorbed by a session compaction.
	//
	// The first record is the task the launching agent gave the child, as a user message in a `<message>` block that names the sender. The rest are the child's assistant messages, tool results, and the messages it received from other agents or from you. A child transcript never contains `system` messages.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Paging uses `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is true when more messages follow this page.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, `404` with code `NOT_FOUND` (`agent run not found`) when the run does not belong to it, and `400` with code `VALIDATION_FAILED` for invalid paging values.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/agents/{agentRunId}/messages (the `ListSessionAgentRunMessages` operationId).
	ListSessionAgentRunMessagesWithResponse(ctx context.Context, agentRunId AgentRunID, params *ListSessionAgentRunMessagesParams, reqEditors ...RequestEditorFn) (*ListSessionAgentRunMessagesResponse, error)

	// CancelSessionWithResponse Stop the session's running work
	//
	// Stops the work of the session named by `X-Session-ID` without deleting anything. It cancels a message still waiting to start a turn, interrupts the running turn in the session's worker, pauses unfinished workflows, and cancels every child agent still running, including children of turns that already ended. It takes no request body.
	//
	// Peen records the stop before it interrupts the worker, and the call returns without waiting for the work to wind down. A request accepted before the stop cannot start afterward, and reconnecting does not resume paused work. A foreground `runCommand` kills its process group; background jobs already handed back keep running.
	//
	// It answers 202 whether or not anything was running, so repeating it is safe. Returns 404 `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/cancel (the `CancelSession` operationId).
	CancelSessionWithResponse(ctx context.Context, params *CancelSessionParams, reqEditors ...RequestEditorFn) (*CancelSessionResponse, error)

	// ListSessionCompactionsWithResponse List durable compaction records
	//
	// Lists the session's compaction records, newest first. When a conversation grows close to the model's context limit, Peen asks a model to summarize the oldest messages and sends the summary in their place from then on. Each compaction record holds that summary and the exact range of stored messages it replaced. A record never changes once written.
	//
	// A later compaction summarizes the current summary plus the next messages, so its range starts where the earlier one started, and `parentCompactionId` points at the record it replaces. Follow the parent links to rebuild the whole lineage. Messages keep the `compactionId` of the compaction that first summarized them. Child agents keep their own compactions, under `GET /session/agents/{agentRunId}/compactions`, not here.
	//
	// - Ordering: by `createdAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more record exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/compactions (the `ListSessionCompactions` operationId).
	ListSessionCompactionsWithResponse(ctx context.Context, params *ListSessionCompactionsParams, reqEditors ...RequestEditorFn) (*ListSessionCompactionsResponse, error)

	// GetSessionCompactionWithResponse Read one durable compaction record
	//
	// Reads one of the session's compaction records by ID. The record includes the message range it covers and its optional `parentCompactionId`, so you can read any point in the lineage without inferring it from message order.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`compaction not found`) when it has no compaction with this ID. A compaction of another session answers the same as an unknown one.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/compactions/{compactionId} (the `GetSessionCompaction` operationId).
	GetSessionCompactionWithResponse(ctx context.Context, compactionId CompactionID, params *GetSessionCompactionParams, reqEditors ...RequestEditorFn) (*GetSessionCompactionResponse, error)

	// GetSessionContextSnapshotWithResponse Read a context snapshot referenced by this session
	//
	// Reads the context snapshot a turn's `contextSnapshotHash` names: the harness sources the turn resolved, as a manifest, and the content Peen built from them. Snapshots are stored once by hash and shared by every session that produced the same content.
	//
	// You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/context-snapshots/{contextHash} (the `GetSessionContextSnapshot` operationId).
	GetSessionContextSnapshotWithResponse(ctx context.Context, contextHash ContextHash, params *GetSessionContextSnapshotParams, reqEditors ...RequestEditorFn) (*GetSessionContextSnapshotResponse, error)

	// ListSessionEventsWithResponse List stored protocol events
	//
	// Lists the protocol events Peen stored while it ran the session's turns, such as `tool.use`, ordered by their per-session `sequence`. `order` is `asc` (oldest first, the default) or `desc`. Page with `limit` and `offset`.
	//
	// These are records of what happened, not a queue: listing never consumes or changes them. The WebSocket protocol event types table lists every `type`. To replay exactly what a live client saw, including child agent steps and notices, use `GET /session/feed` instead.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit`, `offset`, or `order`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/events (the `ListSessionEvents` operationId).
	ListSessionEventsWithResponse(ctx context.Context, params *ListSessionEventsParams, reqEditors ...RequestEditorFn) (*ListSessionEventsResponse, error)

	// ListSessionFeedWithResponse Replay a session's live feed from a sequence
	//
	// Returns the session's sequenced live frames with a sequence greater than `cursor`, oldest first. The feed merges three kinds of frame: root protocol events, child agent run steps (`agent.run.*`), and notices (`notice.created`). Each item has the same `type`, `data`, and `sequence` its live WebSocket frame carried, and `id` is the stored record's ID, so a client that reconnects passes the last sequence it applied as `cursor` and continues without a gap or a duplicate.
	//
	// Continue with `nextCursor` while `hasMore` is true. A cursor at or past the head returns an empty page with `nextCursor` equal to the `cursor` sent. `message.completed` and `message.failed` never appear here, because they are unsequenced acknowledgements of one request.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID`, a negative `cursor`, or a `limit` outside 1 to 200.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/feed (the `ListSessionFeed` operationId).
	ListSessionFeedWithResponse(ctx context.Context, params *ListSessionFeedParams, reqEditors ...RequestEditorFn) (*ListSessionFeedResponse, error)

	// DeleteWorkspaceFileWithResponse Delete a file or empty workspace directory
	//
	// Deletes one file, symbolic link or empty directory in the session's workspace and answers `204` with no body. A symbolic link is removed itself; its target is left alone, and a link whose target no longer exists can still be removed. Nothing is deleted recursively.
	//
	// - A directory that still has entries answers `409 CONFLICT`.
	// - The path follows the rules of `GET /session/files`. The workspace root cannot be deleted: an empty path or `.` answers `403 WORKSPACE_NOT_ALLOWED`.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /session/files (the `DeleteWorkspaceFile` operationId).
	DeleteWorkspaceFileWithResponse(ctx context.Context, params *DeleteWorkspaceFileParams, reqEditors ...RequestEditorFn) (*DeleteWorkspaceFileResponse, error)

	// ListWorkspaceFilesWithResponse List a workspace directory or inspect a file
	//
	// Returns metadata for one path in the session's workspace directory and, when the path is a directory, its direct entries sorted by name. Hidden files are included. The listing is not recursive and not paged. A file path returns its own metadata with an empty `entries` list.
	//
	// Path rules, shared by every workspace file operation:
	//
	// - `path` is relative to the workspace and uses `/` separators. It must already be clean: no leading `/`, no `.` or `..` segment, no empty segment or trailing `/`, no NUL byte. A path that breaks these rules answers `403 WORKSPACE_NOT_ALLOWED` with the message `path must be a clean relative path inside the workspace`.
	// - Symbolic links are followed while they stay inside the workspace. Naming a path that goes through a link with an absolute target, or one that resolves outside the workspace, answers the same `403`.
	// - Entries are reported without following links: a link is `symlink`, with the size of the link itself, wherever it points. A directory that contains a link leading outside the workspace still lists, with that entry as `symlink`; its target is never read or returned. A listed path that is a link to a directory reports `symlink` and no entries.
	// - A path that runs through a regular file, such as `README.md/x`, does not exist and answers `404 NOT_FOUND`.
	// - The operations work on the workspace directory itself, the one the agent works in, whether or not a turn is running. They never address the system session, which answers `403 WORKSPACE_NOT_ALLOWED`.
	//
	// Errors: `404 SESSION_NOT_FOUND` when the session does not exist, `404 NOT_FOUND` (`workspace path not found`) when the path does not exist, `403` as above, `400` for a malformed request.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/files (the `ListWorkspaceFiles` operationId).
	ListWorkspaceFilesWithResponse(ctx context.Context, params *ListWorkspaceFilesParams, reqEditors ...RequestEditorFn) (*ListWorkspaceFilesResponse, error)

	// ReadWorkspaceFileWithResponse Read a workspace file as base64
	//
	// Returns the full bytes of one regular file in the session's workspace, base64 encoded, so text and binary files read the same way. A symbolic link inside the workspace is followed to its target.
	//
	// - The file can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. A larger file answers `400 VALIDATION_FAILED`; there is no partial or ranged read.
	// - A directory, device, socket or pipe answers `400 VALIDATION_FAILED`.
	// - The path follows the rules of `GET /session/files`. A session that does not exist answers `404 SESSION_NOT_FOUND`, and a path that does not exist answers `404 NOT_FOUND`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/files/content (the `ReadWorkspaceFile` operationId).
	ReadWorkspaceFileWithResponse(ctx context.Context, params *ReadWorkspaceFileParams, reqEditors ...RequestEditorFn) (*ReadWorkspaceFileResponse, error)

	// WriteWorkspaceFileWithBodyWithResponse Write a workspace file atomically
	//
	// Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.
	//
	// - A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept.
	// - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced.
	// - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`.
	// - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`.
	// - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB.
	// - There is no conditional write: the last write wins.
	// - The path follows the rules of `GET /session/files`.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).
	WriteWorkspaceFileWithBodyWithResponse(ctx context.Context, params *WriteWorkspaceFileParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteWorkspaceFileResponse, error)

	// WriteWorkspaceFileWithResponse Write a workspace file atomically
	//
	// Creates or replaces one regular file in the session's workspace with the decoded bytes, and returns the written file's metadata. Peen writes a temporary file in the same directory and renames it into place, so a reader sees either the old content or the new content, never a partial file.
	//
	// - A new file gets mode `0640`. Replacing a file also sets `0640`; its earlier permissions are not kept.
	// - When the path is a symbolic link to a regular file inside the workspace, the link's target is replaced.
	// - A path that is an existing directory or another non-regular file answers `400 VALIDATION_FAILED`.
	// - A missing parent directory answers `404 NOT_FOUND` unless `createDirectories` is `true`, which creates the missing parents with mode `0750`. A parent path that runs through a regular file answers `404 NOT_FOUND` either way.
	// - A session that does not exist answers `404 SESSION_NOT_FOUND`.
	// - Decoded content can be at most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default. Larger content, or content that is not valid base64, answers `400 VALIDATION_FAILED`. The request body limit for this operation is the base64 length of that maximum plus 64 KiB.
	// - There is no conditional write: the last write wins.
	// - The path follows the rules of `GET /session/files`.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /session/files/content (the `WriteWorkspaceFile` operationId).
	WriteWorkspaceFileWithResponse(ctx context.Context, params *WriteWorkspaceFileParams, body WriteWorkspaceFileJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteWorkspaceFileResponse, error)

	// ListSessionJobsWithResponse List the commands this session has started
	//
	// Lists the session's process jobs, newest first. A job is one shell command the agent started with the `runCommand` tool, in the foreground or the background. Peen records it before the process produces output and keeps the record after the process ends, after the worker stops and after Peen restarts. A job started in one turn stays listed, readable and signallable from later turns.
	//
	// - Ordering: by `startedAt` descending, then `jobId` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more job exists after this page.
	// - Filter: `state` keeps jobs in one state.
	// - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/jobs (the `ListSessionJobs` operationId).
	ListSessionJobsWithResponse(ctx context.Context, params *ListSessionJobsParams, reqEditors ...RequestEditorFn) (*ListSessionJobsResponse, error)

	// ReadSessionJobOutputWithResponse Read a bounded window of one job's output
	//
	// Reads a window of one job's stdout and stderr lines from the database without waiting for the job to finish. Peen stores every line before any client can see it, so a running job's output grows as you read it, and the same lines stay readable after the job ends or Peen restarts.
	//
	// Each line carries a `sequence` number. stdout and stderr share one counter per job, starting at 1, so the sequence keeps the order Peen saw the lines in across both streams.
	//
	// - Cursor: the response holds lines whose `sequence` is greater than `cursor`, oldest first. Pass `nextCursor` back as `cursor` to read the next window. To follow a running job, repeat the call until `state` is no longer `running` and `hasMore` is `false`.
	// - Window size: `limit` lines at most, 1 to 200, default 50.
	// - Errors: `400 VALIDATION_FAILED` for an unknown `stream`, a negative `cursor`, or a `limit` outside 1 to 200. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/jobs/{jobId}/output (the `ReadSessionJobOutput` operationId).
	ReadSessionJobOutputWithResponse(ctx context.Context, jobId JobID, params *ReadSessionJobOutputParams, reqEditors ...RequestEditorFn) (*ReadSessionJobOutputResponse, error)

	// SignalSessionJobWithBodyWithResponse Stop one running job
	//
	// Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.
	//
	// The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.
	//
	// Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.
	//
	// - Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).
	SignalSessionJobWithBodyWithResponse(ctx context.Context, jobId JobID, params *SignalSessionJobParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignalSessionJobResponse, error)

	// SignalSessionJobWithResponse Stop one running job
	//
	// Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. `stop` sends `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. `kill` sends `SIGKILL` at once.
	//
	// The call returns `202` as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from `GET /session/jobs` or its output endpoint to see the final state, normally `signalled`.
	//
	// Every call adds a record to the job's signal history (`GET /session/jobs/{jobId}/signals`). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns `signalled: false` with the job's current state.
	//
	// - Errors: `400 VALIDATION_FAILED` when the body is missing, `signal` is missing or not `stop` or `kill`, or the body has another field. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/jobs/{jobId}/signal (the `SignalSessionJob` operationId).
	SignalSessionJobWithResponse(ctx context.Context, jobId JobID, params *SignalSessionJobParams, body SignalSessionJobJSONRequestBody, reqEditors ...RequestEditorFn) (*SignalSessionJobResponse, error)

	// ListSessionJobSignalRequestsWithResponse List the durable signal-request history for one job
	//
	// Lists every request to stop or kill one job, oldest first, together with the job's own record. Peen records a request whether or not it reached a running process, so the history shows requests that arrived after the job had already ended. The history stays readable after the job ends and after Peen restarts.
	//
	// Requests come from `POST /session/jobs/{jobId}/signal`, from the agent's own job tools, and from Peen itself when it stops a foreground command whose turn was cancelled.
	//
	// - Ordering: by `requestedAt` ascending, then `id` ascending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more request exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`job not found`) when it has no job with this ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/jobs/{jobId}/signals (the `ListSessionJobSignalRequests` operationId).
	ListSessionJobSignalRequestsWithResponse(ctx context.Context, jobId JobID, params *ListSessionJobSignalRequestsParams, reqEditors ...RequestEditorFn) (*ListSessionJobSignalRequestsResponse, error)

	// ListSessionLearnedFilesWithResponse List the learned rules and skills this session loads
	//
	// Lists the learned rules and skills the session loads, so you can review what an auto-evolving agent saved. Learned files live in two learned directories: `.agents/learned/` in the session's workspace (scope `workspace`), and the deployment's global learned directory that every session reads (scope `global`). Each holds rules under `rules/` and skills under `skills/<name>/SKILL.md`.
	//
	// Workspace files come first, then global ones, each group sorted by kind (`rule` before `skill`) and then by name. Each rule says whether it loads on every turn and its estimated token count.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Only regular files count. Symbolic links are left out, rule files must end in `.md`, and rule directories nested deeper than 8 levels are not read, matching what the harness loads.
	// - A learned directory that does not exist lists nothing. The list is not paged.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/learned (the `ListSessionLearnedFiles` operationId).
	ListSessionLearnedFilesWithResponse(ctx context.Context, params *ListSessionLearnedFilesParams, reqEditors ...RequestEditorFn) (*ListSessionLearnedFilesResponse, error)

	// DeleteSessionLearnedFileWithResponse Delete one learned rule or skill
	//
	// Deletes one learned rule's file, or one learned skill's whole directory (`skills/<name>/` with everything in it). The deletion is immediate and cannot be undone. The next turn and the next `changeDirectory` call resolve the harness without it; a conversation that already resolved it keeps what it loaded until then. Only files under a learned directory can be deleted this way.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `204` with no body on success.
	// - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /session/learned/file (the `DeleteSessionLearnedFile` operationId).
	DeleteSessionLearnedFileWithResponse(ctx context.Context, params *DeleteSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*DeleteSessionLearnedFileResponse, error)

	// GetSessionLearnedFileWithResponse Read one learned rule or skill
	//
	// Returns one learned rule's file, or one learned skill's `SKILL.md`, as the agent saved it, with the same metadata the list returns. Name the file with `scope`, `kind`, and `name`.
	//
	// A file larger than 128 KiB, which the harness skips, comes back with empty `content` and an `estimatedTokens` of 0.
	//
	// - Select the session with the `X-Session-ID` header.
	// - Returns `400` with code `VALIDATION_FAILED` when `name` has an empty, `.`, or `..` segment, contains a backslash, or is nested too deep (a skill name is one segment; a rule name is at most 9).
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist, and `404` with code `NOT_FOUND` (`learned file not found`) when the deployment has no global learned directory (for `scope=global`), or the file does not exist, is not a regular file, or resolves outside its learned directory through a symbolic link.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/learned/file (the `GetSessionLearnedFile` operationId).
	GetSessionLearnedFileWithResponse(ctx context.Context, params *GetSessionLearnedFileParams, reqEditors ...RequestEditorFn) (*GetSessionLearnedFileResponse, error)

	// GetSessionMCPStatusWithResponse Report the session's MCP servers
	//
	// Returns the MCP servers the session's worker last reported: which ones started, the tools each offers, and why one failed. MCP servers are configured in `.agents/mcp.json` in the config directory and, when the deployment allows workspace servers, in the session workspace.
	//
	// At the start of every turn the worker reloads `mcp.json`, starts the configured servers, and records an `mcp.status` session event. A turn with no MCP configuration records an empty server list, so once `mcp.json` is removed the next turn's report is empty. This endpoint returns the servers from the most recent such event, and `reportedAt` says when it was recorded. A server that stopped after that turn started still shows as `ready` until the next turn reports.
	//
	// - Select the session with the `X-Session-ID` header.
	// - A session that has not run a turn yet returns an empty `servers` array and a null `reportedAt`.
	// - Returns `404` with code `SESSION_NOT_FOUND` when the session does not exist.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/mcp (the `GetSessionMCPStatus` operationId).
	GetSessionMCPStatusWithResponse(ctx context.Context, params *GetSessionMCPStatusParams, reqEditors ...RequestEditorFn) (*GetSessionMCPStatusResponse, error)

	// ListSessionModelRunsWithResponse List complete durable model invocations
	//
	// Lists the session's model runs, newest first. A model run is one logical request Peen made to a model: a root turn's conversation with the model, a child agent's, or a compaction summary. One run can take several provider rounds, one per model call in a tool loop, and each round is listed by `GET /session/model-runs/{modelRunId}/calls`. Peen writes the run before any provider work starts and finalizes it when the run ends.
	//
	// A run records the model it asked for and the model that answered, the settings in effect without secrets, the final text and thinking, the response messages, the summed usage, the cost amounts when the model has prices, and failure details.
	//
	// - Ordering: by `startedAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more run exists after this page.
	// - Filters: `stage` and `state`, which combine.
	// - Errors: `400 VALIDATION_FAILED` for a `limit`, `offset`, `stage` or `state` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/model-runs (the `ListSessionModelRuns` operationId).
	ListSessionModelRunsWithResponse(ctx context.Context, params *ListSessionModelRunsParams, reqEditors ...RequestEditorFn) (*ListSessionModelRunsResponse, error)

	// ListSessionModelRunCallsWithResponse Read every provider round for one model invocation
	//
	// Lists the provider rounds of one model run, with the run itself. A round is one request to the provider: Peen stores the exact messages and the tool definitions the provider saw before the request is sent, then the response message, usage, retries and costs when the round ends.
	//
	// Request messages repeat the whole conversation each round, and images in them are returned base64 encoded, so a page can be large. Treat the content as sensitive: it holds everything the agent read and sent.
	//
	// - Ordering: by `round` ascending, then `id` ascending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more round exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND` (`model run not found`) when it has no model run with this ID. A model run of another session answers the same as an unknown one.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/model-runs/{modelRunId}/calls (the `ListSessionModelRunCalls` operationId).
	ListSessionModelRunCallsWithResponse(ctx context.Context, modelRunId ModelRunID, params *ListSessionModelRunCallsParams, reqEditors ...RequestEditorFn) (*ListSessionModelRunCallsResponse, error)

	// ListSessionNoticesWithResponse List a session's notices
	//
	// Lists every notice recorded for the session named by `X-Session-ID`, oldest first, whether or not it has been delivered to the model yet. Notices come from Peen's own producers (for example `tools.job` for process jobs, `agent.launchAgent` for child agents, `session.turn` for how a turn ended) and from outside callers through `POST /session/notices` (source `api`). Listing never consumes them. Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/notices (the `ListSessionNotices` operationId).
	ListSessionNoticesWithResponse(ctx context.Context, params *ListSessionNoticesParams, reqEditors ...RequestEditorFn) (*ListSessionNoticesResponse, error)

	// PublishSessionNoticeWithBodyWithResponse Report a notice to a session
	//
	// Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.
	//
	// `delivery` decides when the model sees it:
	//
	// - `queue` (the default) delivers it at the session's next turn or tool boundary.
	// - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.
	//
	// Errors:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes).
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).
	PublishSessionNoticeWithBodyWithResponse(ctx context.Context, params *PublishSessionNoticeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PublishSessionNoticeResponse, error)

	// PublishSessionNoticeWithResponse Report a notice to a session
	//
	// Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by `X-Session-ID`. The notice is stored with source `api`, sent to live clients as a `notice.created` feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.
	//
	// `delivery` decides when the model sees it:
	//
	// - `queue` (the default) delivers it at the session's next turn or tool boundary.
	// - `wake` also starts a turn when the session is idle and a handler for the notice's `type` exists at `.agents/events/<type>.md` in a harness layer. A handler that sets its own `delivery` overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.
	//
	// Errors:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed; `type` is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; `type` starts with a reserved prefix (`job.`, `agent.`, `turn.`); `summary` is empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes); or `data` encodes to more than `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes).
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/notices (the `PublishSessionNotice` operationId).
	PublishSessionNoticeWithResponse(ctx context.Context, params *PublishSessionNoticeParams, body PublishSessionNoticeJSONRequestBody, reqEditors ...RequestEditorFn) (*PublishSessionNoticeResponse, error)

	// GetSessionPromptSnapshotWithResponse Read a prompt snapshot referenced by this session
	//
	// Reads the prompt snapshot a turn's `promptSnapshotHash` names: the exact system prompt the model received for that turn. Snapshots are stored once by hash and shared by every session that produced the same prompt.
	//
	// You can read a snapshot only through a session that has a turn naming it. Pass the hash from one of this session's turns in `GET /session/turns`. A compaction's `promptHash` is a different hash and does not name a prompt snapshot.
	//
	// - Errors: `404 SESSION_NOT_FOUND` when the session does not exist, and `404 NOT_FOUND`, with a message naming the snapshot, when none of its turns names this hash or no snapshot has it. A hash that only another session's turns name answers the same as an unknown one.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/prompt-snapshots/{promptHash} (the `GetSessionPromptSnapshot` operationId).
	GetSessionPromptSnapshotWithResponse(ctx context.Context, promptHash PromptHash, params *GetSessionPromptSnapshotParams, reqEditors ...RequestEditorFn) (*GetSessionPromptSnapshotResponse, error)

	// ReconfigureSessionWithBodyWithResponse Move a workspace session to another agent space
	//
	// Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.
	//
	// On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.
	//
	// Errors, none of which changes anything:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer.
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	// - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker.
	// - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).
	ReconfigureSessionWithBodyWithResponse(ctx context.Context, params *ReconfigureSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReconfigureSessionResponse, error)

	// ReconfigureSessionWithResponse Move a workspace session to another agent space
	//
	// Changes the agent space of the session named by `X-Session-ID`. The client names only an agent space and never sends an image, mount, network setting, or capability.
	//
	// On success Peen records the decision with the caller's `reason` and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in `GET /session/agent-space-decisions`.
	//
	// Errors, none of which changes anything:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing, has an unknown field, leaves out `agentSpace` or `reason`, or `reason` is only whitespace.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: the session is the system session, which always stays in `control`, whatever `agentSpace` names (message `the system session's agent space cannot be changed`); or `agentSpace` names an agent space the deployment does not offer.
	// - 404 `SESSION_NOT_FOUND`: the session does not exist.
	// - 409 `CONFLICT`: `agentSpace` names the agent space the workspace already runs in. Peen records no decision and stops no worker.
	// - 409 `SESSION_BUSY`: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /session/reconfigure (the `ReconfigureSession` operationId).
	ReconfigureSessionWithResponse(ctx context.Context, params *ReconfigureSessionParams, body ReconfigureSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*ReconfigureSessionResponse, error)

	// ListSessionTurnsWithResponse List durable turns
	//
	// Lists the session's stored turns, newest first. A turn is one run of the agent in response to a message, from the moment Peen accepts it until it completes, fails, is cancelled or is interrupted. Each turn names the context and prompt snapshots it ran with, which you can read from `GET /session/context-snapshots/{contextHash}` and `GET /session/prompt-snapshots/{promptHash}`.
	//
	// - Ordering: by `startedAt` descending, then `id` descending.
	// - Paging: `limit` (1 to 200, default 50) and `offset` (default 0). `hasMore` is `true` when at least one more turn exists after this page.
	// - Errors: `400 VALIDATION_FAILED` for a `limit` or `offset` outside the allowed values. `404 SESSION_NOT_FOUND` when no session has the `X-Session-ID` ID.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/turns (the `ListSessionTurns` operationId).
	ListSessionTurnsWithResponse(ctx context.Context, params *ListSessionTurnsParams, reqEditors ...RequestEditorFn) (*ListSessionTurnsResponse, error)

	// ListSessionWorkersWithResponse List a session's worker generations
	//
	// Lists the worker generations of the session named by `X-Session-ID`, newest first (by creation time, then ID). A generation is one worker process or container that ran the session's turns. It records the agent space and the agent space revision it started under, its lifecycle state, and for a Docker generation its container ID and image digest. A new generation starts when a session's next turn needs a worker and none is running, for example after `POST /session/reconfigure` stopped the previous one.
	//
	// Page with `limit` and `offset`.
	//
	// Returns 404 `SESSION_NOT_FOUND` when the session does not exist, and 400 for a malformed `X-Session-ID` or an out-of-range `limit` or `offset`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /session/workers (the `ListSessionWorkers` operationId).
	ListSessionWorkersWithResponse(ctx context.Context, params *ListSessionWorkersParams, reqEditors ...RequestEditorFn) (*ListSessionWorkersResponse, error)

	// ListSessionsWithResponse List every session
	//
	// Lists every session this controller holds, newest updated first (ties broken by session ID, descending). This includes one session for each opened workspace and the system session when one exists. It takes no `X-Session-ID` header, because it is how a client discovers which sessions exist.
	//
	// Each item has the same shape as `GET /session`, except that `activeTurnFeedSequence` is never set here. Page with `limit` and `offset`; `hasMore` is true when at least one more session follows this page.
	//
	// Returns 400 `VALIDATION_FAILED` for a `limit` or `offset` outside its range.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /sessions (the `ListSessions` operationId).
	ListSessionsWithResponse(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*ListSessionsResponse, error)

	// OpenSessionWithBodyWithResponse Open or resume the session for a workspace
	//
	// Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.
	//
	// The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.
	//
	// Each workspace session has one agent space.
	//
	// - For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`).
	// - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.
	//
	// Errors, none of which creates a session:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session.
	// - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root.
	// - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist.
	// - 409 `AGENT_SPACE_CONFLICT`: see above.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /sessions/open (the `OpenSession` operationId).
	OpenSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*OpenSessionResponse, error)

	// OpenSessionWithResponse Open or resume the session for a workspace
	//
	// Resolves a workspace directory to its session and returns it, creating the session the first time the directory is opened. This is the only REST operation that creates a workspace session, so a controller starts with none and a client must name the workspace it wants. `POST /sessions/system` creates the system session. It takes no `X-Session-ID` header; use the returned `session.id` as `X-Session-ID` on later REST calls and as `metadata.sessionId` on the WebSocket. The response also carries it in the `X-Session-ID` response header.
	//
	// The path is resolved through its symbolic links, so opening the same directory again by any of its names resumes the same session. All entry points targeting that directory use its session.
	//
	// Each workspace session has one agent space.
	//
	// - For a workspace with no session yet, `agentSpace` picks the agent space. Leaving it out gives the deployment default (`default` in `GET /agent-spaces`).
	// - For a workspace with a session, leaving `agentSpace` out or naming its current space reuses the session. Naming a different one returns 409 `AGENT_SPACE_CONFLICT`, whose message names the workspace's current agent space. Use `POST /session/reconfigure` to move the workspace on purpose.
	//
	// Errors, none of which creates a session:
	//
	// - 400 `VALIDATION_FAILED`: the body is missing or malformed, `workspace` is empty, or the path is not a directory.
	// - 403 `AGENT_SPACE_NOT_ALLOWED`: `agentSpace` names an agent space the deployment does not offer. This is checked first, even when the workspace already has a session.
	// - 403 `WORKSPACE_NOT_ALLOWED`: the path is outside every configured workspace root (before or after resolving symbolic links), or the workspace is, contains, or sits inside the controller's state directory, or is or contains its configuration directory. The message never names a root.
	// - 404 `WORKSPACE_NOT_FOUND`: the path is beneath a configured root but the directory does not exist.
	// - 409 `AGENT_SPACE_CONFLICT`: see above.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /sessions/open (the `OpenSession` operationId).
	OpenSessionWithResponse(ctx context.Context, body OpenSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*OpenSessionResponse, error)

	// OpenSystemSessionWithResponse Open or resume the system session
	//
	// Returns the deployment's one system session, creating it the first time, and starts no turn. The system session runs the system agent in the `control` agent space, in a directory under the controller's state directory that no client can open with `POST /sessions/open`. It takes no request body and no `X-Session-ID` header; the response carries the session ID in its body and in the `X-Session-ID` response header.
	//
	// Send the system session messages over the WebSocket with `system` set. Its agent space cannot be changed with `POST /session/reconfigure`.
	//
	// While `PEEN_SYSTEM_AGENT` is off this returns 403 `SYSTEM_AGENT_OFF` and creates nothing.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /sessions/system (the `OpenSystemSession` operationId).
	OpenSystemSessionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenSystemSessionResponse, error)

	// ListWorkspaceRootsWithResponse List the workspace roots this controller may open
	//
	// Lists the workspace roots configured for this controller, so a client can offer a valid directory before it opens its first session instead of guessing a host path. It takes no `X-Session-ID` header.
	//
	// Peen currently supports one root: `PEEN_WORKSPACE_ROOT`, or the controller's working directory when that is unset, resolved through its symbolic links. `POST /sessions/open` accepts any existing directory beneath it, apart from the controller's own state and configuration directories.
	//
	// This is the deliberate, authenticated disclosure of the controller's workspace boundary. A refused `POST /sessions/open` never names a root.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /workspace-roots (the `ListWorkspaceRoots` operationId).
	ListWorkspaceRootsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkspaceRootsResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Compaction added in v0.4.0

type Compaction struct {
	// CreatedAt When Peen stored the record, as an RFC 3339 timestamp.
	CreatedAt time.Time `json:"createdAt"`

	// FromMessageId ID of the first stored message the summary covers. For a compaction with a parent, this is where the parent's range started.
	FromMessageId openapi_types.UUID `json:"fromMessageId"`

	// FromSequence Session message sequence of the first covered message, inclusive.
	FromSequence int64 `json:"fromSequence"`

	// Id The compaction record's ID. Messages it summarized carry it as their `compactionId`.
	Id openapi_types.UUID `json:"id"`

	// InputTokenCount Prompt tokens the provider reported for the summarizing request.
	InputTokenCount int64 `json:"inputTokenCount"`

	// Model The model ID the provider reported for the summarizing request.
	Model string `json:"model"`

	// ParentCompactionId The earlier compaction this one replaces, when it summarized that compaction's summary plus newer messages. Absent for the first compaction in a lineage.
	ParentCompactionId *openapi_types.UUID `json:"parentCompactionId,omitempty"`

	// PromptHash Lowercase hex SHA-256 of the compaction instructions used to write the summary, so you can tell which version of the instructions produced it. It does not name a prompt snapshot.
	PromptHash string `json:"promptHash"`

	// SessionId The session this compaction belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// SourceMessageCount How many stored messages the summary covers, including those its parent already covered.
	SourceMessageCount int64 `json:"sourceMessageCount"`

	// Summary The summary text the model receives in place of the covered messages.
	Summary string `json:"summary"`

	// SummaryTokenCount Completion tokens the provider reported for the summary.
	SummaryTokenCount int64 `json:"summaryTokenCount"`

	// ToMessageId ID of the last stored message the summary covers.
	ToMessageId openapi_types.UUID `json:"toMessageId"`

	// ToSequence Session message sequence of the last covered message, inclusive.
	ToSequence int64 `json:"toSequence"`
}

Compaction One stored summary that replaced a range of the session's messages in what the model receives. A record never changes once written. It appears in `CompactionPage` and as the response of `GET /session/compactions/{compactionId}`.

type CompactionID added in v0.4.0

type CompactionID = openapi_types.UUID

CompactionID defines model for CompactionID.

type CompactionPage added in v0.4.0

type CompactionPage struct {
	// Compactions The compaction records on this page, ordered by `createdAt` descending.
	Compactions []Compaction `json:"compactions"`

	// HasMore `true` when at least one more record exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of records skipped before this page.
	Offset int32 `json:"offset"`
}

CompactionPage One page of a session's compaction records, newest first, returned by `GET /session/compactions`.

type ContextHash added in v0.4.0

type ContextHash = string

ContextHash defines model for ContextHash.

type ContextManifestEntry added in v0.8.0

type ContextManifestEntry struct {
	// Hash Lowercase hex SHA-256 of the source file's content.
	Hash string `json:"hash"`

	// Kind What the source is.
	//
	// - `instruction`: an instruction file such as `AGENTS.md`.
	// - `rule`: a rule file.
	// - `skill`: a skill.
	// - `agent`: a stored agent definition.
	// - `event-handler`: a notice handler.
	// - `hook`: a hook group.
	Kind string `json:"kind"`

	// Name The source's name within its kind: a rule's path under `rules/` without `.md`, a skill's or agent's name, an event handler's notice type, or a hook's event name. Empty for an instruction file.
	Name string `json:"name"`

	// Priority The layer the source came from. Built-in instructions are -1, the configuration layer is 0, and the number grows for layers closer to the workspace, so a higher number is more specific. Skills, agents and event handlers report 0.
	Priority int32 `json:"priority"`

	// Source Where the source came from: the file's path, or an `embedded://` address for a file built into Peen.
	Source string `json:"source"`
}

ContextManifestEntry One harness source a context snapshot was resolved from, such as an instruction file, a rule, a skill, an agent definition, an event handler or a hook file.

type ContextSnapshot added in v0.4.0

type ContextSnapshot struct {
	// CreatedAt When Peen first stored this snapshot, as an RFC 3339 timestamp. A later turn that produces the same hash reuses the row and leaves this unchanged.
	CreatedAt time.Time `json:"createdAt"`

	// Hash Lowercase hex SHA-256 that identifies the snapshot, computed over the resolved harness sources and the resolved content. A turn names it in `contextSnapshotHash`.
	Hash string `json:"hash"`

	// Manifest The harness sources this context was resolved from. Instruction and rule files come first, in resolution order from the built-in files and the configuration layer down to the workspace, followed by skills, agents, event handlers and hooks. The same name can appear at more than one layer, which is why this is a list.
	Manifest []ContextManifestEntry `json:"manifest"`

	// ResolvedContent The system prompt Peen built from these sources for the turn, including any context pre-user-message hooks added.
	ResolvedContent string `json:"resolvedContent"`
}

ContextSnapshot The harness context one or more turns ran with, stored once by hash. It holds the manifest of sources Peen resolved and the content it built from them. Returned by `GET /session/context-snapshots/{contextHash}`.

type CronJob added in v0.51.0

type CronJob struct {
	// LastRun One durable record of a scheduled occurrence: when it was due, how it ended, and the session it ran in. Records are kept for jobs that are no longer configured.
	LastRun *CronRun `json:"lastRun,omitempty"`

	// Name The job's unique name, 1 to 64 ASCII letters, digits, underscores or hyphens. Filter `GET /cron/runs` with it.
	Name string `json:"name"`

	// NextScheduledAt The next occurrence the scheduler will fire, as an RFC 3339 UTC time.
	NextScheduledAt time.Time `json:"nextScheduledAt"`

	// Schedule The schedule exactly as written in the cron file, such as `0 9 * * *`, a six-field expression with leading seconds, or a descriptor such as `@daily` or `@every 30m`.
	Schedule string `json:"schedule"`

	// TimeZone The IANA time zone the schedule is evaluated in, such as `UTC` or `Europe/Berlin`. `UTC` when the cron file leaves it out.
	TimeZone string `json:"timeZone"`
}

CronJob One scheduled job loaded from the operator's cron file at startup, as `GET /cron/jobs` reports it.

type CronJobList added in v0.51.0

type CronJobList struct {
	// Items The scheduled jobs, sorted by `name`. Not paged.
	Items []CronJob `json:"items"`
}

CronJobList All scheduled jobs loaded at startup, sorted by name. Empty while `PEEN_CRON` is off.

type CronRun added in v0.51.0

type CronRun struct {
	// Error A fixed reason for a `failed`, `cancelled` or `skipped` run, one of `scheduled run failed`, `scheduled turn failed`, `scheduled turn cancelled`, `scheduled turn timed out`, `previous run still running`, `workspace session is busy`, `controller was offline`, `scheduled turn interrupted`, `workspace unavailable`, `session unavailable`, `workspace agent space conflict` or `scheduled output invalid`. It never holds prompts, provider errors or schemas. Absent on running and completed runs. Treat any other value as an unknown failure.
	Error *string `json:"error,omitempty"`

	// FinishedAt When the run ended, as an RFC 3339 time. Absent while the run is `running`.
	FinishedAt *time.Time `json:"finishedAt,omitempty"`

	// Id The run's ID. The scheduled turn uses the same value as its request ID, so the run's turn is the one whose `requestId` matches.
	Id openapi_types.UUID `json:"id"`

	// JobName The name of the job this run belongs to.
	JobName string `json:"jobName"`

	// ScheduledAt The occurrence this run was for, as an RFC 3339 UTC time. A job never records two runs for the same occurrence.
	ScheduledAt time.Time `json:"scheduledAt"`

	// SessionId The session the run's turn used. Pass it as `X-Session-ID` to read the conversation. Absent when no session was opened: on a run skipped because the previous run was still going or the controller was offline, and on a run whose session could not be prepared. A run skipped because the workspace session was busy names that session.
	SessionId *openapi_types.UUID `json:"sessionId,omitempty"`

	// StartedAt When Peen began the run, as an RFC 3339 time. Absent on a run skipped because the previous run was still going or the controller was offline. A run skipped because the workspace session was busy has it, because Peen began that run before it found the session busy.
	StartedAt *time.Time `json:"startedAt,omitempty"`

	// State The state of a scheduled run. After downtime Peen records one `skipped` run for the latest missed occurrence and does not replay missed work.
	//
	// - `running`: the run is in progress.
	// - `completed`: the turn finished, with valid structured output when the job asked for it.
	// - `failed`: the run or its turn failed, including a turn that ended without valid structured output; `error` says why.
	// - `cancelled`: the turn was cancelled or reached its deadline; `error` says which.
	// - `skipped`: the occurrence did not run because the job's previous run was still going, the workspace session already had an active turn, or the controller was offline at the time; `error` says why.
	State CronRunState `json:"state"`
}

CronRun One durable record of a scheduled occurrence: when it was due, how it ended, and the session it ran in. Records are kept for jobs that are no longer configured.

type CronRunPage added in v0.51.0

type CronRunPage struct {
	// HasMore `true` when more runs follow this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Items The runs on this page, ordered by `scheduledAt`, newest first.
	Items []CronRun `json:"items"`

	// Limit The page size used, 50 when the request left `limit` out.
	Limit int32 `json:"limit"`

	// Offset The number of runs skipped before this page.
	Offset int32 `json:"offset"`
}

CronRunPage One page of scheduled runs, newest scheduled occurrence first, as `GET /cron/runs` returns it.

type CronRunState added in v0.51.0

type CronRunState string

CronRunState The state of a scheduled run. After downtime Peen records one `skipped` run for the latest missed occurrence and does not replay missed work.

- `running`: the run is in progress. - `completed`: the turn finished, with valid structured output when the job asked for it. - `failed`: the run or its turn failed, including a turn that ended without valid structured output; `error` says why. - `cancelled`: the turn was cancelled or reached its deadline; `error` says which. - `skipped`: the occurrence did not run because the job's previous run was still going, the workspace session already had an active turn, or the controller was offline at the time; `error` says why.

const (
	CronRunStateCancelled CronRunState = "cancelled"
	CronRunStateCompleted CronRunState = "completed"
	CronRunStateFailed    CronRunState = "failed"
	CronRunStateRunning   CronRunState = "running"
	CronRunStateSkipped   CronRunState = "skipped"
)

Defines values for CronRunState.

func (CronRunState) Valid added in v0.51.0

func (e CronRunState) Valid() bool

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

type DeleteSessionLearnedFileParams added in v0.37.0

type DeleteSessionLearnedFileParams struct {
	// Scope Which learned directory the file lives in. `workspace` is `.agents/learned/` in the session's workspace; `global` is the global learned directory every session reads, `PEEN_CONFIG_DIR/.agents/learned/` unless `PEEN_LEARNED_DIR` moves it.
	Scope LearnedScope `form:"scope" json:"scope"`

	// Kind Whether the name refers to a learned `rule`, a Markdown file under `rules/`, or a learned `skill`, a directory under `skills/` that holds a `SKILL.md`.
	Kind LearnedKind `form:"kind" json:"kind"`

	// Name The learned file's name, as the `name` field of `GET /session/learned` reports it. For a rule it is the path under `rules/` without `.md`, such as `go-errors` or `go/errors`, with at most 8 directory levels. For a skill it is the skill's directory name and cannot contain `/`. A name with an empty, `.` or `..` segment, or a backslash, answers `400`.
	Name LearnedName `form:"name" json:"name"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

DeleteSessionLearnedFileParams defines parameters for DeleteSessionLearnedFile.

type DeleteSessionLearnedFileResponse added in v0.37.0

type DeleteSessionLearnedFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers204 the parsed response headers for an HTTP 204 response
	Headers204 *DeleteSessionLearnedFileResponse204Headers
}

func ParseDeleteSessionLearnedFileResponse added in v0.37.0

func ParseDeleteSessionLearnedFileResponse(rsp *http.Response) (*DeleteSessionLearnedFileResponse, error)

ParseDeleteSessionLearnedFileResponse parses an HTTP response from a DeleteSessionLearnedFileWithResponse call

func (DeleteSessionLearnedFileResponse) ContentType added in v0.37.0

func (r DeleteSessionLearnedFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteSessionLearnedFileResponse) GetBody added in v0.37.0

func (r DeleteSessionLearnedFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteSessionLearnedFileResponse) GetJSON400 added in v0.37.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DeleteSessionLearnedFileResponse) GetJSON401 added in v0.37.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DeleteSessionLearnedFileResponse) GetJSON404 added in v0.37.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DeleteSessionLearnedFileResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (DeleteSessionLearnedFileResponse) GetJSON500 added in v0.37.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (DeleteSessionLearnedFileResponse) Status added in v0.37.0

Status returns HTTPResponse.Status

func (DeleteSessionLearnedFileResponse) StatusCode added in v0.37.0

func (r DeleteSessionLearnedFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteSessionLearnedFileResponse204Headers added in v0.37.0

type DeleteSessionLearnedFileResponse204Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

DeleteSessionLearnedFileResponse204Headers the declared response headers of an HTTP 204 response for DeleteSessionLearnedFile

type DeleteWorkspaceFileParams added in v0.51.0

type DeleteWorkspaceFileParams struct {
	// Path The path to delete, relative to the workspace, such as `notes/draft.md`.
	Path string `form:"path" json:"path"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

DeleteWorkspaceFileParams defines parameters for DeleteWorkspaceFile.

type DeleteWorkspaceFileResponse added in v0.51.0

type DeleteWorkspaceFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ErrorConflict
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers204 the parsed response headers for an HTTP 204 response
	Headers204 *DeleteWorkspaceFileResponse204Headers
}

func ParseDeleteWorkspaceFileResponse added in v0.51.0

func ParseDeleteWorkspaceFileResponse(rsp *http.Response) (*DeleteWorkspaceFileResponse, error)

ParseDeleteWorkspaceFileResponse parses an HTTP response from a DeleteWorkspaceFileWithResponse call

func (DeleteWorkspaceFileResponse) ContentType added in v0.51.0

func (r DeleteWorkspaceFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteWorkspaceFileResponse) GetBody added in v0.51.0

func (r DeleteWorkspaceFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteWorkspaceFileResponse) GetJSON400 added in v0.51.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON401 added in v0.51.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON403 added in v0.51.0

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON404 added in v0.51.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON409 added in v0.51.0

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (DeleteWorkspaceFileResponse) GetJSON500 added in v0.51.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (DeleteWorkspaceFileResponse) Status added in v0.51.0

Status returns HTTPResponse.Status

func (DeleteWorkspaceFileResponse) StatusCode added in v0.51.0

func (r DeleteWorkspaceFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteWorkspaceFileResponse204Headers added in v0.51.0

type DeleteWorkspaceFileResponse204Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

DeleteWorkspaceFileResponse204Headers the declared response headers of an HTTP 204 response for DeleteWorkspaceFile

type Error

type Error struct {
	// Code A stable, machine-readable error code such as `VALIDATION_FAILED` or `SESSION_NOT_FOUND`. Branch on this value.
	Code string `json:"code"`

	// Message Short, human-readable text safe to show a user. It never contains source paths or credentials, and its wording can change between versions.
	Message string `json:"message"`
}

Error The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorBadRequest

type ErrorBadRequest = Error

ErrorBadRequest The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorConflict

type ErrorConflict = Error

ErrorConflict The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorForbidden added in v0.8.0

type ErrorForbidden = Error

ErrorForbidden The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorInternal

type ErrorInternal = Error

ErrorInternal The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorNotAcceptable

type ErrorNotAcceptable = Error

ErrorNotAcceptable The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorNotFound

type ErrorNotFound = Error

ErrorNotFound The body of every REST error response. The table on the API's front page lists each `code`.

type ErrorUnauthorized

type ErrorUnauthorized = Error

ErrorUnauthorized The body of every REST error response. The table on the API's front page lists each `code`.

type FeedFrame added in v0.26.0

type FeedFrame struct {
	// CreatedAt When the record was stored, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// Data The frame's data, exactly as sent live. For a protocol event it is the event payload. For an `agent.run.*` frame it is an object with `agentRunId`, `parentTurnId`, `parentAgentRunId` (absent for a child of the root conversation), and `event`, the child's event payload. For `notice.created` it is the notice, in the shape of `SessionNotice`.
	Data interface{} `json:"data"`

	// Id ID of the stored record (protocol event, child agent run event, or notice), also the live frame's `id`.
	Id openapi_types.UUID `json:"id"`

	// RequestId The request ID of the turn that produced a root protocol event. Null for child agent steps and notices.
	RequestId *openapi_types.UUID `json:"requestId"`

	// Sequence Position in the session feed. Consecutive across all frame kinds, starting at 1.
	Sequence int64 `json:"sequence"`

	// SessionId The session the frame belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// Type The frame type: a protocol event type such as `tool.use`, an `agent.run.*` type for a child agent step, or `notice.created` for a notice.
	Type string `json:"type"`
}

FeedFrame One sequenced frame of a session's live feed, as `GET /session/feed` replays it. It carries the same `type`, `data`, and `sequence` the WebSocket frame carried when it was sent live.

type FeedPage added in v0.26.0

type FeedPage struct {
	// HasMore True when more frames follow this page.
	HasMore bool `json:"hasMore"`

	// Head The session's newest feed sequence when the page was read.
	Head int64 `json:"head"`

	// Items Frames with a sequence greater than the requested `cursor`, oldest first.
	Items []FeedFrame `json:"items"`

	// Limit The page size this response used: the requested `limit`, or 100 when none was sent.
	Limit int32 `json:"limit"`

	// NextCursor Pass back as `cursor` to continue. It is the sequence of the last frame in `items`, or the `cursor` sent when the page is empty.
	NextCursor int64 `json:"nextCursor"`
}

FeedPage One page of `GET /session/feed`, oldest first.

type GetSessionAgentRunCompactionParams added in v0.11.0

type GetSessionAgentRunCompactionParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionAgentRunCompactionParams defines parameters for GetSessionAgentRunCompaction.

type GetSessionAgentRunCompactionResponse added in v0.11.0

type GetSessionAgentRunCompactionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRunCompaction
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionAgentRunCompactionResponse200Headers
}

func ParseGetSessionAgentRunCompactionResponse added in v0.11.0

func ParseGetSessionAgentRunCompactionResponse(rsp *http.Response) (*GetSessionAgentRunCompactionResponse, error)

ParseGetSessionAgentRunCompactionResponse parses an HTTP response from a GetSessionAgentRunCompactionWithResponse call

func (GetSessionAgentRunCompactionResponse) ContentType added in v0.11.0

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionAgentRunCompactionResponse) GetBody added in v0.11.0

GetBody returns the raw response body bytes

func (GetSessionAgentRunCompactionResponse) GetJSON200 added in v0.11.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionAgentRunCompactionResponse) GetJSON400 added in v0.11.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionAgentRunCompactionResponse) GetJSON401 added in v0.11.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionAgentRunCompactionResponse) GetJSON404 added in v0.11.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionAgentRunCompactionResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionAgentRunCompactionResponse) GetJSON500 added in v0.11.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionAgentRunCompactionResponse) Status added in v0.11.0

Status returns HTTPResponse.Status

func (GetSessionAgentRunCompactionResponse) StatusCode added in v0.11.0

StatusCode returns HTTPResponse.StatusCode

type GetSessionAgentRunCompactionResponse200Headers added in v0.11.0

type GetSessionAgentRunCompactionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionAgentRunCompactionResponse200Headers the declared response headers of an HTTP 200 response for GetSessionAgentRunCompaction

type GetSessionAgentRunParams added in v0.4.0

type GetSessionAgentRunParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionAgentRunParams defines parameters for GetSessionAgentRun.

type GetSessionAgentRunResponse added in v0.4.0

type GetSessionAgentRunResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRun
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionAgentRunResponse200Headers
}

func ParseGetSessionAgentRunResponse added in v0.4.0

func ParseGetSessionAgentRunResponse(rsp *http.Response) (*GetSessionAgentRunResponse, error)

ParseGetSessionAgentRunResponse parses an HTTP response from a GetSessionAgentRunWithResponse call

func (GetSessionAgentRunResponse) ContentType added in v0.4.0

func (r GetSessionAgentRunResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionAgentRunResponse) GetBody added in v0.4.0

func (r GetSessionAgentRunResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionAgentRunResponse) GetJSON200 added in v0.4.0

func (r GetSessionAgentRunResponse) GetJSON200() *AgentRun

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionAgentRunResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionAgentRunResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionAgentRunResponse) GetJSON404 added in v0.4.0

func (r GetSessionAgentRunResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionAgentRunResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionAgentRunResponse) GetJSON500 added in v0.4.0

func (r GetSessionAgentRunResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionAgentRunResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (GetSessionAgentRunResponse) StatusCode added in v0.4.0

func (r GetSessionAgentRunResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionAgentRunResponse200Headers added in v0.4.0

type GetSessionAgentRunResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionAgentRunResponse200Headers the declared response headers of an HTTP 200 response for GetSessionAgentRun

type GetSessionCompactionParams added in v0.4.0

type GetSessionCompactionParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionCompactionParams defines parameters for GetSessionCompaction.

type GetSessionCompactionResponse added in v0.4.0

type GetSessionCompactionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Compaction
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionCompactionResponse200Headers
}

func ParseGetSessionCompactionResponse added in v0.4.0

func ParseGetSessionCompactionResponse(rsp *http.Response) (*GetSessionCompactionResponse, error)

ParseGetSessionCompactionResponse parses an HTTP response from a GetSessionCompactionWithResponse call

func (GetSessionCompactionResponse) ContentType added in v0.4.0

func (r GetSessionCompactionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionCompactionResponse) GetBody added in v0.4.0

func (r GetSessionCompactionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionCompactionResponse) GetJSON200 added in v0.4.0

func (r GetSessionCompactionResponse) GetJSON200() *Compaction

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionCompactionResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionCompactionResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionCompactionResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionCompactionResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionCompactionResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionCompactionResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (GetSessionCompactionResponse) StatusCode added in v0.4.0

func (r GetSessionCompactionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionCompactionResponse200Headers added in v0.4.0

type GetSessionCompactionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionCompactionResponse200Headers the declared response headers of an HTTP 200 response for GetSessionCompaction

type GetSessionContextSnapshotParams added in v0.4.0

type GetSessionContextSnapshotParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionContextSnapshotParams defines parameters for GetSessionContextSnapshot.

type GetSessionContextSnapshotResponse added in v0.4.0

type GetSessionContextSnapshotResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ContextSnapshot
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionContextSnapshotResponse200Headers
}

func ParseGetSessionContextSnapshotResponse added in v0.4.0

func ParseGetSessionContextSnapshotResponse(rsp *http.Response) (*GetSessionContextSnapshotResponse, error)

ParseGetSessionContextSnapshotResponse parses an HTTP response from a GetSessionContextSnapshotWithResponse call

func (GetSessionContextSnapshotResponse) ContentType added in v0.4.0

func (r GetSessionContextSnapshotResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionContextSnapshotResponse) GetBody added in v0.4.0

GetBody returns the raw response body bytes

func (GetSessionContextSnapshotResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionContextSnapshotResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionContextSnapshotResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionContextSnapshotResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionContextSnapshotResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionContextSnapshotResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionContextSnapshotResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (GetSessionContextSnapshotResponse) StatusCode added in v0.4.0

func (r GetSessionContextSnapshotResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionContextSnapshotResponse200Headers added in v0.4.0

type GetSessionContextSnapshotResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionContextSnapshotResponse200Headers the declared response headers of an HTTP 200 response for GetSessionContextSnapshot

type GetSessionLearnedFileParams added in v0.37.0

type GetSessionLearnedFileParams struct {
	// Scope Which learned directory the file lives in. `workspace` is `.agents/learned/` in the session's workspace; `global` is the global learned directory every session reads, `PEEN_CONFIG_DIR/.agents/learned/` unless `PEEN_LEARNED_DIR` moves it.
	Scope LearnedScope `form:"scope" json:"scope"`

	// Kind Whether the name refers to a learned `rule`, a Markdown file under `rules/`, or a learned `skill`, a directory under `skills/` that holds a `SKILL.md`.
	Kind LearnedKind `form:"kind" json:"kind"`

	// Name The learned file's name, as the `name` field of `GET /session/learned` reports it. For a rule it is the path under `rules/` without `.md`, such as `go-errors` or `go/errors`, with at most 8 directory levels. For a skill it is the skill's directory name and cannot contain `/`. A name with an empty, `.` or `..` segment, or a backslash, answers `400`.
	Name LearnedName `form:"name" json:"name"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionLearnedFileParams defines parameters for GetSessionLearnedFile.

type GetSessionLearnedFileResponse added in v0.37.0

type GetSessionLearnedFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *LearnedFileContent
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionLearnedFileResponse200Headers
}

func ParseGetSessionLearnedFileResponse added in v0.37.0

func ParseGetSessionLearnedFileResponse(rsp *http.Response) (*GetSessionLearnedFileResponse, error)

ParseGetSessionLearnedFileResponse parses an HTTP response from a GetSessionLearnedFileWithResponse call

func (GetSessionLearnedFileResponse) ContentType added in v0.37.0

func (r GetSessionLearnedFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionLearnedFileResponse) GetBody added in v0.37.0

func (r GetSessionLearnedFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionLearnedFileResponse) GetJSON200 added in v0.37.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionLearnedFileResponse) GetJSON400 added in v0.37.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionLearnedFileResponse) GetJSON401 added in v0.37.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionLearnedFileResponse) GetJSON404 added in v0.37.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionLearnedFileResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionLearnedFileResponse) GetJSON500 added in v0.37.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionLearnedFileResponse) Status added in v0.37.0

Status returns HTTPResponse.Status

func (GetSessionLearnedFileResponse) StatusCode added in v0.37.0

func (r GetSessionLearnedFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionLearnedFileResponse200Headers added in v0.37.0

type GetSessionLearnedFileResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionLearnedFileResponse200Headers the declared response headers of an HTTP 200 response for GetSessionLearnedFile

type GetSessionMCPStatusParams added in v0.38.0

type GetSessionMCPStatusParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionMCPStatusParams defines parameters for GetSessionMCPStatus.

type GetSessionMCPStatusResponse added in v0.38.0

type GetSessionMCPStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *MCPStatusReport
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionMCPStatusResponse200Headers
}

func ParseGetSessionMCPStatusResponse added in v0.38.0

func ParseGetSessionMCPStatusResponse(rsp *http.Response) (*GetSessionMCPStatusResponse, error)

ParseGetSessionMCPStatusResponse parses an HTTP response from a GetSessionMCPStatusWithResponse call

func (GetSessionMCPStatusResponse) ContentType added in v0.38.0

func (r GetSessionMCPStatusResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionMCPStatusResponse) GetBody added in v0.38.0

func (r GetSessionMCPStatusResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionMCPStatusResponse) GetJSON200 added in v0.38.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionMCPStatusResponse) GetJSON400 added in v0.38.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionMCPStatusResponse) GetJSON401 added in v0.38.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionMCPStatusResponse) GetJSON404 added in v0.38.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionMCPStatusResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionMCPStatusResponse) GetJSON500 added in v0.38.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionMCPStatusResponse) Status added in v0.38.0

Status returns HTTPResponse.Status

func (GetSessionMCPStatusResponse) StatusCode added in v0.38.0

func (r GetSessionMCPStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionMCPStatusResponse200Headers added in v0.38.0

type GetSessionMCPStatusResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionMCPStatusResponse200Headers the declared response headers of an HTTP 200 response for GetSessionMCPStatus

type GetSessionParams

type GetSessionParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionParams defines parameters for GetSession.

type GetSessionPromptSnapshotParams added in v0.4.0

type GetSessionPromptSnapshotParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

GetSessionPromptSnapshotParams defines parameters for GetSessionPromptSnapshot.

type GetSessionPromptSnapshotResponse added in v0.4.0

type GetSessionPromptSnapshotResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PromptSnapshot
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionPromptSnapshotResponse200Headers
}

func ParseGetSessionPromptSnapshotResponse added in v0.4.0

func ParseGetSessionPromptSnapshotResponse(rsp *http.Response) (*GetSessionPromptSnapshotResponse, error)

ParseGetSessionPromptSnapshotResponse parses an HTTP response from a GetSessionPromptSnapshotWithResponse call

func (GetSessionPromptSnapshotResponse) ContentType added in v0.4.0

func (r GetSessionPromptSnapshotResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionPromptSnapshotResponse) GetBody added in v0.4.0

func (r GetSessionPromptSnapshotResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionPromptSnapshotResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionPromptSnapshotResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionPromptSnapshotResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionPromptSnapshotResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionPromptSnapshotResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionPromptSnapshotResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionPromptSnapshotResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (GetSessionPromptSnapshotResponse) StatusCode added in v0.4.0

func (r GetSessionPromptSnapshotResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionPromptSnapshotResponse200Headers added in v0.4.0

type GetSessionPromptSnapshotResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionPromptSnapshotResponse200Headers the declared response headers of an HTTP 200 response for GetSessionPromptSnapshot

type GetSessionResponse

type GetSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Session
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetSessionResponse200Headers
}

func ParseGetSessionResponse

func ParseGetSessionResponse(rsp *http.Response) (*GetSessionResponse, error)

ParseGetSessionResponse parses an HTTP response from a GetSessionWithResponse call

func (GetSessionResponse) ContentType

func (r GetSessionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSessionResponse) GetBody

func (r GetSessionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSessionResponse) GetJSON200

func (r GetSessionResponse) GetJSON200() *Session

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSessionResponse) GetJSON400

func (r GetSessionResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSessionResponse) GetJSON401

func (r GetSessionResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetSessionResponse) GetJSON404

func (r GetSessionResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSessionResponse) GetJSON406 added in v0.52.0

func (r GetSessionResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetSessionResponse) GetJSON500

func (r GetSessionResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetSessionResponse) Status

func (r GetSessionResponse) Status() string

Status returns HTTPResponse.Status

func (GetSessionResponse) StatusCode

func (r GetSessionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSessionResponse200Headers

type GetSessionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

GetSessionResponse200Headers the declared response headers of an HTTP 200 response for GetSession

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Job

type Job struct {
	// AgentRunId The child agent run whose `runCommand` call started the job, as listed by `GET /session/agents`. Absent for a job the session's root conversation started.
	AgentRunId *openapi_types.UUID `json:"agentRunId,omitempty"`

	// Command The shell command line the job runs.
	Command string `json:"command"`

	// Directory The directory the command runs in.
	Directory string `json:"directory"`

	// EndedAt When the job reached a terminal state, as an RFC 3339 timestamp. Absent while the job is running.
	EndedAt *time.Time `json:"endedAt,omitempty"`

	// ExitCode The process's exit status once known. It is -1 while the job runs and stays -1 when the status is not known, which is always the case for `signalled`, `failed` and `interrupted`.
	ExitCode int64 `json:"exitCode"`

	// FailureDetail Why the job failed or was interrupted. Empty unless Peen recorded a terminal failure detail.
	FailureDetail string `json:"failureDetail"`

	// JobId The job's ID. Use it in the job's output, signals and signal endpoints.
	JobId openapi_types.UUID `json:"jobId"`

	// Pid Operating-system process ID of the job's shell, as the worker that ran it sees it. In a Docker worker it is a process ID inside the container.
	Pid int64 `json:"pid"`

	// Purpose Why the agent said it was running this command.
	Purpose string `json:"purpose"`

	// SessionId The session that started the job.
	SessionId openapi_types.UUID `json:"sessionId"`

	// StartedAt When the job started, as an RFC 3339 timestamp.
	StartedAt time.Time `json:"startedAt"`

	// State The job's lifecycle state.
	//
	// - `running`: the process is still running.
	// - `exited`: the process ended on its own. `exitCode` holds its status, 0 for success.
	// - `signalled`: the process ended because of a signal, usually from a stop or kill request.
	// - `failed`: Peen could not run or supervise the process to its end, for example because storing its output failed; `failureDetail` says why.
	// - `interrupted`: Peen or its worker stopped while the process was running, so it could not be followed further.
	State JobState `json:"state"`

	// ToolCallId The `runCommand` tool call that started this job. Absent when none was recorded.
	ToolCallId *string `json:"toolCallId,omitempty"`

	// TurnId The turn during which the job was started.
	TurnId openapi_types.UUID `json:"turnId"`

	// WorkerGenerationId The worker generation that ran this job, as listed by `GET /session/workers`. Absent when none was recorded.
	WorkerGenerationId *string `json:"workerGenerationId,omitempty"`
}

Job One shell command the agent started with `runCommand`, recorded before it produced output and kept after it ended. It appears in `JobPage` and in `JobSignalRecordPage`.

type JobID

type JobID = openapi_types.UUID

JobID defines model for JobID.

type JobOutput

type JobOutput struct {
	// HasMore `true` when more stored lines match the request after this window. A running job can still add lines when this is `false`.
	HasMore bool `json:"hasMore"`

	// JobId The job this output belongs to.
	JobId openapi_types.UUID `json:"jobId"`

	// Lines The output lines with a `sequence` greater than the requested `cursor`, oldest first, filtered to the requested stream. Stored lines never change.
	Lines []JobOutputLine `json:"lines"`

	// NextCursor The `sequence` of the last line in this window, or the requested `cursor` when the window is empty. Pass it back as `cursor` to read the lines after it.
	NextCursor int64 `json:"nextCursor"`

	// State The job's state when this window was read, with the same values as `Job.state`. Keep reading while it is `running` or `hasMore` is `true`.
	State JobOutputState `json:"state"`
}

JobOutput One window of a job's stored output, returned by `GET /session/jobs/{jobId}/output`. Pass `nextCursor` back as `cursor` to continue.

type JobOutputLine added in v0.4.0

type JobOutputLine struct {
	// Content The line's text, without its trailing newline.
	Content string `json:"content"`

	// CreatedAt When Peen read the line from the process, as an RFC 3339 timestamp.
	CreatedAt time.Time `json:"createdAt"`

	// Id The stored line's ID.
	Id openapi_types.UUID `json:"id"`

	// JobId The job that wrote the line.
	JobId openapi_types.UUID `json:"jobId"`

	// Sequence The line's position in the job's output, counting from 1. stdout and stderr share one counter per job, so sorting by it restores the order Peen saw lines in across both streams.
	Sequence int64 `json:"sequence"`

	// SessionId The session that owns the job.
	SessionId openapi_types.UUID `json:"sessionId"`

	// Stream Which stream the line came from, `stdout` or `stderr`.
	Stream JobOutputLineStream `json:"stream"`
}

JobOutputLine One line a job wrote to stdout or stderr, stored in the order Peen read it. It appears in `JobOutput.lines`.

type JobOutputLineStream added in v0.4.0

type JobOutputLineStream string

JobOutputLineStream Which stream the line came from, `stdout` or `stderr`.

const (
	JobOutputLineStreamStderr JobOutputLineStream = "stderr"
	JobOutputLineStreamStdout JobOutputLineStream = "stdout"
)

Defines values for JobOutputLineStream.

func (JobOutputLineStream) Valid added in v0.4.0

func (e JobOutputLineStream) Valid() bool

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

type JobOutputState

type JobOutputState string

JobOutputState The job's state when this window was read, with the same values as `Job.state`. Keep reading while it is `running` or `hasMore` is `true`.

const (
	JobOutputStateExited      JobOutputState = "exited"
	JobOutputStateFailed      JobOutputState = "failed"
	JobOutputStateInterrupted JobOutputState = "interrupted"
	JobOutputStateRunning     JobOutputState = "running"
	JobOutputStateSignalled   JobOutputState = "signalled"
)

Defines values for JobOutputState.

func (JobOutputState) Valid

func (e JobOutputState) Valid() bool

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

type JobPage

type JobPage struct {
	// HasMore `true` when at least one more job exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Jobs The jobs on this page, ordered by `startedAt` descending.
	Jobs []Job `json:"jobs"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of jobs skipped before this page.
	Offset int32 `json:"offset"`
}

JobPage One page of a session's jobs, newest first, returned by `GET /session/jobs`.

type JobSignalRecord added in v0.4.0

type JobSignalRecord struct {
	// Accepted `true` when the job was running and the signal was sent to its process group. `false` when the job had already ended or no worker held it, so nothing changed.
	Accepted bool `json:"accepted"`

	// Id The record's ID.
	Id openapi_types.UUID `json:"id"`

	// JobId The job the request named.
	JobId openapi_types.UUID `json:"jobId"`

	// RequestedAt When Peen recorded the request, as an RFC 3339 timestamp.
	RequestedAt time.Time `json:"requestedAt"`

	// SessionId The session that owns the job.
	SessionId openapi_types.UUID `json:"sessionId"`

	// Signal The requested signal.
	//
	// - `stop`: asks the process group to end with `SIGTERM` and escalates to `SIGKILL` after a grace period.
	// - `kill`: sends `SIGKILL` at once.
	Signal JobSignalRecordSignal `json:"signal"`

	// StateAtRequest The job's state when the request arrived, with the same values as `Job.state`.
	StateAtRequest JobSignalRecordStateAtRequest `json:"stateAtRequest"`
}

JobSignalRecord The stored record of one request to stop or kill a job. Peen writes one for every request, whether or not it reached a running process, so it is history, not a command. It appears in `JobSignalRecordPage.signalRequests`.

type JobSignalRecordPage added in v0.4.0

type JobSignalRecordPage struct {
	// HasMore `true` when at least one more request exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Job One shell command the agent started with `runCommand`, recorded before it produced output and kept after it ended. It appears in `JobPage` and in `JobSignalRecordPage`.
	Job Job `json:"job"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of requests skipped before this page.
	Offset int32 `json:"offset"`

	// SignalRequests The signal requests on this page, ordered by `requestedAt` ascending.
	SignalRequests []JobSignalRecord `json:"signalRequests"`
}

JobSignalRecordPage One job and a page of its signal history, oldest first, returned by `GET /session/jobs/{jobId}/signals`.

type JobSignalRecordSignal added in v0.4.0

type JobSignalRecordSignal string

JobSignalRecordSignal The requested signal.

- `stop`: asks the process group to end with `SIGTERM` and escalates to `SIGKILL` after a grace period. - `kill`: sends `SIGKILL` at once.

const (
	JobSignalRecordSignalKill JobSignalRecordSignal = "kill"
	JobSignalRecordSignalStop JobSignalRecordSignal = "stop"
)

Defines values for JobSignalRecordSignal.

func (JobSignalRecordSignal) Valid added in v0.4.0

func (e JobSignalRecordSignal) Valid() bool

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

type JobSignalRecordStateAtRequest added in v0.4.0

type JobSignalRecordStateAtRequest string

JobSignalRecordStateAtRequest The job's state when the request arrived, with the same values as `Job.state`.

const (
	JobSignalRecordStateAtRequestExited      JobSignalRecordStateAtRequest = "exited"
	JobSignalRecordStateAtRequestFailed      JobSignalRecordStateAtRequest = "failed"
	JobSignalRecordStateAtRequestInterrupted JobSignalRecordStateAtRequest = "interrupted"
	JobSignalRecordStateAtRequestRunning     JobSignalRecordStateAtRequest = "running"
	JobSignalRecordStateAtRequestSignalled   JobSignalRecordStateAtRequest = "signalled"
)

Defines values for JobSignalRecordStateAtRequest.

func (JobSignalRecordStateAtRequest) Valid added in v0.4.0

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

type JobSignalRequest

type JobSignalRequest struct {
	// Signal The signal to send to the job's process group.
	//
	// - `stop`: `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later.
	// - `kill`: `SIGKILL` at once.
	Signal JobSignalRequestSignal `json:"signal"`
}

JobSignalRequest The body of `POST /session/jobs/{jobId}/signal`, naming the signal to send to the job's process group.

type JobSignalRequestSignal

type JobSignalRequestSignal string

JobSignalRequestSignal The signal to send to the job's process group.

- `stop`: `SIGTERM`, then `SIGKILL` if the process group is still running 10 seconds later. - `kill`: `SIGKILL` at once.

const (
	JobSignalRequestSignalKill JobSignalRequestSignal = "kill"
	JobSignalRequestSignalStop JobSignalRequestSignal = "stop"
)

Defines values for JobSignalRequestSignal.

func (JobSignalRequestSignal) Valid

func (e JobSignalRequestSignal) Valid() bool

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

type JobSignalResponse

type JobSignalResponse struct {
	// JobId The job the request named.
	JobId openapi_types.UUID `json:"jobId"`

	// Signalled `true` when this request found the job running and sent the signal. The process may still be ending when the response arrives. Signalling an exited or already signalled job, or one no live worker holds, is not an error and reports `false` with the current state.
	Signalled bool `json:"signalled"`

	// State The job's state when the request arrived, with the same values as `Job.state`. A successful signal reports `running`, because the process ends after the response. Read the job again to see `signalled`.
	State JobSignalResponseState `json:"state"`
}

JobSignalResponse The result of `POST /session/jobs/{jobId}/signal`. Peen records the request in the job's signal history either way.

type JobSignalResponseState

type JobSignalResponseState string

JobSignalResponseState The job's state when the request arrived, with the same values as `Job.state`. A successful signal reports `running`, because the process ends after the response. Read the job again to see `signalled`.

const (
	JobSignalResponseStateExited      JobSignalResponseState = "exited"
	JobSignalResponseStateFailed      JobSignalResponseState = "failed"
	JobSignalResponseStateInterrupted JobSignalResponseState = "interrupted"
	JobSignalResponseStateRunning     JobSignalResponseState = "running"
	JobSignalResponseStateSignalled   JobSignalResponseState = "signalled"
)

Defines values for JobSignalResponseState.

func (JobSignalResponseState) Valid

func (e JobSignalResponseState) Valid() bool

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

type JobState

type JobState string

JobState The job's lifecycle state.

- `running`: the process is still running. - `exited`: the process ended on its own. `exitCode` holds its status, 0 for success. - `signalled`: the process ended because of a signal, usually from a stop or kill request. - `failed`: Peen could not run or supervise the process to its end, for example because storing its output failed; `failureDetail` says why. - `interrupted`: Peen or its worker stopped while the process was running, so it could not be followed further.

const (
	JobStateExited      JobState = "exited"
	JobStateFailed      JobState = "failed"
	JobStateInterrupted JobState = "interrupted"
	JobStateRunning     JobState = "running"
	JobStateSignalled   JobState = "signalled"
)

Defines values for JobState.

func (JobState) Valid

func (e JobState) Valid() bool

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

type LearnedFile added in v0.37.0

type LearnedFile struct {
	// AlwaysLoaded True for a rule that is part of every system prompt: one without `paths`, `globs`, or `applyTo` frontmatter. Such a rule counts against `PEEN_MAX_SYSTEM_PROMPT_PERCENT`. Always false for a skill, and false for a file over 128 KiB.
	AlwaysLoaded bool `json:"alwaysLoaded"`

	// EstimatedTokens The file's size in tokens, estimated with the o200k tokenizer. 0 for a file over 128 KiB, which the harness does not load.
	EstimatedTokens int64 `json:"estimatedTokens"`

	// Kind Whether a learned file is a rule or a skill.
	//
	// - `rule`: a Markdown file under `rules/` in a learned directory, possibly in subdirectories.
	// - `skill`: a `skills/<name>/` directory whose `SKILL.md` holds the skill.
	Kind LearnedKind `json:"kind"`

	// ModifiedAt When the file was last modified, in RFC 3339 format.
	ModifiedAt time.Time `json:"modifiedAt"`

	// Name The rule's path under `rules/` without `.md`, using `/` between directories, such as `go-errors` or `go/errors`, or the skill's directory name. A learned rule loads under the name `learned/<name>`. Pass it as the `name` query parameter to read or delete the file.
	Name string `json:"name"`

	// Path The absolute path of the rule file, or the skill's `SKILL.md`, on the controller's host.
	Path string `json:"path"`

	// Scope Which learned directory a learned file lives in.
	//
	// - `workspace`: `.agents/learned/` in the session's workspace root, which holds what belongs to that project.
	// - `global`: the deployment's global learned directory, which every session reads (by default `.agents/learned/` in the config directory).
	Scope LearnedScope `json:"scope"`

	// SizeBytes The file's size in bytes.
	SizeBytes int64 `json:"sizeBytes"`
}

LearnedFile One learned rule, or one learned skill's `SKILL.md`, that an agent saved while auto-evolve was on or that you placed in a learned directory. Returned by `GET /session/learned` and inside `LearnedFileContent`.

type LearnedFileContent added in v0.37.0

type LearnedFileContent struct {
	// Content The file's text exactly as stored, including any frontmatter. Empty for a file over 128 KiB.
	Content string `json:"content"`

	// File One learned rule, or one learned skill's `SKILL.md`, that an agent saved while auto-evolve was on or that you placed in a learned directory. Returned by `GET /session/learned` and inside `LearnedFileContent`.
	File LearnedFile `json:"file"`
}

LearnedFileContent One learned file and its text. Returned by `GET /session/learned/file`.

type LearnedFileList added in v0.37.0

type LearnedFileList struct {
	// Items Workspace files first, then global ones, each sorted by kind and name.
	Items []LearnedFile `json:"items"`
}

LearnedFileList Every learned rule and skill a session loads. Returned by `GET /session/learned`.

type LearnedKind added in v0.37.0

type LearnedKind string

LearnedKind Whether a learned file is a rule or a skill.

- `rule`: a Markdown file under `rules/` in a learned directory, possibly in subdirectories. - `skill`: a `skills/<name>/` directory whose `SKILL.md` holds the skill.

const (
	LearnedKindRule  LearnedKind = "rule"
	LearnedKindSkill LearnedKind = "skill"
)

Defines values for LearnedKind.

func (LearnedKind) Valid added in v0.37.0

func (e LearnedKind) Valid() bool

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

type LearnedName added in v0.37.0

type LearnedName = string

LearnedName defines model for LearnedName.

type LearnedScope added in v0.37.0

type LearnedScope string

LearnedScope Which learned directory a learned file lives in.

- `workspace`: `.agents/learned/` in the session's workspace root, which holds what belongs to that project. - `global`: the deployment's global learned directory, which every session reads (by default `.agents/learned/` in the config directory).

const (
	LearnedScopeGlobal    LearnedScope = "global"
	LearnedScopeWorkspace LearnedScope = "workspace"
)

Defines values for LearnedScope.

func (LearnedScope) Valid added in v0.37.0

func (e LearnedScope) Valid() bool

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

type Limit

type Limit = int32

Limit defines model for Limit.

type ListAgentSpacesResponse added in v0.19.0

type ListAgentSpacesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentSpaceList
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListAgentSpacesResponse200Headers
}

func ParseListAgentSpacesResponse added in v0.19.0

func ParseListAgentSpacesResponse(rsp *http.Response) (*ListAgentSpacesResponse, error)

ParseListAgentSpacesResponse parses an HTTP response from a ListAgentSpacesWithResponse call

func (ListAgentSpacesResponse) ContentType added in v0.19.0

func (r ListAgentSpacesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListAgentSpacesResponse) GetBody added in v0.19.0

func (r ListAgentSpacesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListAgentSpacesResponse) GetJSON200 added in v0.19.0

func (r ListAgentSpacesResponse) GetJSON200() *AgentSpaceList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListAgentSpacesResponse) GetJSON401 added in v0.19.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListAgentSpacesResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListAgentSpacesResponse) GetJSON500 added in v0.19.0

func (r ListAgentSpacesResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListAgentSpacesResponse) Status added in v0.19.0

func (r ListAgentSpacesResponse) Status() string

Status returns HTTPResponse.Status

func (ListAgentSpacesResponse) StatusCode added in v0.19.0

func (r ListAgentSpacesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListAgentSpacesResponse200Headers added in v0.19.0

type ListAgentSpacesResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListAgentSpacesResponse200Headers the declared response headers of an HTTP 200 response for ListAgentSpaces

type ListCronJobsResponse added in v0.51.0

type ListCronJobsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *CronJobList
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListCronJobsResponse200Headers
}

func ParseListCronJobsResponse added in v0.51.0

func ParseListCronJobsResponse(rsp *http.Response) (*ListCronJobsResponse, error)

ParseListCronJobsResponse parses an HTTP response from a ListCronJobsWithResponse call

func (ListCronJobsResponse) ContentType added in v0.51.0

func (r ListCronJobsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCronJobsResponse) GetBody added in v0.51.0

func (r ListCronJobsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCronJobsResponse) GetJSON200 added in v0.51.0

func (r ListCronJobsResponse) GetJSON200() *CronJobList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCronJobsResponse) GetJSON401 added in v0.51.0

func (r ListCronJobsResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListCronJobsResponse) GetJSON406 added in v0.52.0

func (r ListCronJobsResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListCronJobsResponse) GetJSON500 added in v0.51.0

func (r ListCronJobsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListCronJobsResponse) Status added in v0.51.0

func (r ListCronJobsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCronJobsResponse) StatusCode added in v0.51.0

func (r ListCronJobsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCronJobsResponse200Headers added in v0.51.0

type ListCronJobsResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListCronJobsResponse200Headers the declared response headers of an HTTP 200 response for ListCronJobs

type ListCronRunsParams added in v0.51.0

type ListCronRunsParams struct {
	// Job Return only the runs of the job with this name, 1 to 64 ASCII letters, digits, underscores or hyphens. The name may belong to a job that is no longer configured. Omit it to list every job's runs.
	Job *string `form:"job,omitempty" json:"job,omitempty"`

	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`
}

ListCronRunsParams defines parameters for ListCronRuns.

type ListCronRunsResponse added in v0.51.0

type ListCronRunsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *CronRunPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListCronRunsResponse200Headers
}

func ParseListCronRunsResponse added in v0.51.0

func ParseListCronRunsResponse(rsp *http.Response) (*ListCronRunsResponse, error)

ParseListCronRunsResponse parses an HTTP response from a ListCronRunsWithResponse call

func (ListCronRunsResponse) ContentType added in v0.51.0

func (r ListCronRunsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCronRunsResponse) GetBody added in v0.51.0

func (r ListCronRunsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCronRunsResponse) GetJSON200 added in v0.51.0

func (r ListCronRunsResponse) GetJSON200() *CronRunPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCronRunsResponse) GetJSON400 added in v0.51.0

func (r ListCronRunsResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListCronRunsResponse) GetJSON401 added in v0.51.0

func (r ListCronRunsResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListCronRunsResponse) GetJSON406 added in v0.52.0

func (r ListCronRunsResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListCronRunsResponse) GetJSON500 added in v0.51.0

func (r ListCronRunsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListCronRunsResponse) Status added in v0.51.0

func (r ListCronRunsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCronRunsResponse) StatusCode added in v0.51.0

func (r ListCronRunsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCronRunsResponse200Headers added in v0.51.0

type ListCronRunsResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListCronRunsResponse200Headers the declared response headers of an HTTP 200 response for ListCronRuns

type ListMessagesParams

type ListMessagesParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// Order The direction of the list by stored sequence. `asc`, the default, returns the oldest items first; `desc` returns the newest first. `offset` counts from the start of the chosen direction.
	Order *ListMessagesParamsOrder `form:"order,omitempty" json:"order,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListMessagesParams defines parameters for ListMessages.

type ListMessagesParamsOrder

type ListMessagesParamsOrder string

ListMessagesParamsOrder defines parameters for ListMessages.

const (
	ListMessagesParamsOrderAsc  ListMessagesParamsOrder = "asc"
	ListMessagesParamsOrderDesc ListMessagesParamsOrder = "desc"
)

Defines values for ListMessagesParamsOrder.

func (ListMessagesParamsOrder) Valid

func (e ListMessagesParamsOrder) Valid() bool

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

type ListMessagesResponse

type ListMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *MessagePage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListMessagesResponse200Headers
}

func ParseListMessagesResponse

func ParseListMessagesResponse(rsp *http.Response) (*ListMessagesResponse, error)

ParseListMessagesResponse parses an HTTP response from a ListMessagesWithResponse call

func (ListMessagesResponse) ContentType

func (r ListMessagesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListMessagesResponse) GetBody

func (r ListMessagesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListMessagesResponse) GetJSON200

func (r ListMessagesResponse) GetJSON200() *MessagePage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListMessagesResponse) GetJSON400

func (r ListMessagesResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListMessagesResponse) GetJSON401

func (r ListMessagesResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListMessagesResponse) GetJSON404

func (r ListMessagesResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListMessagesResponse) GetJSON406 added in v0.52.0

func (r ListMessagesResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListMessagesResponse) GetJSON500

func (r ListMessagesResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListMessagesResponse) Status

func (r ListMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (ListMessagesResponse) StatusCode

func (r ListMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListMessagesResponse200Headers

type ListMessagesResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListMessagesResponse200Headers the declared response headers of an HTTP 200 response for ListMessages

type ListModelsResponse added in v0.12.0

type ListModelsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ModelList
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListModelsResponse200Headers
}

func ParseListModelsResponse added in v0.12.0

func ParseListModelsResponse(rsp *http.Response) (*ListModelsResponse, error)

ParseListModelsResponse parses an HTTP response from a ListModelsWithResponse call

func (ListModelsResponse) ContentType added in v0.12.0

func (r ListModelsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListModelsResponse) GetBody added in v0.12.0

func (r ListModelsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListModelsResponse) GetJSON200 added in v0.12.0

func (r ListModelsResponse) GetJSON200() *ModelList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListModelsResponse) GetJSON401 added in v0.12.0

func (r ListModelsResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListModelsResponse) GetJSON406 added in v0.52.0

func (r ListModelsResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListModelsResponse) GetJSON500 added in v0.12.0

func (r ListModelsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListModelsResponse) Status added in v0.12.0

func (r ListModelsResponse) Status() string

Status returns HTTPResponse.Status

func (ListModelsResponse) StatusCode added in v0.12.0

func (r ListModelsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListModelsResponse200Headers added in v0.12.0

type ListModelsResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListModelsResponse200Headers the declared response headers of an HTTP 200 response for ListModels

type ListSessionAgentRunCompactionsParams added in v0.11.0

type ListSessionAgentRunCompactionsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionAgentRunCompactionsParams defines parameters for ListSessionAgentRunCompactions.

type ListSessionAgentRunCompactionsResponse added in v0.11.0

type ListSessionAgentRunCompactionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRunCompactionPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionAgentRunCompactionsResponse200Headers
}

func ParseListSessionAgentRunCompactionsResponse added in v0.11.0

func ParseListSessionAgentRunCompactionsResponse(rsp *http.Response) (*ListSessionAgentRunCompactionsResponse, error)

ParseListSessionAgentRunCompactionsResponse parses an HTTP response from a ListSessionAgentRunCompactionsWithResponse call

func (ListSessionAgentRunCompactionsResponse) ContentType added in v0.11.0

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionAgentRunCompactionsResponse) GetBody added in v0.11.0

GetBody returns the raw response body bytes

func (ListSessionAgentRunCompactionsResponse) GetJSON200 added in v0.11.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionAgentRunCompactionsResponse) GetJSON400 added in v0.11.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionAgentRunCompactionsResponse) GetJSON401 added in v0.11.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionAgentRunCompactionsResponse) GetJSON404 added in v0.11.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionAgentRunCompactionsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionAgentRunCompactionsResponse) GetJSON500 added in v0.11.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionAgentRunCompactionsResponse) Status added in v0.11.0

Status returns HTTPResponse.Status

func (ListSessionAgentRunCompactionsResponse) StatusCode added in v0.11.0

StatusCode returns HTTPResponse.StatusCode

type ListSessionAgentRunCompactionsResponse200Headers added in v0.11.0

type ListSessionAgentRunCompactionsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionAgentRunCompactionsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionAgentRunCompactions

type ListSessionAgentRunEventsParams

type ListSessionAgentRunEventsParams struct {
	// Cursor Return only events whose `sequence` is greater than this value. Pass `0` for the first page and the previous page's `nextCursor` after that. Defaults to 0.
	Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Limit Maximum number of events to return, from 1 to 200. Defaults to 100.
	Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionAgentRunEventsParams defines parameters for ListSessionAgentRunEvents.

type ListSessionAgentRunEventsResponse

type ListSessionAgentRunEventsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRunEventPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionAgentRunEventsResponse200Headers
}

func ParseListSessionAgentRunEventsResponse

func ParseListSessionAgentRunEventsResponse(rsp *http.Response) (*ListSessionAgentRunEventsResponse, error)

ParseListSessionAgentRunEventsResponse parses an HTTP response from a ListSessionAgentRunEventsWithResponse call

func (ListSessionAgentRunEventsResponse) ContentType

func (r ListSessionAgentRunEventsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionAgentRunEventsResponse) GetBody

GetBody returns the raw response body bytes

func (ListSessionAgentRunEventsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionAgentRunEventsResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionAgentRunEventsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionAgentRunEventsResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionAgentRunEventsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionAgentRunEventsResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionAgentRunEventsResponse) Status

Status returns HTTPResponse.Status

func (ListSessionAgentRunEventsResponse) StatusCode

func (r ListSessionAgentRunEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionAgentRunEventsResponse200Headers

type ListSessionAgentRunEventsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionAgentRunEventsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionAgentRunEvents

type ListSessionAgentRunMessagesParams added in v0.11.0

type ListSessionAgentRunMessagesParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionAgentRunMessagesParams defines parameters for ListSessionAgentRunMessages.

type ListSessionAgentRunMessagesResponse added in v0.11.0

type ListSessionAgentRunMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRunMessagePage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionAgentRunMessagesResponse200Headers
}

func ParseListSessionAgentRunMessagesResponse added in v0.11.0

func ParseListSessionAgentRunMessagesResponse(rsp *http.Response) (*ListSessionAgentRunMessagesResponse, error)

ParseListSessionAgentRunMessagesResponse parses an HTTP response from a ListSessionAgentRunMessagesWithResponse call

func (ListSessionAgentRunMessagesResponse) ContentType added in v0.11.0

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionAgentRunMessagesResponse) GetBody added in v0.11.0

GetBody returns the raw response body bytes

func (ListSessionAgentRunMessagesResponse) GetJSON200 added in v0.11.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionAgentRunMessagesResponse) GetJSON400 added in v0.11.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionAgentRunMessagesResponse) GetJSON401 added in v0.11.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionAgentRunMessagesResponse) GetJSON404 added in v0.11.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionAgentRunMessagesResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionAgentRunMessagesResponse) GetJSON500 added in v0.11.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionAgentRunMessagesResponse) Status added in v0.11.0

Status returns HTTPResponse.Status

func (ListSessionAgentRunMessagesResponse) StatusCode added in v0.11.0

StatusCode returns HTTPResponse.StatusCode

type ListSessionAgentRunMessagesResponse200Headers added in v0.11.0

type ListSessionAgentRunMessagesResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionAgentRunMessagesResponse200Headers the declared response headers of an HTTP 200 response for ListSessionAgentRunMessages

type ListSessionAgentRunsParams

type ListSessionAgentRunsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// State Keep only runs in this state. `running`, `completed`, `failed`, `cancelled`, and `interrupted` match the stored state. `waiting` is not a stored state: it keeps the `running` runs that asked a question with the `ask` tool that nobody has answered yet.
	State *ListSessionAgentRunsParamsState `form:"state,omitempty" json:"state,omitempty"`

	// ParentAgentRunId Keep only the direct children of one agent run. Pass an agent run ID, or `root` for the children the session's root conversation launched. Any other value answers `400 VALIDATION_FAILED`. An agent run ID the session does not have returns an empty page.
	ParentAgentRunId *string `form:"parentAgentRunId,omitempty" json:"parentAgentRunId,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionAgentRunsParams defines parameters for ListSessionAgentRuns.

type ListSessionAgentRunsParamsState

type ListSessionAgentRunsParamsState string

ListSessionAgentRunsParamsState defines parameters for ListSessionAgentRuns.

const (
	ListSessionAgentRunsParamsStateCancelled   ListSessionAgentRunsParamsState = "cancelled"
	ListSessionAgentRunsParamsStateCompleted   ListSessionAgentRunsParamsState = "completed"
	ListSessionAgentRunsParamsStateFailed      ListSessionAgentRunsParamsState = "failed"
	ListSessionAgentRunsParamsStateInterrupted ListSessionAgentRunsParamsState = "interrupted"
	ListSessionAgentRunsParamsStateRunning     ListSessionAgentRunsParamsState = "running"
	ListSessionAgentRunsParamsStateWaiting     ListSessionAgentRunsParamsState = "waiting"
)

Defines values for ListSessionAgentRunsParamsState.

func (ListSessionAgentRunsParamsState) Valid

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

type ListSessionAgentRunsResponse

type ListSessionAgentRunsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AgentRunPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionAgentRunsResponse200Headers
}

func ParseListSessionAgentRunsResponse

func ParseListSessionAgentRunsResponse(rsp *http.Response) (*ListSessionAgentRunsResponse, error)

ParseListSessionAgentRunsResponse parses an HTTP response from a ListSessionAgentRunsWithResponse call

func (ListSessionAgentRunsResponse) ContentType

func (r ListSessionAgentRunsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionAgentRunsResponse) GetBody

func (r ListSessionAgentRunsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionAgentRunsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionAgentRunsResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionAgentRunsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionAgentRunsResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionAgentRunsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionAgentRunsResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionAgentRunsResponse) Status

Status returns HTTPResponse.Status

func (ListSessionAgentRunsResponse) StatusCode

func (r ListSessionAgentRunsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionAgentRunsResponse200Headers

type ListSessionAgentRunsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionAgentRunsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionAgentRuns

type ListSessionAgentSpaceDecisionsParams added in v0.19.0

type ListSessionAgentSpaceDecisionsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionAgentSpaceDecisionsParams defines parameters for ListSessionAgentSpaceDecisions.

type ListSessionAgentSpaceDecisionsResponse added in v0.19.0

type ListSessionAgentSpaceDecisionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SessionAgentSpaceDecisionPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionAgentSpaceDecisionsResponse200Headers
}

func ParseListSessionAgentSpaceDecisionsResponse added in v0.19.0

func ParseListSessionAgentSpaceDecisionsResponse(rsp *http.Response) (*ListSessionAgentSpaceDecisionsResponse, error)

ParseListSessionAgentSpaceDecisionsResponse parses an HTTP response from a ListSessionAgentSpaceDecisionsWithResponse call

func (ListSessionAgentSpaceDecisionsResponse) ContentType added in v0.19.0

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionAgentSpaceDecisionsResponse) GetBody added in v0.19.0

GetBody returns the raw response body bytes

func (ListSessionAgentSpaceDecisionsResponse) GetJSON200 added in v0.19.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) GetJSON400 added in v0.19.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) GetJSON401 added in v0.19.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) GetJSON404 added in v0.19.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) GetJSON500 added in v0.19.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionAgentSpaceDecisionsResponse) Status added in v0.19.0

Status returns HTTPResponse.Status

func (ListSessionAgentSpaceDecisionsResponse) StatusCode added in v0.19.0

StatusCode returns HTTPResponse.StatusCode

type ListSessionAgentSpaceDecisionsResponse200Headers added in v0.19.0

type ListSessionAgentSpaceDecisionsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionAgentSpaceDecisionsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionAgentSpaceDecisions

type ListSessionCompactionsParams added in v0.4.0

type ListSessionCompactionsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionCompactionsParams defines parameters for ListSessionCompactions.

type ListSessionCompactionsResponse added in v0.4.0

type ListSessionCompactionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *CompactionPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionCompactionsResponse200Headers
}

func ParseListSessionCompactionsResponse added in v0.4.0

func ParseListSessionCompactionsResponse(rsp *http.Response) (*ListSessionCompactionsResponse, error)

ParseListSessionCompactionsResponse parses an HTTP response from a ListSessionCompactionsWithResponse call

func (ListSessionCompactionsResponse) ContentType added in v0.4.0

func (r ListSessionCompactionsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionCompactionsResponse) GetBody added in v0.4.0

func (r ListSessionCompactionsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionCompactionsResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionCompactionsResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionCompactionsResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionCompactionsResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionCompactionsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionCompactionsResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionCompactionsResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (ListSessionCompactionsResponse) StatusCode added in v0.4.0

func (r ListSessionCompactionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionCompactionsResponse200Headers added in v0.4.0

type ListSessionCompactionsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionCompactionsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionCompactions

type ListSessionEventsParams

type ListSessionEventsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// Order The direction of the list by stored sequence. `asc`, the default, returns the oldest items first; `desc` returns the newest first. `offset` counts from the start of the chosen direction.
	Order *ListSessionEventsParamsOrder `form:"order,omitempty" json:"order,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionEventsParams defines parameters for ListSessionEvents.

type ListSessionEventsParamsOrder added in v0.4.0

type ListSessionEventsParamsOrder string

ListSessionEventsParamsOrder defines parameters for ListSessionEvents.

const (
	ListSessionEventsParamsOrderAsc  ListSessionEventsParamsOrder = "asc"
	ListSessionEventsParamsOrderDesc ListSessionEventsParamsOrder = "desc"
)

Defines values for ListSessionEventsParamsOrder.

func (ListSessionEventsParamsOrder) Valid added in v0.4.0

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

type ListSessionEventsResponse

type ListSessionEventsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *TranscriptEventPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionEventsResponse200Headers
}

func ParseListSessionEventsResponse

func ParseListSessionEventsResponse(rsp *http.Response) (*ListSessionEventsResponse, error)

ParseListSessionEventsResponse parses an HTTP response from a ListSessionEventsWithResponse call

func (ListSessionEventsResponse) ContentType

func (r ListSessionEventsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionEventsResponse) GetBody

func (r ListSessionEventsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionEventsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionEventsResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionEventsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionEventsResponse) GetJSON404

func (r ListSessionEventsResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionEventsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionEventsResponse) GetJSON500

func (r ListSessionEventsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionEventsResponse) Status

func (r ListSessionEventsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSessionEventsResponse) StatusCode

func (r ListSessionEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionEventsResponse200Headers

type ListSessionEventsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionEventsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionEvents

type ListSessionFeedParams added in v0.26.0

type ListSessionFeedParams struct {
	// Cursor Return frames with a sequence greater than this value. Pass the last sequence you applied, or `0` to start from the beginning. Default `0`.
	Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Limit Maximum number of frames to return, 1 to 200. Default `100`.
	Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionFeedParams defines parameters for ListSessionFeed.

type ListSessionFeedResponse added in v0.26.0

type ListSessionFeedResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *FeedPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionFeedResponse200Headers
}

func ParseListSessionFeedResponse added in v0.26.0

func ParseListSessionFeedResponse(rsp *http.Response) (*ListSessionFeedResponse, error)

ParseListSessionFeedResponse parses an HTTP response from a ListSessionFeedWithResponse call

func (ListSessionFeedResponse) ContentType added in v0.26.0

func (r ListSessionFeedResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionFeedResponse) GetBody added in v0.26.0

func (r ListSessionFeedResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionFeedResponse) GetJSON200 added in v0.26.0

func (r ListSessionFeedResponse) GetJSON200() *FeedPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionFeedResponse) GetJSON400 added in v0.26.0

func (r ListSessionFeedResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionFeedResponse) GetJSON401 added in v0.26.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionFeedResponse) GetJSON404 added in v0.26.0

func (r ListSessionFeedResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionFeedResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionFeedResponse) GetJSON500 added in v0.26.0

func (r ListSessionFeedResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionFeedResponse) Status added in v0.26.0

func (r ListSessionFeedResponse) Status() string

Status returns HTTPResponse.Status

func (ListSessionFeedResponse) StatusCode added in v0.26.0

func (r ListSessionFeedResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionFeedResponse200Headers added in v0.26.0

type ListSessionFeedResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionFeedResponse200Headers the declared response headers of an HTTP 200 response for ListSessionFeed

type ListSessionJobSignalRequestsParams added in v0.4.0

type ListSessionJobSignalRequestsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionJobSignalRequestsParams defines parameters for ListSessionJobSignalRequests.

type ListSessionJobSignalRequestsResponse added in v0.4.0

type ListSessionJobSignalRequestsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *JobSignalRecordPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionJobSignalRequestsResponse200Headers
}

func ParseListSessionJobSignalRequestsResponse added in v0.4.0

func ParseListSessionJobSignalRequestsResponse(rsp *http.Response) (*ListSessionJobSignalRequestsResponse, error)

ParseListSessionJobSignalRequestsResponse parses an HTTP response from a ListSessionJobSignalRequestsWithResponse call

func (ListSessionJobSignalRequestsResponse) ContentType added in v0.4.0

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionJobSignalRequestsResponse) GetBody added in v0.4.0

GetBody returns the raw response body bytes

func (ListSessionJobSignalRequestsResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionJobSignalRequestsResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionJobSignalRequestsResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionJobSignalRequestsResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionJobSignalRequestsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionJobSignalRequestsResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionJobSignalRequestsResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (ListSessionJobSignalRequestsResponse) StatusCode added in v0.4.0

StatusCode returns HTTPResponse.StatusCode

type ListSessionJobSignalRequestsResponse200Headers added in v0.4.0

type ListSessionJobSignalRequestsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionJobSignalRequestsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionJobSignalRequests

type ListSessionJobsParams

type ListSessionJobsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// State Keep only jobs in this state. Omit it to list every job.
	//
	// - `running`: still running.
	// - `exited`: ended on its own.
	// - `signalled`: ended by a signal.
	// - `failed`: could not be run or supervised to the end.
	// - `interrupted`: was still running when Peen or its worker stopped.
	State *ListSessionJobsParamsState `form:"state,omitempty" json:"state,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionJobsParams defines parameters for ListSessionJobs.

type ListSessionJobsParamsState

type ListSessionJobsParamsState string

ListSessionJobsParamsState defines parameters for ListSessionJobs.

const (
	ListSessionJobsParamsStateExited      ListSessionJobsParamsState = "exited"
	ListSessionJobsParamsStateFailed      ListSessionJobsParamsState = "failed"
	ListSessionJobsParamsStateInterrupted ListSessionJobsParamsState = "interrupted"
	ListSessionJobsParamsStateRunning     ListSessionJobsParamsState = "running"
	ListSessionJobsParamsStateSignalled   ListSessionJobsParamsState = "signalled"
)

Defines values for ListSessionJobsParamsState.

func (ListSessionJobsParamsState) Valid

func (e ListSessionJobsParamsState) Valid() bool

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

type ListSessionJobsResponse

type ListSessionJobsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *JobPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionJobsResponse200Headers
}

func ParseListSessionJobsResponse

func ParseListSessionJobsResponse(rsp *http.Response) (*ListSessionJobsResponse, error)

ParseListSessionJobsResponse parses an HTTP response from a ListSessionJobsWithResponse call

func (ListSessionJobsResponse) ContentType

func (r ListSessionJobsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionJobsResponse) GetBody

func (r ListSessionJobsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionJobsResponse) GetJSON200

func (r ListSessionJobsResponse) GetJSON200() *JobPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionJobsResponse) GetJSON400

func (r ListSessionJobsResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionJobsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionJobsResponse) GetJSON404

func (r ListSessionJobsResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionJobsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionJobsResponse) GetJSON500

func (r ListSessionJobsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionJobsResponse) Status

func (r ListSessionJobsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSessionJobsResponse) StatusCode

func (r ListSessionJobsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionJobsResponse200Headers

type ListSessionJobsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionJobsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionJobs

type ListSessionLearnedFilesParams added in v0.37.0

type ListSessionLearnedFilesParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionLearnedFilesParams defines parameters for ListSessionLearnedFiles.

type ListSessionLearnedFilesResponse added in v0.37.0

type ListSessionLearnedFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *LearnedFileList
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionLearnedFilesResponse200Headers
}

func ParseListSessionLearnedFilesResponse added in v0.37.0

func ParseListSessionLearnedFilesResponse(rsp *http.Response) (*ListSessionLearnedFilesResponse, error)

ParseListSessionLearnedFilesResponse parses an HTTP response from a ListSessionLearnedFilesWithResponse call

func (ListSessionLearnedFilesResponse) ContentType added in v0.37.0

func (r ListSessionLearnedFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionLearnedFilesResponse) GetBody added in v0.37.0

func (r ListSessionLearnedFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionLearnedFilesResponse) GetJSON200 added in v0.37.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionLearnedFilesResponse) GetJSON400 added in v0.37.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionLearnedFilesResponse) GetJSON401 added in v0.37.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionLearnedFilesResponse) GetJSON404 added in v0.37.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionLearnedFilesResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionLearnedFilesResponse) GetJSON500 added in v0.37.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionLearnedFilesResponse) Status added in v0.37.0

Status returns HTTPResponse.Status

func (ListSessionLearnedFilesResponse) StatusCode added in v0.37.0

func (r ListSessionLearnedFilesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionLearnedFilesResponse200Headers added in v0.37.0

type ListSessionLearnedFilesResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionLearnedFilesResponse200Headers the declared response headers of an HTTP 200 response for ListSessionLearnedFiles

type ListSessionModelRunCallsParams added in v0.4.0

type ListSessionModelRunCallsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionModelRunCallsParams defines parameters for ListSessionModelRunCalls.

type ListSessionModelRunCallsResponse added in v0.4.0

type ListSessionModelRunCallsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ModelCallPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionModelRunCallsResponse200Headers
}

func ParseListSessionModelRunCallsResponse added in v0.4.0

func ParseListSessionModelRunCallsResponse(rsp *http.Response) (*ListSessionModelRunCallsResponse, error)

ParseListSessionModelRunCallsResponse parses an HTTP response from a ListSessionModelRunCallsWithResponse call

func (ListSessionModelRunCallsResponse) ContentType added in v0.4.0

func (r ListSessionModelRunCallsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionModelRunCallsResponse) GetBody added in v0.4.0

func (r ListSessionModelRunCallsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionModelRunCallsResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionModelRunCallsResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionModelRunCallsResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionModelRunCallsResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionModelRunCallsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionModelRunCallsResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionModelRunCallsResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (ListSessionModelRunCallsResponse) StatusCode added in v0.4.0

func (r ListSessionModelRunCallsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionModelRunCallsResponse200Headers added in v0.4.0

type ListSessionModelRunCallsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionModelRunCallsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionModelRunCalls

type ListSessionModelRunsParams added in v0.4.0

type ListSessionModelRunsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// Stage Keep only runs from one kind of work. Omit it to list every stage.
	//
	// - `turn`: the root conversation's model work.
	// - `child`: a child agent's model work.
	// - `compaction`: a summary of older messages, for the root conversation or a child agent.
	Stage *ListSessionModelRunsParamsStage `form:"stage,omitempty" json:"stage,omitempty"`

	// State Keep only runs in one state. Omit it to list every state.
	//
	// - `running`: has not ended.
	// - `completed`: returned a response.
	// - `failed`: ended with a provider or model error.
	// - `cancelled`: was cancelled or ran past its deadline.
	// - `interrupted`: was still running when Peen stopped.
	State *ListSessionModelRunsParamsState `form:"state,omitempty" json:"state,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionModelRunsParams defines parameters for ListSessionModelRuns.

type ListSessionModelRunsParamsStage added in v0.4.0

type ListSessionModelRunsParamsStage string

ListSessionModelRunsParamsStage defines parameters for ListSessionModelRuns.

const (
	ListSessionModelRunsParamsStageChild      ListSessionModelRunsParamsStage = "child"
	ListSessionModelRunsParamsStageCompaction ListSessionModelRunsParamsStage = "compaction"
	ListSessionModelRunsParamsStageTurn       ListSessionModelRunsParamsStage = "turn"
)

Defines values for ListSessionModelRunsParamsStage.

func (ListSessionModelRunsParamsStage) Valid added in v0.4.0

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

type ListSessionModelRunsParamsState added in v0.4.0

type ListSessionModelRunsParamsState string

ListSessionModelRunsParamsState defines parameters for ListSessionModelRuns.

const (
	ListSessionModelRunsParamsStateCancelled   ListSessionModelRunsParamsState = "cancelled"
	ListSessionModelRunsParamsStateCompleted   ListSessionModelRunsParamsState = "completed"
	ListSessionModelRunsParamsStateFailed      ListSessionModelRunsParamsState = "failed"
	ListSessionModelRunsParamsStateInterrupted ListSessionModelRunsParamsState = "interrupted"
	ListSessionModelRunsParamsStateRunning     ListSessionModelRunsParamsState = "running"
)

Defines values for ListSessionModelRunsParamsState.

func (ListSessionModelRunsParamsState) Valid added in v0.4.0

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

type ListSessionModelRunsResponse added in v0.4.0

type ListSessionModelRunsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ModelRunPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionModelRunsResponse200Headers
}

func ParseListSessionModelRunsResponse added in v0.4.0

func ParseListSessionModelRunsResponse(rsp *http.Response) (*ListSessionModelRunsResponse, error)

ParseListSessionModelRunsResponse parses an HTTP response from a ListSessionModelRunsWithResponse call

func (ListSessionModelRunsResponse) ContentType added in v0.4.0

func (r ListSessionModelRunsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionModelRunsResponse) GetBody added in v0.4.0

func (r ListSessionModelRunsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionModelRunsResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionModelRunsResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionModelRunsResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionModelRunsResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionModelRunsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionModelRunsResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionModelRunsResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (ListSessionModelRunsResponse) StatusCode added in v0.4.0

func (r ListSessionModelRunsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionModelRunsResponse200Headers added in v0.4.0

type ListSessionModelRunsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionModelRunsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionModelRuns

type ListSessionNoticesParams added in v0.4.0

type ListSessionNoticesParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionNoticesParams defines parameters for ListSessionNotices.

type ListSessionNoticesResponse added in v0.4.0

type ListSessionNoticesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SessionNoticePage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionNoticesResponse200Headers
}

func ParseListSessionNoticesResponse added in v0.4.0

func ParseListSessionNoticesResponse(rsp *http.Response) (*ListSessionNoticesResponse, error)

ParseListSessionNoticesResponse parses an HTTP response from a ListSessionNoticesWithResponse call

func (ListSessionNoticesResponse) ContentType added in v0.4.0

func (r ListSessionNoticesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionNoticesResponse) GetBody added in v0.4.0

func (r ListSessionNoticesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionNoticesResponse) GetJSON200 added in v0.4.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionNoticesResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionNoticesResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionNoticesResponse) GetJSON404 added in v0.4.0

func (r ListSessionNoticesResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionNoticesResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionNoticesResponse) GetJSON500 added in v0.4.0

func (r ListSessionNoticesResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionNoticesResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (ListSessionNoticesResponse) StatusCode added in v0.4.0

func (r ListSessionNoticesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionNoticesResponse200Headers added in v0.4.0

type ListSessionNoticesResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionNoticesResponse200Headers the declared response headers of an HTTP 200 response for ListSessionNotices

type ListSessionTurnsParams added in v0.4.0

type ListSessionTurnsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionTurnsParams defines parameters for ListSessionTurns.

type ListSessionTurnsResponse added in v0.4.0

type ListSessionTurnsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *TurnPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionTurnsResponse200Headers
}

func ParseListSessionTurnsResponse added in v0.4.0

func ParseListSessionTurnsResponse(rsp *http.Response) (*ListSessionTurnsResponse, error)

ParseListSessionTurnsResponse parses an HTTP response from a ListSessionTurnsWithResponse call

func (ListSessionTurnsResponse) ContentType added in v0.4.0

func (r ListSessionTurnsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionTurnsResponse) GetBody added in v0.4.0

func (r ListSessionTurnsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionTurnsResponse) GetJSON200 added in v0.4.0

func (r ListSessionTurnsResponse) GetJSON200() *TurnPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionTurnsResponse) GetJSON400 added in v0.4.0

func (r ListSessionTurnsResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionTurnsResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionTurnsResponse) GetJSON404 added in v0.4.0

func (r ListSessionTurnsResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionTurnsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionTurnsResponse) GetJSON500 added in v0.4.0

func (r ListSessionTurnsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionTurnsResponse) Status added in v0.4.0

func (r ListSessionTurnsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSessionTurnsResponse) StatusCode added in v0.4.0

func (r ListSessionTurnsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionTurnsResponse200Headers added in v0.4.0

type ListSessionTurnsResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionTurnsResponse200Headers the declared response headers of an HTTP 200 response for ListSessionTurns

type ListSessionWorkersParams added in v0.8.0

type ListSessionWorkersParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListSessionWorkersParams defines parameters for ListSessionWorkers.

type ListSessionWorkersResponse added in v0.8.0

type ListSessionWorkersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerGenerationPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionWorkersResponse200Headers
}

func ParseListSessionWorkersResponse added in v0.8.0

func ParseListSessionWorkersResponse(rsp *http.Response) (*ListSessionWorkersResponse, error)

ParseListSessionWorkersResponse parses an HTTP response from a ListSessionWorkersWithResponse call

func (ListSessionWorkersResponse) ContentType added in v0.8.0

func (r ListSessionWorkersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionWorkersResponse) GetBody added in v0.8.0

func (r ListSessionWorkersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionWorkersResponse) GetJSON200 added in v0.8.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionWorkersResponse) GetJSON400 added in v0.8.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionWorkersResponse) GetJSON401 added in v0.8.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionWorkersResponse) GetJSON404 added in v0.8.0

func (r ListSessionWorkersResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSessionWorkersResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionWorkersResponse) GetJSON500 added in v0.8.0

func (r ListSessionWorkersResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionWorkersResponse) Status added in v0.8.0

Status returns HTTPResponse.Status

func (ListSessionWorkersResponse) StatusCode added in v0.8.0

func (r ListSessionWorkersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionWorkersResponse200Headers added in v0.8.0

type ListSessionWorkersResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListSessionWorkersResponse200Headers the declared response headers of an HTTP 200 response for ListSessionWorkers

type ListSessionsParams added in v0.8.0

type ListSessionsParams struct {
	// Limit The largest number of items to return, from 1 to 200. Defaults to 50. A value outside that range answers `400 VALIDATION_FAILED`.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset How many items of the ordered list to skip before the page starts. Defaults to 0. To read the next page, add the previous page's `limit` to its `offset`. An offset past the end returns an empty page.
	Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"`
}

ListSessionsParams defines parameters for ListSessions.

type ListSessionsResponse added in v0.8.0

type ListSessionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SessionPage
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListSessionsResponse200Headers
}

func ParseListSessionsResponse added in v0.8.0

func ParseListSessionsResponse(rsp *http.Response) (*ListSessionsResponse, error)

ParseListSessionsResponse parses an HTTP response from a ListSessionsWithResponse call

func (ListSessionsResponse) ContentType added in v0.8.0

func (r ListSessionsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSessionsResponse) GetBody added in v0.8.0

func (r ListSessionsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSessionsResponse) GetJSON200 added in v0.8.0

func (r ListSessionsResponse) GetJSON200() *SessionPage

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSessionsResponse) GetJSON400 added in v0.8.0

func (r ListSessionsResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSessionsResponse) GetJSON401 added in v0.8.0

func (r ListSessionsResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListSessionsResponse) GetJSON406 added in v0.52.0

func (r ListSessionsResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListSessionsResponse) GetJSON500 added in v0.8.0

func (r ListSessionsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListSessionsResponse) Status added in v0.8.0

func (r ListSessionsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSessionsResponse) StatusCode added in v0.8.0

func (r ListSessionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSessionsResponse200Headers added in v0.8.0

type ListSessionsResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListSessionsResponse200Headers the declared response headers of an HTTP 200 response for ListSessions

type ListWorkspaceFilesParams added in v0.51.0

type ListWorkspaceFilesParams struct {
	// Path The path to inspect, relative to the workspace, such as `src` or `src/main.go`. Omit it or pass an empty value to list the workspace root.
	Path *string `form:"path,omitempty" json:"path,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ListWorkspaceFilesParams defines parameters for ListWorkspaceFiles.

type ListWorkspaceFilesResponse added in v0.51.0

type ListWorkspaceFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkspaceFileListing
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListWorkspaceFilesResponse200Headers
}

func ParseListWorkspaceFilesResponse added in v0.51.0

func ParseListWorkspaceFilesResponse(rsp *http.Response) (*ListWorkspaceFilesResponse, error)

ParseListWorkspaceFilesResponse parses an HTTP response from a ListWorkspaceFilesWithResponse call

func (ListWorkspaceFilesResponse) ContentType added in v0.51.0

func (r ListWorkspaceFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListWorkspaceFilesResponse) GetBody added in v0.51.0

func (r ListWorkspaceFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListWorkspaceFilesResponse) GetJSON200 added in v0.51.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON400 added in v0.51.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON401 added in v0.51.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON403 added in v0.51.0

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON404 added in v0.51.0

func (r ListWorkspaceFilesResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListWorkspaceFilesResponse) GetJSON500 added in v0.51.0

func (r ListWorkspaceFilesResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListWorkspaceFilesResponse) Status added in v0.51.0

Status returns HTTPResponse.Status

func (ListWorkspaceFilesResponse) StatusCode added in v0.51.0

func (r ListWorkspaceFilesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListWorkspaceFilesResponse200Headers added in v0.51.0

type ListWorkspaceFilesResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ListWorkspaceFilesResponse200Headers the declared response headers of an HTTP 200 response for ListWorkspaceFiles

type ListWorkspaceRootsResponse added in v0.13.0

type ListWorkspaceRootsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkspaceRootList
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ListWorkspaceRootsResponse200Headers
}

func ParseListWorkspaceRootsResponse added in v0.13.0

func ParseListWorkspaceRootsResponse(rsp *http.Response) (*ListWorkspaceRootsResponse, error)

ParseListWorkspaceRootsResponse parses an HTTP response from a ListWorkspaceRootsWithResponse call

func (ListWorkspaceRootsResponse) ContentType added in v0.13.0

func (r ListWorkspaceRootsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListWorkspaceRootsResponse) GetBody added in v0.13.0

func (r ListWorkspaceRootsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListWorkspaceRootsResponse) GetJSON200 added in v0.13.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListWorkspaceRootsResponse) GetJSON401 added in v0.13.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListWorkspaceRootsResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ListWorkspaceRootsResponse) GetJSON500 added in v0.13.0

func (r ListWorkspaceRootsResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ListWorkspaceRootsResponse) Status added in v0.13.0

Status returns HTTPResponse.Status

func (ListWorkspaceRootsResponse) StatusCode added in v0.13.0

func (r ListWorkspaceRootsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListWorkspaceRootsResponse200Headers added in v0.13.0

type ListWorkspaceRootsResponse200Headers struct {
	XRequestID openapi_types.UUID
}

ListWorkspaceRootsResponse200Headers the declared response headers of an HTTP 200 response for ListWorkspaceRoots

type MCPPrompt added in v0.54.0

type MCPPrompt struct {
	// Arguments The arguments the prompt takes, each passed as `name=value`. Empty when it takes none.
	Arguments []MCPPromptArgument `json:"arguments"`

	// Description What the prompt does, cut to 256 bytes. Absent when it gave none.
	Description *string `json:"description,omitempty"`

	// Name The prompt name to put after `/mcp:<server>:`.
	Name string `json:"name"`

	// Title The prompt's display name, cut to 256 bytes. Absent when it gave none.
	Title *string `json:"title,omitempty"`
}

MCPPrompt One prompt an MCP server offers. The server writes every field.

type MCPPromptArgument added in v0.54.0

type MCPPromptArgument struct {
	// Description What the argument holds, cut to 256 bytes. Absent when the server gave none.
	Description *string `json:"description,omitempty"`

	// Name The argument name.
	Name string `json:"name"`

	// Required Whether the prompt needs the argument.
	Required bool `json:"required"`
}

MCPPromptArgument One argument an MCP prompt takes.

type MCPServerFeature added in v0.54.0

type MCPServerFeature string

MCPServerFeature An MCP capability a server advertised.

- `tools`: tools the agent can call. - `resources`: resources and resource templates, which the agent reads with `listMcpResources` and `readMcpResource`. - `resourceSubscribe`: change notifications for single resources. Peen does not subscribe. - `prompts`: prompts a user invokes with `/mcp:<server>:<prompt>` and the agent reads with `listMcpPrompts` and `getMcpPrompt`. - `completions`: argument completion for prompts and resource templates. Peen does not use it.

const (
	MCPServerFeatureCompletions       MCPServerFeature = "completions"
	MCPServerFeaturePrompts           MCPServerFeature = "prompts"
	MCPServerFeatureResourceSubscribe MCPServerFeature = "resourceSubscribe"
	MCPServerFeatureResources         MCPServerFeature = "resources"
	MCPServerFeatureTools             MCPServerFeature = "tools"
)

Defines values for MCPServerFeature.

func (MCPServerFeature) Valid added in v0.54.0

func (e MCPServerFeature) Valid() bool

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

type MCPServerInfo added in v0.54.0

type MCPServerInfo struct {
	// Name The server implementation's name.
	Name string `json:"name"`

	// Title The server's display name. Absent when it gave none.
	Title *string `json:"title,omitempty"`

	// Version The server's version. Absent when it gave none.
	Version *string `json:"version,omitempty"`
}

MCPServerInfo What an MCP server says it is. The server writes every field, each cut to 128 bytes. Absent when the server gave no name.

type MCPServerStatus added in v0.38.0

type MCPServerStatus struct {
	// Error Why the server failed. Absent for a ready server.
	Error *string `json:"error,omitempty"`

	// Features The MCP capabilities the server advertised, whether or not its mcp.json entry turns them off. Absent for a failed server.
	Features *[]MCPServerFeature `json:"features,omitempty"`

	// InstructionsBytes The size in bytes of the instructions the server sent, after the `PEEN_MCP_MAX_INSTRUCTIONS_BYTES` cut when that limit is above zero. Absent when the server sent none or failed.
	InstructionsBytes *int `json:"instructionsBytes,omitempty"`

	// InstructionsCut Whether the server's instructions were longer than `PEEN_MCP_MAX_INSTRUCTIONS_BYTES` and only their start is kept. Absent when false.
	InstructionsCut *bool `json:"instructionsCut,omitempty"`

	// InstructionsIncluded Whether the server's instructions reach the agent's system prompt. They do when the server sent some, its mcp.json entry does not set `instructions` to false, and `PEEN_MCP_MAX_INSTRUCTIONS_BYTES` is above zero. Absent when false.
	InstructionsIncluded *bool `json:"instructionsIncluded,omitempty"`

	// Name The server name from mcp.json. Empty when a whole mcp.json file was refused.
	Name string `json:"name"`

	// Prompts The prompts the server offers, which a user invokes with a message that starts with `/mcp:<server>:<prompt>`. At most the first 50 of the server's first page. Absent when the server offers none, its mcp.json entry sets `prompts` to false, or it failed.
	Prompts *[]MCPPrompt `json:"prompts,omitempty"`

	// ProtocolVersion The MCP protocol version the connection speaks, such as `2026-07-28`, or `2025-11-25` for a server that predates it. At most 128 bytes. Absent for a failed server.
	ProtocolVersion *string `json:"protocolVersion,omitempty"`

	// ServerInfo What an MCP server says it is. The server writes every field, each cut to 128 bytes. Absent when the server gave no name.
	ServerInfo *MCPServerInfo `json:"serverInfo,omitempty"`

	// Source The layer whose `.agents/mcp.json` defines the server.
	//
	// - `config`: the config directory's `.agents/mcp.json`.
	// - `workspace`: the session workspace's `.agents/mcp.json`, read only when the deployment enables workspace MCP servers.
	Source MCPServerStatusSource `json:"source"`

	// State The server's state when the worker reported.
	//
	// - `ready`: the server started and listed its tools.
	// - `failed`: its entry was refused, it could not start, or its connection had failed when the worker reported.
	State MCPServerStatusState `json:"state"`

	// Tools The exposed tool names the agent can call, each `mcp__<server>__<tool>`. Empty for a failed server.
	Tools []string `json:"tools"`

	// Transport How Peen reaches the server. Absent when a whole file was refused.
	//
	// - `stdio`: a server process the worker starts.
	// - `http`: a Streamable HTTP endpoint.
	Transport *MCPServerStatusTransport `json:"transport,omitempty"`

	// Warnings Problems that did not stop the server, such as a name in its `tools` list that the server does not offer. Absent when there are none.
	Warnings *[]string `json:"warnings,omitempty"`
}

MCPServerStatus One MCP server from an `.agents/mcp.json` file and its state when the worker last started it. A whole `mcp.json` file that could not be read or parsed also appears as one entry, with an empty `name`.

type MCPServerStatusSource added in v0.38.0

type MCPServerStatusSource string

MCPServerStatusSource The layer whose `.agents/mcp.json` defines the server.

- `config`: the config directory's `.agents/mcp.json`. - `workspace`: the session workspace's `.agents/mcp.json`, read only when the deployment enables workspace MCP servers.

const (
	MCPServerStatusSourceConfig    MCPServerStatusSource = "config"
	MCPServerStatusSourceWorkspace MCPServerStatusSource = "workspace"
)

Defines values for MCPServerStatusSource.

func (MCPServerStatusSource) Valid added in v0.38.0

func (e MCPServerStatusSource) Valid() bool

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

type MCPServerStatusState added in v0.38.0

type MCPServerStatusState string

MCPServerStatusState The server's state when the worker reported.

- `ready`: the server started and listed its tools. - `failed`: its entry was refused, it could not start, or its connection had failed when the worker reported.

const (
	MCPServerStatusStateFailed MCPServerStatusState = "failed"
	MCPServerStatusStateReady  MCPServerStatusState = "ready"
)

Defines values for MCPServerStatusState.

func (MCPServerStatusState) Valid added in v0.38.0

func (e MCPServerStatusState) Valid() bool

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

type MCPServerStatusTransport added in v0.38.0

type MCPServerStatusTransport string

MCPServerStatusTransport How Peen reaches the server. Absent when a whole file was refused.

- `stdio`: a server process the worker starts. - `http`: a Streamable HTTP endpoint.

const (
	MCPServerStatusTransportHttp  MCPServerStatusTransport = "http"
	MCPServerStatusTransportStdio MCPServerStatusTransport = "stdio"
)

Defines values for MCPServerStatusTransport.

func (MCPServerStatusTransport) Valid added in v0.38.0

func (e MCPServerStatusTransport) Valid() bool

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

type MCPStatusReport added in v0.38.0

type MCPStatusReport struct {
	// ReportedAt When the worker reported, at the start of a turn. Null before the first report.
	ReportedAt *time.Time `json:"reportedAt"`

	// Servers Every configured server and what happened when the worker started it. Servers that loaded come first, then entries refused while reading `mcp.json`. Empty before the first report and when the latest turn had no MCP configuration.
	Servers []MCPServerStatus `json:"servers"`
}

MCPStatusReport The session's MCP servers as the worker last reported them, at the start of a turn. Returned by `GET /session/mcp`.

type Message

type Message struct {
	// CompactionId The compaction that summarized this message, when one did. A later compaction that includes the earlier summary never rewrites it. Absent otherwise.
	CompactionId *openapi_types.UUID `json:"compactionId,omitempty"`

	// Content The message text.
	Content string `json:"content"`

	// CreatedAt When the message was stored, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// Id The message ID.
	Id openapi_types.UUID `json:"id"`

	// Images The images the message carries, without their bytes, in the order the model sees them after the text. Absent when it has none.
	Images *[]MessageImageInfo `json:"images,omitempty"`

	// Incomplete True when the message was written by a turn that did not complete, for example one that was cancelled or failed. Absent when false.
	Incomplete *bool `json:"incomplete,omitempty"`

	// Injected True when Peen added this message to the conversation itself, such as a report of session events delivered during a turn or the instructions of an event handler that started a turn, rather than a person or the model writing it.
	Injected *bool `json:"injected,omitempty"`

	// InjectedKind What an injected message is, when it is more than a generic update. Absent for every other message.
	//
	// - `skill`: a skill the user invoked with `:name`, delivered as its own message after the message that named it, or the note that the skill was already loaded.
	// - `image`: the message that shows the model an image readFile read, after that tool round.
	InjectedKind *MessageInjectedKind `json:"injectedKind,omitempty"`

	// IsError True when a `tool` message reports a failed tool call. Absent when false.
	IsError *bool `json:"isError,omitempty"`

	// Model The `connection/model` reference that wrote an assistant message. Absent for other messages.
	Model *string `json:"model,omitempty"`

	// Role Who wrote the message. The model receives a `system` message as a system message.
	//
	// - `system`: a notice Peen added to the conversation, such as how the previous turn ended and what it was asked.
	// - `user`: a person's message, or an update Peen injected as user input.
	// - `assistant`: a model response.
	// - `tool`: a tool result.
	Role MessageRole `json:"role"`

	// Sequence Position in the session's conversation, starting at 1.
	Sequence int64 `json:"sequence"`

	// Thinking The model's reasoning text for an assistant message, when the provider returned any. Absent otherwise.
	Thinking *string `json:"thinking,omitempty"`

	// ToolCallId For a `tool` message, the ID of the tool call this result answers. Absent otherwise.
	ToolCallId *string `json:"toolCallId,omitempty"`

	// ToolCalls The tool calls an assistant message made, in order. Absent when it made none.
	ToolCalls *[]MessageToolCall `json:"toolCalls,omitempty"`

	// TurnId The turn that wrote this message. Messages that share it belong to one turn.
	TurnId *openapi_types.UUID `json:"turnId,omitempty"`

	// Workspace The workspace directory the session was in when the message was stored.
	Workspace string `json:"workspace"`
}

Message One stored message of a session's root conversation, as `GET /messages` returns it. Optional fields are absent, not null, when they do not apply.

type MessageImageInfo added in v0.38.0

type MessageImageInfo struct {
	// MediaType The image's media type: `image/png`, `image/jpeg`, `image/gif`, or `image/webp`.
	MediaType string `json:"mediaType"`

	// SizeBytes The image's decoded size in bytes.
	SizeBytes int64 `json:"sizeBytes"`
}

MessageImageInfo An image carried by a message, described without its bytes.

type MessageInjectedKind added in v0.18.0

type MessageInjectedKind string

MessageInjectedKind What an injected message is, when it is more than a generic update. Absent for every other message.

- `skill`: a skill the user invoked with `:name`, delivered as its own message after the message that named it, or the note that the skill was already loaded. - `image`: the message that shows the model an image readFile read, after that tool round.

const (
	MessageInjectedKindImage MessageInjectedKind = "image"
	MessageInjectedKindSkill MessageInjectedKind = "skill"
)

Defines values for MessageInjectedKind.

func (MessageInjectedKind) Valid added in v0.18.0

func (e MessageInjectedKind) Valid() bool

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

type MessagePage

type MessagePage struct {
	// HasMore True when more messages follow this page.
	HasMore bool `json:"hasMore"`

	// Items The messages on this page, in the requested order.
	Items []Message `json:"items"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Offset The number of messages skipped before this page.
	Offset int32 `json:"offset"`
}

MessagePage One page of `GET /messages`.

type MessageRole

type MessageRole string

MessageRole Who wrote the message. The model receives a `system` message as a system message.

- `system`: a notice Peen added to the conversation, such as how the previous turn ended and what it was asked. - `user`: a person's message, or an update Peen injected as user input. - `assistant`: a model response. - `tool`: a tool result.

const (
	MessageRoleAssistant MessageRole = "assistant"
	MessageRoleSystem    MessageRole = "system"
	MessageRoleTool      MessageRole = "tool"
	MessageRoleUser      MessageRole = "user"
)

Defines values for MessageRole.

func (MessageRole) Valid

func (e MessageRole) Valid() bool

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

type MessageToolCall

type MessageToolCall struct {
	// Arguments The arguments the model passed, as a JSON object.
	Arguments map[string]interface{} `json:"arguments"`

	// Id The call ID. The `tool` message that answers it carries the same value in `toolCallId`.
	Id string `json:"id"`

	// Name The tool name.
	Name string `json:"name"`
}

MessageToolCall One tool call an assistant message made. It appears in `Message.toolCalls` and `AgentRunMessage.toolCalls`.

type Model added in v0.12.0

type Model struct {
	// ConnectionName The configured connection part of `name`, before the first `/`.
	ConnectionName string `json:"connectionName"`

	// ContextWindowTokens The context window Peen enforces for this model, in tokens. It comes from the provider driver's model catalog; for a model the catalog does not cover, it is `PEEN_MAX_CONTEXT_TOKENS`.
	ContextWindowTokens int64 `json:"contextWindowTokens"`

	// ImageInput Whether the model takes images, in message.send and from readFile. An upstream with "imageInput": false makes every one of its models text-only.
	ImageInput bool `json:"imageInput"`

	// ModelId The raw model identifier the upstream accepted, the part of `name` after the first `/`.
	ModelId string `json:"modelId"`

	// Name The exact `connection/model` reference a WebSocket `message.send` frame passes as `data.model` to run one turn on this model.
	Name string `json:"name"`
}

Model One model Peen found on a configured connection at controller startup, as `GET /models` lists it.

type ModelCall added in v0.4.0

type ModelCall struct {
	// BilledCostAmount `responseCostAmount` plus `retryCostAmount`, as an exact decimal string. Empty when `costKnown` is `false`.
	BilledCostAmount string `json:"billedCostAmount"`

	// CacheReadTokens Prompt tokens the provider served from its cache.
	CacheReadTokens int64 `json:"cacheReadTokens"`

	// CacheWriteLongTtlTokens Prompt tokens the provider wrote to its long-lived cache.
	CacheWriteLongTtlTokens int64 `json:"cacheWriteLongTtlTokens"`

	// CacheWriteTokens Prompt tokens the provider wrote to its cache.
	CacheWriteTokens int64 `json:"cacheWriteTokens"`

	// CompletedAt When the round ended, as an RFC 3339 timestamp. Absent while it runs.
	CompletedAt *time.Time `json:"completedAt,omitempty"`

	// CompletionTokens Completion tokens the provider reported for the successful attempt.
	CompletionTokens int64 `json:"completionTokens"`

	// CostKnown `true` when the model has prices configured, so the cost amounts are filled in. `false` means the cost is unknown, not zero.
	CostKnown bool `json:"costKnown"`

	// FailureClassification Why the round did not complete: `model` for a provider or model error, `cancelled` for a cancellation or deadline, or `interrupted` when Peen stopped. Empty for a running or completed round.
	FailureClassification string `json:"failureClassification"`

	// FailureDetail The error text for a round that did not complete. Empty otherwise.
	FailureDetail string `json:"failureDetail"`

	// FinishReason Why the provider stopped generating, as the provider reported it. Empty until the round ends.
	FinishReason string `json:"finishReason"`

	// Id The round's ID.
	Id openapi_types.UUID `json:"id"`

	// ModelRunId The model run this round belongs to.
	ModelRunId openapi_types.UUID `json:"modelRunId"`

	// PromptTokens Prompt tokens the provider reported for the successful attempt.
	PromptTokens int64 `json:"promptTokens"`

	// ReasoningTokens Reasoning tokens the provider reported, a part of the completion tokens.
	ReasoningTokens int64 `json:"reasoningTokens"`

	// RequestMessages The exact messages sent to the provider for this round, the whole conversation so far. Images are base64 encoded.
	RequestMessages []interface{} `json:"requestMessages"`

	// RequestTools The tool definitions the provider saw for this round. Each has `name`, `description`, `argumentsSchema`, `strictArguments`, and `timeoutMs`.
	RequestTools []interface{} `json:"requestTools"`

	// ResponseCostAmount Cost of the successful attempt as an exact decimal string, in the currency of the model's prices. Empty when `costKnown` is `false`.
	ResponseCostAmount string `json:"responseCostAmount"`

	// ResponseMessage The assistant message the provider returned for this round. `null` while the round runs and when it ended before a message arrived.
	ResponseMessage *map[string]interface{} `json:"responseMessage"`

	// ResponseModelId The model ID the provider reported. Empty until the round ends.
	ResponseModelId string `json:"responseModelId"`

	// ResponseUsage The provider's usage report for this round, an object with the token counts (`prompt`, `completion`, `total`, `reasoning`, `cacheRead`, `cacheWrite`, `cacheWriteLongTtl`), `model`, `finishReason`, `totalAttempts`, `failedAttempts`, and the wasted token counts. Empty while the round runs.
	ResponseUsage map[string]interface{} `json:"responseUsage"`

	// RetryAttemptCount How many times the round was tried again after a failure.
	RetryAttemptCount int64 `json:"retryAttemptCount"`

	// RetryAttempts The failed attempts of this round that Peen retried or gave up on, oldest first. Peen saves each one as it happens.
	RetryAttempts []map[string]interface{} `json:"retryAttempts"`

	// RetryCostAmount Cost of the failed attempts as an exact decimal string. Empty when `costKnown` is `false`.
	RetryCostAmount string `json:"retryCostAmount"`

	// Round The round's position within its model run, counting from 0.
	Round int64 `json:"round"`

	// SessionId The session that made the request.
	SessionId openapi_types.UUID `json:"sessionId"`

	// StartedAt When Peen stored the request, just before sending it, as an RFC 3339 timestamp.
	StartedAt time.Time `json:"startedAt"`

	// State The round's lifecycle state.
	//
	// - `running`: has not ended.
	// - `completed`: returned a response.
	// - `failed`: ended with a provider or model error.
	// - `cancelled`: was cancelled or ran past its deadline.
	// - `interrupted`: was still running when Peen stopped.
	State ModelCallState `json:"state"`

	// TotalAttempts How many attempts the round made, the successful one included. 0 until the round ends.
	TotalAttempts int64 `json:"totalAttempts"`

	// TotalTokens Total tokens the provider reported for the successful attempt.
	TotalTokens int64 `json:"totalTokens"`

	// WastedCompletionTokens Completion tokens spent on failed attempts of this round.
	WastedCompletionTokens int64 `json:"wastedCompletionTokens"`

	// WastedPromptTokens Prompt tokens spent on failed attempts of this round.
	WastedPromptTokens int64 `json:"wastedPromptTokens"`

	// WastedTotalTokens Total tokens spent on failed attempts of this round.
	WastedTotalTokens int64 `json:"wastedTotalTokens"`
}

ModelCall One provider round within a model run: the exact request Peen sent and the response, usage, retries and costs of that round. It appears in `ModelCallPage.calls`.

type ModelCallPage added in v0.4.0

type ModelCallPage struct {
	// Calls The rounds on this page, ordered by `round` ascending.
	Calls []ModelCall `json:"calls"`

	// HasMore `true` when at least one more round exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// ModelRun One logical model request Peen made for a turn, a child agent or a compaction, which can span several provider rounds. Peen writes it before provider work starts and finalizes it when the run ends. It appears in `ModelRunPage` and in `ModelCallPage`.
	ModelRun ModelRun `json:"modelRun"`

	// Offset The number of rounds skipped before this page.
	Offset int32 `json:"offset"`
}

ModelCallPage One model run and a page of its provider rounds, returned by `GET /session/model-runs/{modelRunId}/calls`.

type ModelCallState added in v0.4.0

type ModelCallState string

ModelCallState The round's lifecycle state.

- `running`: has not ended. - `completed`: returned a response. - `failed`: ended with a provider or model error. - `cancelled`: was cancelled or ran past its deadline. - `interrupted`: was still running when Peen stopped.

const (
	ModelCallStateCancelled   ModelCallState = "cancelled"
	ModelCallStateCompleted   ModelCallState = "completed"
	ModelCallStateFailed      ModelCallState = "failed"
	ModelCallStateInterrupted ModelCallState = "interrupted"
	ModelCallStateRunning     ModelCallState = "running"
)

Defines values for ModelCallState.

func (ModelCallState) Valid added in v0.4.0

func (e ModelCallState) Valid() bool

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

type ModelList added in v0.12.0

type ModelList struct {
	// Models The discovered models, sorted by `name`. Empty when the controller has no model catalog.
	Models []Model `json:"models"`
}

ModelList The response of `GET /models`.

type ModelRun added in v0.4.0

type ModelRun struct {
	// AgentRunId The child agent run that made the request. Set for `child` runs and for compactions of a child agent's conversation. Absent for the root conversation.
	AgentRunId *openapi_types.UUID `json:"agentRunId,omitempty"`

	// BilledCostAmount `responseCostAmount` plus `retryCostAmount`, as an exact decimal string. Empty when `costKnown` is `false`.
	BilledCostAmount string `json:"billedCostAmount"`

	// CompletedAt When the run ended, as an RFC 3339 timestamp. Absent while it runs.
	CompletedAt *time.Time `json:"completedAt,omitempty"`

	// ConnectionName The connection part of `modelReference`, before the first `/`.
	ConnectionName string `json:"connectionName"`

	// CostKnown `true` when the model has prices configured, so the cost amounts are filled in. `false` means the cost is unknown, not zero.
	CostKnown bool `json:"costKnown"`

	// FailureClassification Why the run did not complete: `model` for a provider or model error, `cancelled` for a cancellation or deadline, or `interrupted` when Peen stopped. Empty for a running or completed run.
	FailureClassification string `json:"failureClassification"`

	// FailureDetail The error text for a run that did not complete. Empty otherwise.
	FailureDetail string `json:"failureDetail"`

	// FinishReason Why the model stopped, as the provider reported it for the last round. Empty until the run returns.
	FinishReason string `json:"finishReason"`

	// Id The model run's ID. Use it with `GET /session/model-runs/{modelRunId}/calls`.
	Id openapi_types.UUID `json:"id"`

	// ModelReference The configured model reference the run asked for, in the form `<connection>/<model>`.
	ModelReference string `json:"modelReference"`

	// RequestSettings The request settings in effect, without endpoint URLs or credentials, such as `model`, `autoToolCalls`, `streaming`, `maxRounds`, `maxContextTokens`, `maxOutputTokens`, `maxConcurrentTools`, `toolTimeoutMs`, `maxToolResultTokens`, `timeoutMs`, and `generationParams`.
	RequestSettings map[string]interface{} `json:"requestSettings"`

	// RequestedModelId The model part of `modelReference`, after the first `/`.
	RequestedModelId string `json:"requestedModelId"`

	// ResponseCostAmount Cost of the run's successful attempts as an exact decimal string, in the currency of the model's prices. Empty when `costKnown` is `false`.
	ResponseCostAmount string `json:"responseCostAmount"`

	// ResponseInjections The messages tool injectors added during the run, in the order they fired. They also appear in `responseMessages`; this list is the audit trail.
	ResponseInjections []interface{} `json:"responseInjections"`

	// ResponseMessages The full message list the run ended with: the conversation it was given plus every message it added, tool calls and results included. Empty until the run returns.
	ResponseMessages []interface{} `json:"responseMessages"`

	// ResponseModelId The model ID the provider reported in its response. Empty until the run returns a response.
	ResponseModelId string `json:"responseModelId"`

	// ResponseText The final text the model returned. Empty until the run completes.
	ResponseText string `json:"responseText"`

	// ResponseThinking The reasoning text the model returned, when it exposes one. Empty otherwise.
	ResponseThinking string `json:"responseThinking"`

	// ResponseUsage The usage summed over every round of the run, with the same keys as a round's `responseUsage`. Empty until the run returns.
	ResponseUsage map[string]interface{} `json:"responseUsage"`

	// RetryCostAmount Cost of the run's failed attempts as an exact decimal string. Empty when `costKnown` is `false`.
	RetryCostAmount string `json:"retryCostAmount"`

	// SessionId The session that made the request.
	SessionId openapi_types.UUID `json:"sessionId"`

	// Stage Which kind of work issued the run.
	//
	// - `turn`: the root conversation.
	// - `child`: a child agent.
	// - `compaction`: a summary of older messages.
	Stage ModelRunStage `json:"stage"`

	// StartedAt When Peen stored the run, before any provider work, as an RFC 3339 timestamp.
	StartedAt time.Time `json:"startedAt"`

	// State The run's lifecycle state.
	//
	// - `running`: has not ended.
	// - `completed`: returned a response.
	// - `failed`: ended with a provider or model error.
	// - `cancelled`: was cancelled or ran past its deadline.
	// - `interrupted`: was still running when Peen stopped.
	State ModelRunState `json:"state"`

	// TurnId The root turn during which the run happened. Child agent and compaction runs carry the turn they ran under.
	TurnId openapi_types.UUID `json:"turnId"`
}

ModelRun One logical model request Peen made for a turn, a child agent or a compaction, which can span several provider rounds. Peen writes it before provider work starts and finalizes it when the run ends. It appears in `ModelRunPage` and in `ModelCallPage`.

type ModelRunID added in v0.4.0

type ModelRunID = openapi_types.UUID

ModelRunID defines model for ModelRunID.

type ModelRunPage added in v0.4.0

type ModelRunPage struct {
	// HasMore `true` when at least one more run exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// ModelRuns The model runs on this page, ordered by `startedAt` descending.
	ModelRuns []ModelRun `json:"modelRuns"`

	// Offset The number of runs skipped before this page.
	Offset int32 `json:"offset"`
}

ModelRunPage One page of a session's model runs, newest first, returned by `GET /session/model-runs`.

type ModelRunStage added in v0.4.0

type ModelRunStage string

ModelRunStage Which kind of work issued the run.

- `turn`: the root conversation. - `child`: a child agent. - `compaction`: a summary of older messages.

const (
	ModelRunStageChild      ModelRunStage = "child"
	ModelRunStageCompaction ModelRunStage = "compaction"
	ModelRunStageTurn       ModelRunStage = "turn"
)

Defines values for ModelRunStage.

func (ModelRunStage) Valid added in v0.4.0

func (e ModelRunStage) Valid() bool

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

type ModelRunState added in v0.4.0

type ModelRunState string

ModelRunState The run's lifecycle state.

- `running`: has not ended. - `completed`: returned a response. - `failed`: ended with a provider or model error. - `cancelled`: was cancelled or ran past its deadline. - `interrupted`: was still running when Peen stopped.

const (
	ModelRunStateCancelled   ModelRunState = "cancelled"
	ModelRunStateCompleted   ModelRunState = "completed"
	ModelRunStateFailed      ModelRunState = "failed"
	ModelRunStateInterrupted ModelRunState = "interrupted"
	ModelRunStateRunning     ModelRunState = "running"
)

Defines values for ModelRunState.

func (ModelRunState) Valid added in v0.4.0

func (e ModelRunState) Valid() bool

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

type Offset

type Offset = int32

Offset defines model for Offset.

type OpenSessionJSONRequestBody added in v0.8.0

type OpenSessionJSONRequestBody = OpenSessionRequest

OpenSessionJSONRequestBody defines body for OpenSession for application/json ContentType.

type OpenSessionRequest added in v0.8.0

type OpenSessionRequest struct {
	// AgentSpace The agent space to run in, `control` or `docker:<profile>` (see `GET /agent-spaces`). Leave it out to get the workspace's agent space, or the deployment default for a workspace with no session yet. Naming a different agent space than the workspace's returns 409 `AGENT_SPACE_CONFLICT`, and naming one the deployment does not offer returns 403 `AGENT_SPACE_NOT_ALLOWED`. This is the only environment choice a client makes: images, mounts, network, and capabilities come from deployment configuration alone.
	AgentSpace *string `json:"agentSpace,omitempty"`

	// Workspace Absolute host path of the workspace directory. It is resolved through its symbolic links and must be an existing directory beneath a configured workspace root (see `GET /workspace-roots`).
	Workspace string `json:"workspace"`
}

OpenSessionRequest The body of `POST /sessions/open`.

type OpenSessionResponse added in v0.8.0

type OpenSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *OpenedSession
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ErrorConflict
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *OpenSessionResponse200Headers
}

func ParseOpenSessionResponse added in v0.8.0

func ParseOpenSessionResponse(rsp *http.Response) (*OpenSessionResponse, error)

ParseOpenSessionResponse parses an HTTP response from a OpenSessionWithResponse call

func (OpenSessionResponse) ContentType added in v0.8.0

func (r OpenSessionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (OpenSessionResponse) GetBody added in v0.8.0

func (r OpenSessionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (OpenSessionResponse) GetJSON200 added in v0.8.0

func (r OpenSessionResponse) GetJSON200() *OpenedSession

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (OpenSessionResponse) GetJSON400 added in v0.8.0

func (r OpenSessionResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (OpenSessionResponse) GetJSON401 added in v0.8.0

func (r OpenSessionResponse) GetJSON401() *ErrorUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (OpenSessionResponse) GetJSON403 added in v0.8.0

func (r OpenSessionResponse) GetJSON403() *ErrorForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (OpenSessionResponse) GetJSON404 added in v0.13.0

func (r OpenSessionResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (OpenSessionResponse) GetJSON406 added in v0.52.0

func (r OpenSessionResponse) GetJSON406() *ErrorNotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (OpenSessionResponse) GetJSON409 added in v0.51.0

func (r OpenSessionResponse) GetJSON409() *ErrorConflict

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (OpenSessionResponse) GetJSON500 added in v0.8.0

func (r OpenSessionResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (OpenSessionResponse) Status added in v0.8.0

func (r OpenSessionResponse) Status() string

Status returns HTTPResponse.Status

func (OpenSessionResponse) StatusCode added in v0.8.0

func (r OpenSessionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type OpenSessionResponse200Headers added in v0.8.0

type OpenSessionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

OpenSessionResponse200Headers the declared response headers of an HTTP 200 response for OpenSession

type OpenSystemSessionResponse added in v0.45.0

type OpenSystemSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *OpenedSession
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *OpenSystemSessionResponse200Headers
}

func ParseOpenSystemSessionResponse added in v0.45.0

func ParseOpenSystemSessionResponse(rsp *http.Response) (*OpenSystemSessionResponse, error)

ParseOpenSystemSessionResponse parses an HTTP response from a OpenSystemSessionWithResponse call

func (OpenSystemSessionResponse) ContentType added in v0.45.0

func (r OpenSystemSessionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (OpenSystemSessionResponse) GetBody added in v0.45.0

func (r OpenSystemSessionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (OpenSystemSessionResponse) GetJSON200 added in v0.45.0

func (r OpenSystemSessionResponse) GetJSON200() *OpenedSession

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (OpenSystemSessionResponse) GetJSON401 added in v0.45.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (OpenSystemSessionResponse) GetJSON403 added in v0.45.0

func (r OpenSystemSessionResponse) GetJSON403() *ErrorForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (OpenSystemSessionResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (OpenSystemSessionResponse) GetJSON500 added in v0.45.0

func (r OpenSystemSessionResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (OpenSystemSessionResponse) Status added in v0.45.0

func (r OpenSystemSessionResponse) Status() string

Status returns HTTPResponse.Status

func (OpenSystemSessionResponse) StatusCode added in v0.45.0

func (r OpenSystemSessionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type OpenSystemSessionResponse200Headers added in v0.45.0

type OpenSystemSessionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

OpenSystemSessionResponse200Headers the declared response headers of an HTTP 200 response for OpenSystemSession

type OpenedSession added in v0.8.0

type OpenedSession struct {
	// Created True when this call created the session, false when it resumed an existing one.
	Created bool `json:"created"`

	// Session A durable session: one conversation in one workspace directory, with its counters and the agent space its tools run in. Returned by `GET /session`, `GET /sessions`, and the open operations. Optional fields are absent, not null, when they do not apply.
	Session Session `json:"session"`
}

OpenedSession The response of `POST /sessions/open` and `POST /sessions/system`.

type Order

type Order string

Order defines model for Order.

const (
	OrderAsc  Order = "asc"
	OrderDesc Order = "desc"
)

Defines values for Order.

func (Order) Valid

func (e Order) Valid() bool

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

type PromptHash added in v0.4.0

type PromptHash = string

PromptHash defines model for PromptHash.

type PromptSnapshot added in v0.4.0

type PromptSnapshot struct {
	// CreatedAt When Peen first stored this snapshot, as an RFC 3339 timestamp. A later turn with the same prompt reuses the row and leaves this unchanged.
	CreatedAt time.Time `json:"createdAt"`

	// EffectivePrompt The full system prompt the model received, including any context pre-user-message hooks added.
	EffectivePrompt string `json:"effectivePrompt"`

	// Hash Lowercase hex SHA-256 of `effectivePrompt`. A turn names it in `promptSnapshotHash`.
	Hash string `json:"hash"`
}

PromptSnapshot The exact system prompt one or more turns sent to the model, stored once by hash. Returned by `GET /session/prompt-snapshots/{promptHash}`.

type PublishSessionNoticeJSONRequestBody added in v0.4.0

type PublishSessionNoticeJSONRequestBody = SessionNoticeRequest

PublishSessionNoticeJSONRequestBody defines body for PublishSessionNotice for application/json ContentType.

type PublishSessionNoticeParams added in v0.4.0

type PublishSessionNoticeParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

PublishSessionNoticeParams defines parameters for PublishSessionNotice.

type PublishSessionNoticeResponse added in v0.4.0

type PublishSessionNoticeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *SessionNotice
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers202 the parsed response headers for an HTTP 202 response
	Headers202 *PublishSessionNoticeResponse202Headers
}

func ParsePublishSessionNoticeResponse added in v0.4.0

func ParsePublishSessionNoticeResponse(rsp *http.Response) (*PublishSessionNoticeResponse, error)

ParsePublishSessionNoticeResponse parses an HTTP response from a PublishSessionNoticeWithResponse call

func (PublishSessionNoticeResponse) ContentType added in v0.4.0

func (r PublishSessionNoticeResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PublishSessionNoticeResponse) GetBody added in v0.4.0

func (r PublishSessionNoticeResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PublishSessionNoticeResponse) GetJSON202 added in v0.4.0

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (PublishSessionNoticeResponse) GetJSON400 added in v0.4.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (PublishSessionNoticeResponse) GetJSON401 added in v0.4.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (PublishSessionNoticeResponse) GetJSON404 added in v0.4.0

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (PublishSessionNoticeResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (PublishSessionNoticeResponse) GetJSON500 added in v0.4.0

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (PublishSessionNoticeResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (PublishSessionNoticeResponse) StatusCode added in v0.4.0

func (r PublishSessionNoticeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PublishSessionNoticeResponse202Headers added in v0.4.0

type PublishSessionNoticeResponse202Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

PublishSessionNoticeResponse202Headers the declared response headers of an HTTP 202 response for PublishSessionNotice

type ReadSessionJobOutputParams

type ReadSessionJobOutputParams struct {
	// Stream Which stream to return. `stdout` or `stderr` returns only that stream's lines, and `both`, the default, returns them interleaved in sequence order. With one stream selected, the sequence numbers of the returned lines have gaps where the other stream's lines were.
	Stream *ReadSessionJobOutputParamsStream `form:"stream,omitempty" json:"stream,omitempty"`

	// Cursor Return only lines whose `sequence` is greater than this value. Start at 0, the default, to read from the first line, then pass the previous response's `nextCursor`.
	Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Limit The most lines to return in one window, 1 to 200. Defaults to 50.
	Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ReadSessionJobOutputParams defines parameters for ReadSessionJobOutput.

type ReadSessionJobOutputParamsStream

type ReadSessionJobOutputParamsStream string

ReadSessionJobOutputParamsStream defines parameters for ReadSessionJobOutput.

const (
	ReadSessionJobOutputParamsStreamBoth   ReadSessionJobOutputParamsStream = "both"
	ReadSessionJobOutputParamsStreamStderr ReadSessionJobOutputParamsStream = "stderr"
	ReadSessionJobOutputParamsStreamStdout ReadSessionJobOutputParamsStream = "stdout"
)

Defines values for ReadSessionJobOutputParamsStream.

func (ReadSessionJobOutputParamsStream) Valid

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

type ReadSessionJobOutputResponse

type ReadSessionJobOutputResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *JobOutput
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ReadSessionJobOutputResponse200Headers
}

func ParseReadSessionJobOutputResponse

func ParseReadSessionJobOutputResponse(rsp *http.Response) (*ReadSessionJobOutputResponse, error)

ParseReadSessionJobOutputResponse parses an HTTP response from a ReadSessionJobOutputWithResponse call

func (ReadSessionJobOutputResponse) ContentType

func (r ReadSessionJobOutputResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ReadSessionJobOutputResponse) GetBody

func (r ReadSessionJobOutputResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ReadSessionJobOutputResponse) GetJSON200

func (r ReadSessionJobOutputResponse) GetJSON200() *JobOutput

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ReadSessionJobOutputResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ReadSessionJobOutputResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ReadSessionJobOutputResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ReadSessionJobOutputResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ReadSessionJobOutputResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ReadSessionJobOutputResponse) Status

Status returns HTTPResponse.Status

func (ReadSessionJobOutputResponse) StatusCode

func (r ReadSessionJobOutputResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ReadSessionJobOutputResponse200Headers

type ReadSessionJobOutputResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ReadSessionJobOutputResponse200Headers the declared response headers of an HTTP 200 response for ReadSessionJobOutput

type ReadWorkspaceFileParams added in v0.51.0

type ReadWorkspaceFileParams struct {
	// Path The file to read, relative to the workspace, such as `src/main.go`.
	Path string `form:"path" json:"path"`

	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ReadWorkspaceFileParams defines parameters for ReadWorkspaceFile.

type ReadWorkspaceFileResponse added in v0.51.0

type ReadWorkspaceFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkspaceFileContent
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ReadWorkspaceFileResponse200Headers
}

func ParseReadWorkspaceFileResponse added in v0.51.0

func ParseReadWorkspaceFileResponse(rsp *http.Response) (*ReadWorkspaceFileResponse, error)

ParseReadWorkspaceFileResponse parses an HTTP response from a ReadWorkspaceFileWithResponse call

func (ReadWorkspaceFileResponse) ContentType added in v0.51.0

func (r ReadWorkspaceFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ReadWorkspaceFileResponse) GetBody added in v0.51.0

func (r ReadWorkspaceFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ReadWorkspaceFileResponse) GetJSON200 added in v0.51.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON400 added in v0.51.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON401 added in v0.51.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON403 added in v0.51.0

func (r ReadWorkspaceFileResponse) GetJSON403() *ErrorForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON404 added in v0.51.0

func (r ReadWorkspaceFileResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ReadWorkspaceFileResponse) GetJSON500 added in v0.51.0

func (r ReadWorkspaceFileResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ReadWorkspaceFileResponse) Status added in v0.51.0

func (r ReadWorkspaceFileResponse) Status() string

Status returns HTTPResponse.Status

func (ReadWorkspaceFileResponse) StatusCode added in v0.51.0

func (r ReadWorkspaceFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ReadWorkspaceFileResponse200Headers added in v0.51.0

type ReadWorkspaceFileResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ReadWorkspaceFileResponse200Headers the declared response headers of an HTTP 200 response for ReadWorkspaceFile

type ReconfigureSessionJSONRequestBody added in v0.8.0

type ReconfigureSessionJSONRequestBody = ReconfigureSessionRequest

ReconfigureSessionJSONRequestBody defines body for ReconfigureSession for application/json ContentType.

type ReconfigureSessionParams added in v0.8.0

type ReconfigureSessionParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

ReconfigureSessionParams defines parameters for ReconfigureSession.

type ReconfigureSessionRequest added in v0.8.0

type ReconfigureSessionRequest struct {
	// AgentSpace The agent space to move the workspace session to, `control` or `docker:<profile>`. A name the deployment does not offer returns 403 `AGENT_SPACE_NOT_ALLOWED`, and the agent space the workspace already runs in returns 409 `CONFLICT`. This is the only environment choice a client makes.
	AgentSpace string `json:"agentSpace"`

	// Reason Why the agent space changed, kept in each session's decision history. Must contain a non-whitespace character.
	Reason string `json:"reason"`
}

ReconfigureSessionRequest The body of `POST /session/reconfigure`. Both fields are required and no other field is accepted.

type ReconfigureSessionResponse added in v0.8.0

type ReconfigureSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SessionAgentSpaceDecision
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ErrorConflict
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *ReconfigureSessionResponse200Headers
}

func ParseReconfigureSessionResponse added in v0.8.0

func ParseReconfigureSessionResponse(rsp *http.Response) (*ReconfigureSessionResponse, error)

ParseReconfigureSessionResponse parses an HTTP response from a ReconfigureSessionWithResponse call

func (ReconfigureSessionResponse) ContentType added in v0.8.0

func (r ReconfigureSessionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ReconfigureSessionResponse) GetBody added in v0.8.0

func (r ReconfigureSessionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ReconfigureSessionResponse) GetJSON200 added in v0.8.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ReconfigureSessionResponse) GetJSON400 added in v0.8.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ReconfigureSessionResponse) GetJSON401 added in v0.8.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ReconfigureSessionResponse) GetJSON403 added in v0.8.0

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ReconfigureSessionResponse) GetJSON404 added in v0.8.0

func (r ReconfigureSessionResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ReconfigureSessionResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (ReconfigureSessionResponse) GetJSON409 added in v0.8.0

func (r ReconfigureSessionResponse) GetJSON409() *ErrorConflict

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (ReconfigureSessionResponse) GetJSON500 added in v0.8.0

func (r ReconfigureSessionResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (ReconfigureSessionResponse) Status added in v0.8.0

Status returns HTTPResponse.Status

func (ReconfigureSessionResponse) StatusCode added in v0.8.0

func (r ReconfigureSessionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ReconfigureSessionResponse200Headers added in v0.8.0

type ReconfigureSessionResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

ReconfigureSessionResponse200Headers the declared response headers of an HTTP 200 response for ReconfigureSession

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Session

type Session struct {
	// ActiveTurn True while a turn is running in the session.
	ActiveTurn bool `json:"activeTurn"`

	// ActiveTurnFeedSequence The first feed sequence of the running turn. Set only by `GET /session`, and only while a turn runs and has written at least one frame; absent otherwise. Pass one less than it as `cursor` to `GET /session/feed` to rebuild that turn's live view.
	ActiveTurnFeedSequence *int64 `json:"activeTurnFeedSequence,omitempty"`

	// Agent The root agent that runs the session's turns, such as `core:general-purpose`, or `core:system` for the system session.
	Agent string `json:"agent"`

	// AgentSpace The agent space this session's tools run in, `control` or `docker:<profile>`. Absent for a session recorded before agent spaces existed, which runs in the deployment default.
	AgentSpace *string `json:"agentSpace,omitempty"`

	// CompletedTurnCount Number of turns that completed.
	CompletedTurnCount int64 `json:"completedTurnCount"`

	// CreatedAt When the session was created, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// FeedSequence The session's newest feed sequence, the `head` that `GET /session/feed` would return now. `0` before anything was sent.
	FeedSequence int64 `json:"feedSequence"`

	// Id The session ID. Pass it as `X-Session-ID` on REST calls and as `metadata.sessionId` on the WebSocket.
	Id openapi_types.UUID `json:"id"`

	// LastMessageAt When the newest message was stored, RFC 3339. Absent until the session has a message.
	LastMessageAt *time.Time `json:"lastMessageAt,omitempty"`

	// MessageCount Number of messages stored in the session's root conversation.
	MessageCount int64 `json:"messageCount"`

	// Model The `connection/model` reference the session uses by default, set when the session was created.
	Model string `json:"model"`

	// UpdatedAt When the session record last changed, RFC 3339. `GET /sessions` orders by it.
	UpdatedAt time.Time `json:"updatedAt"`

	// Workspace The canonical absolute path of the session's workspace directory.
	Workspace string `json:"workspace"`
}

Session A durable session: one conversation in one workspace directory, with its counters and the agent space its tools run in. Returned by `GET /session`, `GET /sessions`, and the open operations. Optional fields are absent, not null, when they do not apply.

type SessionAgentSpaceDecision added in v0.19.0

type SessionAgentSpaceDecision struct {
	// DecidedAt When the change was recorded, RFC 3339.
	DecidedAt time.Time `json:"decidedAt"`

	// FromAgentSpace The agent space the session ran in before this decision. Absent when the session had no recorded agent space.
	FromAgentSpace *string `json:"fromAgentSpace,omitempty"`

	// Id The decision ID.
	Id openapi_types.UUID `json:"id"`

	// Reason The reason the caller gave.
	Reason string `json:"reason"`

	// SessionId The session that moved.
	SessionId openapi_types.UUID `json:"sessionId"`

	// ToAgentSpace The agent space the session moved to.
	ToAgentSpace string `json:"toAgentSpace"`
}

SessionAgentSpaceDecision One recorded agent space change of one session, made by `POST /session/reconfigure`.

type SessionAgentSpaceDecisionPage added in v0.19.0

type SessionAgentSpaceDecisionPage struct {
	// HasMore True when more decisions follow this page.
	HasMore bool `json:"hasMore"`

	// Items The decisions on this page, newest first.
	Items []SessionAgentSpaceDecision `json:"items"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Offset The number of decisions skipped before this page.
	Offset int32 `json:"offset"`
}

SessionAgentSpaceDecisionPage One page of `GET /session/agent-space-decisions`, newest first.

type SessionIDRequired

type SessionIDRequired = openapi_types.UUID

SessionIDRequired defines model for SessionIDRequired.

type SessionNotice added in v0.4.0

type SessionNotice struct {
	// CreatedAt When the notice was stored, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// Data Structured payload for programmatic consumers. Absent when the notice has none.
	Data *map[string]interface{} `json:"data,omitempty"`

	// Delivery The delivery the producer requested. A handler's own `delivery` can override it.
	//
	// - `queue`: delivered at the next turn or tool boundary.
	// - `wake`: may start a turn on an idle session when a handler for the type exists; otherwise queued.
	Delivery SessionNoticeDelivery `json:"delivery"`

	// Id The notice ID.
	Id openapi_types.UUID `json:"id"`

	// Source Who reported it: `api` for `POST /session/notices`, or a Peen producer such as `tools.job`, `agent.launchAgent`, or `session.turn`.
	Source string `json:"source"`

	// Summary The one line describing what happened.
	Summary string `json:"summary"`

	// Type The notice type, a dotted lowercase name such as `job.exited` or `ci.build.failed`.
	Type string `json:"type"`
}

SessionNotice One stored notice: a report waiting for, or already delivered to, a session's model. Returned by `GET /session/notices`, `POST /session/notices`, and as the `data` of a `notice.created` feed frame.

type SessionNoticeDelivery added in v0.4.0

type SessionNoticeDelivery string

SessionNoticeDelivery The delivery the producer requested. A handler's own `delivery` can override it.

- `queue`: delivered at the next turn or tool boundary. - `wake`: may start a turn on an idle session when a handler for the type exists; otherwise queued.

const (
	SessionNoticeDeliveryQueue SessionNoticeDelivery = "queue"
	SessionNoticeDeliveryWake  SessionNoticeDelivery = "wake"
)

Defines values for SessionNoticeDelivery.

func (SessionNoticeDelivery) Valid added in v0.4.0

func (e SessionNoticeDelivery) Valid() bool

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

type SessionNoticePage added in v0.4.0

type SessionNoticePage struct {
	// HasMore True when more notices follow this page.
	HasMore bool `json:"hasMore"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Notices The notices on this page, oldest first.
	Notices []SessionNotice `json:"notices"`

	// Offset The number of notices skipped before this page.
	Offset int32 `json:"offset"`
}

SessionNoticePage One page of `GET /session/notices`, oldest first.

type SessionNoticeRequest added in v0.4.0

type SessionNoticeRequest struct {
	// Data Structured payload for programmatic consumers. Its JSON encoding must not exceed `PEEN_MAX_EVENT_DATA_BYTES` (default 65536 bytes). An empty object is stored as no data.
	Data *map[string]interface{} `json:"data,omitempty"`

	// Delivery When the model sees the notice. A handler's own `delivery` overrides this value.
	//
	// - `queue` (the default): waits for the next turn or tool boundary.
	// - `wake`: also starts a turn when the session is idle and a handler for this type exists at `.agents/events/<type>.md`. A wake that cannot start (a turn is running, or the hourly wake limit is reached) leaves the notice queued.
	Delivery *SessionNoticeRequestDelivery `json:"delivery,omitempty"`

	// Summary The one line describing what happened. Must not be empty or longer than `PEEN_MAX_EVENT_SUMMARY_BYTES` (default 4096 bytes).
	Summary string `json:"summary"`

	// Type Dotted lowercase type: one to eight segments separated by `.`, each a lowercase letter followed by lowercase letters or digits, at most 128 characters in total, such as `ci.build.failed`. The `job.`, `agent.`, and `turn.` prefixes are reserved for Peen's own producers and are rejected here.
	Type string `json:"type"`
}

SessionNoticeRequest The body of `POST /session/notices`.

type SessionNoticeRequestDelivery added in v0.4.0

type SessionNoticeRequestDelivery string

SessionNoticeRequestDelivery When the model sees the notice. A handler's own `delivery` overrides this value.

- `queue` (the default): waits for the next turn or tool boundary. - `wake`: also starts a turn when the session is idle and a handler for this type exists at `.agents/events/<type>.md`. A wake that cannot start (a turn is running, or the hourly wake limit is reached) leaves the notice queued.

const (
	SessionNoticeRequestDeliveryQueue SessionNoticeRequestDelivery = "queue"
	SessionNoticeRequestDeliveryWake  SessionNoticeRequestDelivery = "wake"
)

Defines values for SessionNoticeRequestDelivery.

func (SessionNoticeRequestDelivery) Valid added in v0.4.0

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

type SessionPage added in v0.8.0

type SessionPage struct {
	// HasMore True when more sessions follow this page.
	HasMore bool `json:"hasMore"`

	// Items The sessions on this page, newest updated first.
	Items []Session `json:"items"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Offset The number of sessions skipped before this page.
	Offset int32 `json:"offset"`
}

SessionPage One page of `GET /sessions`, newest updated first.

type SignalSessionJobJSONRequestBody

type SignalSessionJobJSONRequestBody = JobSignalRequest

SignalSessionJobJSONRequestBody defines body for SignalSessionJob for application/json ContentType.

type SignalSessionJobParams

type SignalSessionJobParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

SignalSessionJobParams defines parameters for SignalSessionJob.

type SignalSessionJobResponse

type SignalSessionJobResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *JobSignalResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers202 the parsed response headers for an HTTP 202 response
	Headers202 *SignalSessionJobResponse202Headers
}

func ParseSignalSessionJobResponse

func ParseSignalSessionJobResponse(rsp *http.Response) (*SignalSessionJobResponse, error)

ParseSignalSessionJobResponse parses an HTTP response from a SignalSessionJobWithResponse call

func (SignalSessionJobResponse) ContentType

func (r SignalSessionJobResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SignalSessionJobResponse) GetBody

func (r SignalSessionJobResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SignalSessionJobResponse) GetJSON202

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (SignalSessionJobResponse) GetJSON400

func (r SignalSessionJobResponse) GetJSON400() *ErrorBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (SignalSessionJobResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (SignalSessionJobResponse) GetJSON404

func (r SignalSessionJobResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (SignalSessionJobResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (SignalSessionJobResponse) GetJSON500

func (r SignalSessionJobResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (SignalSessionJobResponse) Status

func (r SignalSessionJobResponse) Status() string

Status returns HTTPResponse.Status

func (SignalSessionJobResponse) StatusCode

func (r SignalSessionJobResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SignalSessionJobResponse202Headers

type SignalSessionJobResponse202Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

SignalSessionJobResponse202Headers the declared response headers of an HTTP 202 response for SignalSessionJob

type TranscriptEvent added in v0.4.0

type TranscriptEvent struct {
	// CreatedAt When the event was stored, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// Id The event ID.
	Id openapi_types.UUID `json:"id"`

	// Payload The event payload, the same `data` the live frame carried.
	Payload map[string]interface{} `json:"payload"`

	// RequestId The request ID of the turn that produced the event.
	RequestId openapi_types.UUID `json:"requestId"`

	// Sequence Position among the session's protocol events, consecutive across turns and starting at 1. It is not the feed sequence.
	Sequence int64 `json:"sequence"`

	// SessionId The session the event belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// TurnId The turn that produced the event.
	TurnId openapi_types.UUID `json:"turnId"`

	// Type The protocol event type, such as `tool.use`. The WebSocket protocol event types table lists every value.
	Type string `json:"type"`

	// WorkerGenerationId The worker generation that produced the event, as listed by `GET /session/workers`. Absent for events recorded before a worker started.
	WorkerGenerationId *string `json:"workerGenerationId,omitempty"`
}

TranscriptEvent One protocol event Peen stored while it ran a session's turn, as `GET /session/events` returns it. Optional fields are absent, not null, when they do not apply.

type TranscriptEventPage added in v0.4.0

type TranscriptEventPage struct {
	// Events The events on this page, in the requested order.
	Events []TranscriptEvent `json:"events"`

	// HasMore True when more events follow this page.
	HasMore bool `json:"hasMore"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Offset The number of events skipped before this page.
	Offset int32 `json:"offset"`
}

TranscriptEventPage One page of `GET /session/events`.

type Turn added in v0.4.0

type Turn struct {
	// CancelRequested True when a Stop was requested for this turn.
	CancelRequested bool `json:"cancelRequested"`

	// CompletedAt When the turn ended, as an RFC 3339 timestamp. Absent while it runs.
	CompletedAt *time.Time `json:"completedAt,omitempty"`

	// ContextSnapshotHash The hash of the context snapshot the turn ran with. Read it from `GET /session/context-snapshots/{contextHash}`. Absent until the turn ends.
	ContextSnapshotHash *string `json:"contextSnapshotHash,omitempty"`

	// FailureClassification Why the turn did not complete: `agentRun` for a failed or interrupted turn, `cancelled` for a Stop, or `timeout` for a turn that passed its deadline. Empty for a running or completed turn.
	FailureClassification string `json:"failureClassification"`

	// Id The turn's ID. Jobs, model runs and events of this turn carry it as `turnId`.
	Id openapi_types.UUID `json:"id"`

	// Output The JSON value validated against the turn's `outputSchema`. Absent when the turn did not ask for structured output or no attempt passed validation.
	Output interface{} `json:"output,omitempty"`

	// OutputError Why every structured output attempt failed. Absent unless the turn asked for structured output and none passed.
	OutputError *string `json:"outputError,omitempty"`

	// PromptSnapshotHash The hash of the system prompt the turn ran with. Read it from `GET /session/prompt-snapshots/{promptHash}`. Absent until the turn ends.
	PromptSnapshotHash *string `json:"promptSnapshotHash,omitempty"`

	// RequestId The request ID of the message that started the turn. Every live frame of the turn carries it.
	RequestId openapi_types.UUID `json:"requestId"`

	// SessionId The session the turn belongs to.
	SessionId openapi_types.UUID `json:"sessionId"`

	// StartedAt When the turn started, as an RFC 3339 timestamp.
	StartedAt time.Time `json:"startedAt"`

	// State The turn's lifecycle state.
	//
	// - `running`: the turn has not ended.
	// - `completed`: the turn finished normally.
	// - `failed`: the turn ended with an error.
	// - `cancelled`: a Stop request or the turn's deadline ended the turn.
	// - `interrupted`: the turn did not reach an end, for example because Peen or its worker stopped while it ran.
	State TurnState `json:"state"`

	// Workspace The workspace directory the turn ran in.
	Workspace string `json:"workspace"`
}

Turn One run of the agent for a session, from the message that started it until it ends. It appears in `TurnPage`.

type TurnPage added in v0.4.0

type TurnPage struct {
	// HasMore `true` when at least one more turn exists after this page. Request the next page with `offset` increased by `limit`.
	HasMore bool `json:"hasMore"`

	// Limit The page size the server used.
	Limit int32 `json:"limit"`

	// Offset The number of turns skipped before this page.
	Offset int32 `json:"offset"`

	// Turns The turns on this page, ordered by `startedAt` descending.
	Turns []Turn `json:"turns"`
}

TurnPage One page of a session's turns, newest first, returned by `GET /session/turns`.

type TurnState added in v0.4.0

type TurnState string

TurnState The turn's lifecycle state.

- `running`: the turn has not ended. - `completed`: the turn finished normally. - `failed`: the turn ended with an error. - `cancelled`: a Stop request or the turn's deadline ended the turn. - `interrupted`: the turn did not reach an end, for example because Peen or its worker stopped while it ran.

const (
	TurnStateCancelled   TurnState = "cancelled"
	TurnStateCompleted   TurnState = "completed"
	TurnStateFailed      TurnState = "failed"
	TurnStateInterrupted TurnState = "interrupted"
	TurnStateRunning     TurnState = "running"
)

Defines values for TurnState.

func (TurnState) Valid added in v0.4.0

func (e TurnState) Valid() bool

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

type WorkerGeneration added in v0.8.0

type WorkerGeneration struct {
	// AgentSpace The agent space the generation started in, `control` or `docker:<profile>`.
	AgentSpace string `json:"agentSpace"`

	// AgentSpaceRevision The agent space's `revision` when the generation started, so the record says which profile definition ran.
	AgentSpaceRevision int64 `json:"agentSpaceRevision"`

	// ContainerId The Docker container ID. Set only for a Docker generation once its container exists.
	ContainerId *string `json:"containerId,omitempty"`

	// CreatedAt When the generation was recorded, RFC 3339.
	CreatedAt time.Time `json:"createdAt"`

	// EndedAt When the generation reached `stopped` or `failed`, RFC 3339. Absent until then.
	EndedAt *time.Time `json:"endedAt,omitempty"`

	// FailureDetail Why the generation failed. Set only on a `failed` generation. Never carries credentials.
	FailureDetail *string `json:"failureDetail,omitempty"`

	// Id The generation ID. Protocol events carry it as `workerGenerationId`.
	Id openapi_types.UUID `json:"id"`

	// ImageDigest The repository digest of the worker image, such as `example/image@sha256:...`, never a moving tag. Set only for a Docker generation, and only when the daemon reported a repository digest for the image; a locally built image has none.
	ImageDigest *string `json:"imageDigest,omitempty"`

	// Kind Where the worker ran.
	//
	// - `control`: a worker process where the controller runs.
	// - `docker`: a worker container.
	Kind WorkerGenerationKind `json:"kind"`

	// SessionId The session the worker served.
	SessionId openapi_types.UUID `json:"sessionId"`

	// StartedAt When the worker became `ready`, RFC 3339. Absent until then.
	StartedAt *time.Time `json:"startedAt,omitempty"`

	// State The generation's lifecycle state.
	//
	// - `requested`: recorded, nothing launched yet.
	// - `starting`: the process or container is coming up.
	// - `ready`: the worker registered and may run turns.
	// - `stopping`: the worker was asked to finish and exit.
	// - `stopped`: it ended as asked.
	// - `failed`: it ended without being asked to, or never became ready.
	State WorkerGenerationState `json:"state"`

	// Workspace The workspace directory the worker was started for.
	Workspace string `json:"workspace"`
}

WorkerGeneration One worker process or container that ran a session's turns, as `GET /session/workers` lists it. Optional fields are absent, not null, when they do not apply.

type WorkerGenerationKind added in v0.8.0

type WorkerGenerationKind string

WorkerGenerationKind Where the worker ran.

- `control`: a worker process where the controller runs. - `docker`: a worker container.

const (
	WorkerGenerationKindControl WorkerGenerationKind = "control"
	WorkerGenerationKindDocker  WorkerGenerationKind = "docker"
)

Defines values for WorkerGenerationKind.

func (WorkerGenerationKind) Valid added in v0.8.0

func (e WorkerGenerationKind) Valid() bool

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

type WorkerGenerationPage added in v0.8.0

type WorkerGenerationPage struct {
	// HasMore True when more generations follow this page.
	HasMore bool `json:"hasMore"`

	// Items The generations on this page, newest first.
	Items []WorkerGeneration `json:"items"`

	// Limit The page size this response used.
	Limit int32 `json:"limit"`

	// Offset The number of generations skipped before this page.
	Offset int32 `json:"offset"`
}

WorkerGenerationPage One page of `GET /session/workers`, newest first.

type WorkerGenerationState added in v0.8.0

type WorkerGenerationState string

WorkerGenerationState The generation's lifecycle state.

- `requested`: recorded, nothing launched yet. - `starting`: the process or container is coming up. - `ready`: the worker registered and may run turns. - `stopping`: the worker was asked to finish and exit. - `stopped`: it ended as asked. - `failed`: it ended without being asked to, or never became ready.

const (
	WorkerGenerationStateFailed    WorkerGenerationState = "failed"
	WorkerGenerationStateReady     WorkerGenerationState = "ready"
	WorkerGenerationStateRequested WorkerGenerationState = "requested"
	WorkerGenerationStateStarting  WorkerGenerationState = "starting"
	WorkerGenerationStateStopped   WorkerGenerationState = "stopped"
	WorkerGenerationStateStopping  WorkerGenerationState = "stopping"
)

Defines values for WorkerGenerationState.

func (WorkerGenerationState) Valid added in v0.8.0

func (e WorkerGenerationState) Valid() bool

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

type WorkspaceFileContent added in v0.51.0

type WorkspaceFileContent struct {
	// ContentBase64 The file's bytes in standard base64 with padding. At most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default, after decoding.
	ContentBase64 string `json:"contentBase64"`

	// Path The path as the request gave it.
	Path string `json:"path"`

	// Size The number of bytes in the file, which is the length of `contentBase64` after decoding.
	Size int64 `json:"size"`
}

WorkspaceFileContent The full content of one regular workspace file, base64 encoded. Returned by `GET /session/files/content`.

type WorkspaceFileEntry added in v0.51.0

type WorkspaceFileEntry struct {
	// ModifiedAt The entry's last modification time, as an RFC 3339 UTC time.
	ModifiedAt time.Time `json:"modifiedAt"`

	// Name The entry's base name, without its directory, such as `main.go`.
	Name string `json:"name"`

	// Size The entry's size in bytes as the filesystem reports it. For a link it is the size of the link itself, and for a directory it is the filesystem's directory size, not the size of its contents.
	Size int64 `json:"size"`

	// Type The kind of a workspace path, read without following symbolic links.
	//
	// - `file`: a regular file, or another non-directory entry such as a pipe or socket.
	// - `directory`: a directory.
	// - `symlink`: a symbolic link, reported as the link itself rather than its target.
	Type WorkspaceFileType `json:"type"`
}

WorkspaceFileEntry Metadata for one workspace path, read without following symbolic links. It appears as an item of a directory listing and as the response of `PUT /session/files/content`.

type WorkspaceFileListing added in v0.51.0

type WorkspaceFileListing struct {
	// Entries The directory's direct entries, sorted by name, including hidden ones. Empty when the path is a file or a symbolic link.
	Entries []WorkspaceFileEntry `json:"entries"`

	// ModifiedAt The path's last modification time, as an RFC 3339 UTC time.
	ModifiedAt time.Time `json:"modifiedAt"`

	// Path The path as the request gave it. Empty for the workspace root.
	Path string `json:"path"`

	// Size The path's size in bytes as the filesystem reports it.
	Size int64 `json:"size"`

	// Type The kind of a workspace path, read without following symbolic links.
	//
	// - `file`: a regular file, or another non-directory entry such as a pipe or socket.
	// - `directory`: a directory.
	// - `symlink`: a symbolic link, reported as the link itself rather than its target.
	Type WorkspaceFileType `json:"type"`
}

WorkspaceFileListing Metadata for one workspace path and, when it is a directory, its direct entries. Returned by `GET /session/files`.

type WorkspaceFileType added in v0.51.0

type WorkspaceFileType string

WorkspaceFileType The kind of a workspace path, read without following symbolic links.

- `file`: a regular file, or another non-directory entry such as a pipe or socket. - `directory`: a directory. - `symlink`: a symbolic link, reported as the link itself rather than its target.

const (
	WorkspaceFileTypeDirectory WorkspaceFileType = "directory"
	WorkspaceFileTypeFile      WorkspaceFileType = "file"
	WorkspaceFileTypeSymlink   WorkspaceFileType = "symlink"
)

Defines values for WorkspaceFileType.

func (WorkspaceFileType) Valid added in v0.51.0

func (e WorkspaceFileType) Valid() bool

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

type WorkspaceFileWrite added in v0.51.0

type WorkspaceFileWrite struct {
	// ContentBase64 The new content in standard base64 with padding. URL-safe or unpadded base64 is refused. At most `PEEN_MAX_FILE_API_BYTES` bytes, 16 MiB by default, after decoding. An empty string writes an empty file.
	ContentBase64 string `json:"contentBase64"`

	// CreateDirectories When `true`, missing parent directories are created with mode `0750`. When `false`, the default, a missing parent answers `404`.
	CreateDirectories *bool `json:"createDirectories,omitempty"`

	// Path The file's path relative to the workspace, following the rules of `GET /session/files`, such as `notes/todo.md`.
	Path string `json:"path"`
}

WorkspaceFileWrite The body of `PUT /session/files/content`: the file to create or replace, and its content.

type WorkspaceRootList added in v0.13.0

type WorkspaceRootList struct {
	// Roots Absolute directories, resolved through symbolic links, under which `POST /sessions/open` accepts a workspace. Peen currently supports one root, so the list holds exactly one entry.
	Roots []string `json:"roots"`
}

WorkspaceRootList The response of `GET /workspace-roots`.

type WriteWorkspaceFileJSONRequestBody added in v0.51.0

type WriteWorkspaceFileJSONRequestBody = WorkspaceFileWrite

WriteWorkspaceFileJSONRequestBody defines body for WriteWorkspaceFile for application/json ContentType.

type WriteWorkspaceFileParams added in v0.51.0

type WriteWorkspaceFileParams struct {
	// XSessionID The session to act on, as a UUID from `POST /sessions/open`, `GET /sessions` or `POST /sessions/system`. A missing header answers `400 VALIDATION_FAILED`, a malformed value `400 INVALID_SESSION_ID`, and an unknown session `404`.
	XSessionID SessionIDRequired `json:"X-Session-ID"`
}

WriteWorkspaceFileParams defines parameters for WriteWorkspaceFile.

type WriteWorkspaceFileResponse added in v0.51.0

type WriteWorkspaceFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkspaceFileEntry
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ErrorBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *ErrorUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ErrorForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ErrorNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *ErrorNotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ErrorInternal
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *WriteWorkspaceFileResponse200Headers
}

func ParseWriteWorkspaceFileResponse added in v0.51.0

func ParseWriteWorkspaceFileResponse(rsp *http.Response) (*WriteWorkspaceFileResponse, error)

ParseWriteWorkspaceFileResponse parses an HTTP response from a WriteWorkspaceFileWithResponse call

func (WriteWorkspaceFileResponse) ContentType added in v0.51.0

func (r WriteWorkspaceFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (WriteWorkspaceFileResponse) GetBody added in v0.51.0

func (r WriteWorkspaceFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (WriteWorkspaceFileResponse) GetJSON200 added in v0.51.0

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON400 added in v0.51.0

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON401 added in v0.51.0

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON403 added in v0.51.0

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON404 added in v0.51.0

func (r WriteWorkspaceFileResponse) GetJSON404() *ErrorNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON406 added in v0.52.0

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (WriteWorkspaceFileResponse) GetJSON500 added in v0.51.0

func (r WriteWorkspaceFileResponse) GetJSON500() *ErrorInternal

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (WriteWorkspaceFileResponse) Status added in v0.51.0

Status returns HTTPResponse.Status

func (WriteWorkspaceFileResponse) StatusCode added in v0.51.0

func (r WriteWorkspaceFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type WriteWorkspaceFileResponse200Headers added in v0.51.0

type WriteWorkspaceFileResponse200Headers struct {
	XRequestID openapi_types.UUID
	XSessionID openapi_types.UUID
}

WriteWorkspaceFileResponse200Headers the declared response headers of an HTTP 200 response for WriteWorkspaceFile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL