{"modulePath":"github.com/coder/agentapi-sdk-go","version":"v0.0.0-20260319135114-c8da0d626720","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package agentapisdk\n\n## Types\n\n```go\ntype AgentStatus = gen.AgentStatus\n```\nAgentStatus represents the current state of the agent\n\n```go\nconst (\n\t// StatusRunning indicates the agent is actively processing\n\tStatusRunning AgentStatus = gen.Running\n\t// StatusStable indicates the agent is idle\n\tStatusStable AgentStatus = gen.Stable\n)\n```\nConstants for agent status\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient(server string, opts ...ClientOption) (*Client, error)\n```\n\n```go\nfunc (c *Client) GetMessages(ctx context.Context) (*GetMessagesResponse, error)\n```\n\n```go\nfunc (c *Client) GetStatus(ctx context.Context) (*GetStatusResponse, error)\n```\n\n```go\nfunc (c *Client) PostMessage(ctx context.Context, body PostMessageParams) (*PostMessageResponse, error)\n```\n\n```go\nfunc (c *Client) SubscribeEvents(ctx context.Context) (chan Event, chan error, error)\n```\n\n```go\ntype ClientOption = gen.ClientOption\n```\n\n```go\nfunc WithBaseURL(baseURL string) ClientOption\n```\nWithBaseURL overrides the base URL for the client. This is useful when you want to use a different server than the one provided to NewClient.\n\n```go\nfunc WithHTTPClient(client HTTPDoer) ClientOption\n```\nWithHTTPClient allows overriding the default HTTP client. This is useful for testing with mock clients.\n\n```go\nfunc WithRequestEditorFn(fn RequestEditorFn) ClientOption\n```\nWithRequestEditorFn adds a function that will be called to modify each request before sending. This can be used to add headers, modify query parameters, etc.\n\n```go\ntype ConversationRole = gen.ConversationRole\n```\nConversationRole defines the sender of a message (agent or user)\n\n```go\nconst (\n\t// RoleAgent is the role assigned to agent messages\n\tRoleAgent ConversationRole = gen.ConversationRoleAgent\n\t// RoleUser is the role assigned to user messages\n\tRoleUser ConversationRole = gen.ConversationRoleUser\n)\n```\nConstants for conversation roles\n\n```go\ntype ErrorDetail = gen.ErrorDetail\n```\nErrorDetail provides additional information about an error\n\n```go\ntype ErrorModel = gen.ErrorModel\n```\nErrorModel represents an error returned by the API\n\n```go\ntype Event = any\n```\nEvent represents a server-sent event from the Agent API\n\n```go\ntype EventMessageUpdate = gen.MessageUpdateBody\n```\nEventMessageUpdate represents a message update event\n\n```go\ntype EventStatusChange = gen.StatusChangeBody\n```\nEventStatusChange represents a status change event\n\n```go\ntype EventType = string\n```\n\n```go\nconst (\n\tEventTypeMessageUpdate EventType = \"message_update\"\n\tEventTypeStatusChange  EventType = \"status_change\"\n)\n```\n\n```go\ntype GetMessagesResponse = gen.MessagesResponseBody\n```\n\n```go\ntype GetStatusResponse = gen.StatusResponseBody\n```\n\n```go\ntype HTTPDoer interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n```\nHTTPDoer is an interface for performing HTTP requests. The standard http.Client implements this interface.\n\n```go\ntype Message = gen.Message\n```\nMessage represents a single message in the conversation\n\n```go\ntype MessageType = gen.MessageType\n```\nMessageType defines the type of message being sent\n\n```go\nconst (\n\t// MessageTypeRaw represents raw keystrokes sent to the agent\n\tMessageTypeRaw MessageType = gen.MessageTypeRaw\n\t// MessageTypeUser represents a user message\n\tMessageTypeUser MessageType = gen.MessageTypeUser\n)\n```\nConstants for message types\n\n```go\ntype PostMessageParams = gen.PostMessageJSONRequestBody\n```\n\n```go\ntype PostMessageResponse = gen.MessageResponseBody\n```\n\n```go\ntype RequestEditorFn = gen.RequestEditorFn\n```\nRequestEditorFn is a function that modifies HTTP requests before they are sent.\n\n```go\ntype SubscribeEventsResponse = gen.SubscribeEventsResponse\n```\n\n","path":"github.com/coder/agentapi-sdk-go","name":"agentapisdk","synopsis":"","isRedistributable":true}
