Documentation
¶
Overview ¶
Package sinatra is the official Go client for sinatra.dev, the AI coding agent that turns Linear and GitHub issues into pull requests: start, follow and stop Sinatra tasks, and delegate Linear and GitHub issues.
The types (Task, Message, Me, ...) are generated from the API's OpenAPI spec into api.gen.go. The client in this file adds authentication, retries, idempotency keys, timeouts and pagination on top.
client, err := sinatra.NewClient() // reads SINATRA_TOKEN me, err := client.Me.Get(ctx)
Fields such as Task.Status, Task.Source, Message.Role, Message.Kind and Error.Code are plain strings, and the API adds values over time: handle values you don't recognise.
Reference: https://docs.sinatra.dev/docs/api-reference
Index ¶
- Constants
- func Ptr[T any](v T) *T
- type Account
- type CallOption
- type Client
- type CreateMessageRequest
- type CreateMessageResponse
- type CreateTaskRequest
- type CreateTaskResponse
- type DelegateGithubTicket
- type DelegateGithubTicketSource
- type DelegateLinearTicket
- type DelegateLinearTicketSource
- type DelegateTarget
- type DelegateTicketRequest
- func (t DelegateTicketRequest) AsDelegateGithubTicket() (DelegateGithubTicket, error)
- func (t DelegateTicketRequest) AsDelegateLinearTicket() (DelegateLinearTicket, error)
- func (t DelegateTicketRequest) Discriminator() (string, error)
- func (t *DelegateTicketRequest) FromDelegateGithubTicket(v DelegateGithubTicket) error
- func (t *DelegateTicketRequest) FromDelegateLinearTicket(v DelegateLinearTicket) error
- func (t DelegateTicketRequest) MarshalJSON() ([]byte, error)
- func (t *DelegateTicketRequest) MergeDelegateGithubTicket(v DelegateGithubTicket) error
- func (t *DelegateTicketRequest) MergeDelegateLinearTicket(v DelegateLinearTicket) error
- func (t *DelegateTicketRequest) UnmarshalJSON(b []byte) error
- func (t DelegateTicketRequest) ValueByDiscriminator() (interface{}, error)
- type DelegateTicketResponse
- type DelegateTicketResponseOk
- type EmailPreferences
- type Error
- type ErrorBody
- type IdempotencyKey
- type Me
- type MeService
- type MeUpdateEmailPreferencesJSONRequestBody
- type Message
- type MessageList
- type MessagesCreateJSONRequestBody
- type MessagesCreateParams
- type MessagesListParams
- type MessagesService
- func (s *MessagesService) Create(ctx context.Context, workspaceID, taskID string, body CreateMessageRequest, ...) (*CreateMessageResponse, error)
- func (s *MessagesService) List(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) (*MessageList, error)
- func (s *MessagesService) ListAll(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) iter.Seq2[Message, error]
- type Option
- type PullRequest
- type StopTaskResponse
- type StopTaskResponseAccepted
- type Task
- type TaskList
- type TasksCreateJSONRequestBody
- type TasksCreateParams
- type TasksListParams
- type TasksService
- func (s *TasksService) Create(ctx context.Context, workspaceID string, body CreateTaskRequest, ...) (*CreateTaskResponse, error)
- func (s *TasksService) Get(ctx context.Context, workspaceID, taskID string) (*Task, error)
- func (s *TasksService) List(ctx context.Context, workspaceID string, params *TasksListParams) (*TaskList, error)
- func (s *TasksService) ListAll(ctx context.Context, workspaceID string, params *TasksListParams) iter.Seq2[Task, error]
- func (s *TasksService) Stop(ctx context.Context, workspaceID, taskID string) (*StopTaskResponse, error)
- type Ticket
- type TicketSearchResult
- type TicketsDelegateJSONRequestBody
- type TicketsSearchParams
- type TicketsService
- type UpdateEmailPreferencesRequest
- func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0() (UpdateEmailPreferencesRequest0, error)
- func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1() (UpdateEmailPreferencesRequest1, error)
- func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
- func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
- func (t UpdateEmailPreferencesRequest) MarshalJSON() ([]byte, error)
- func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
- func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
- func (t *UpdateEmailPreferencesRequest) UnmarshalJSON(b []byte) error
- type UpdateEmailPreferencesRequest0
- type UpdateEmailPreferencesRequest1
- type Workspace
- type WorkspaceAccess
- type WorkspaceAccessApproveRequestJSONRequestBody
- type WorkspaceAccessApproved
- type WorkspaceAccessCreateInviteJSONRequestBody
- type WorkspaceAccessDenied
- type WorkspaceAccessOk
- type WorkspaceAccessOkOk
- type WorkspaceAccessSetRoleJSONRequestBody
- type WorkspaceGrantRoleRequest
- type WorkspaceGrantRoleRequestRole
- type WorkspaceInvite
- type WorkspaceInviteCreateRequest
- type WorkspaceInviteCreateRequestRole
- type WorkspaceInviteResponse
- type WorkspaceMembershipResponse
- type WorkspaceOverview
- type WorkspaceOverviewPlanStatus0
- type WorkspaceOverviewPlanStatus0Plan
- type WorkspaceOverviewPlanStatus1
- type WorkspaceOverviewPlanStatus1Plan
- type WorkspaceOverview_PlanStatus
- func (t WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus0() (WorkspaceOverviewPlanStatus0, error)
- func (t WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus1() (WorkspaceOverviewPlanStatus1, error)
- func (t *WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus0(v WorkspaceOverviewPlanStatus0) error
- func (t *WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus1(v WorkspaceOverviewPlanStatus1) error
- func (t WorkspaceOverview_PlanStatus) MarshalJSON() ([]byte, error)
- func (t *WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus0(v WorkspaceOverviewPlanStatus0) error
- func (t *WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus1(v WorkspaceOverviewPlanStatus1) error
- func (t *WorkspaceOverview_PlanStatus) UnmarshalJSON(b []byte) error
- type WorkspaceOwnershipTransferred
Constants ¶
const ( // DefaultBaseURL is the API the client talks to unless WithBaseURL says otherwise. DefaultBaseURL = "https://api.sinatra.dev" // DefaultTimeout is how long each attempt of a request may take, unless // WithTimeout says otherwise. DefaultTimeout = 60 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶ added in v0.1.8
type Account struct {
LinkedAccounts struct {
// Telegram Telegram's dashboard-visible account state. Identity, routing and bot are null when unavailable.
Telegram struct {
Available bool `json:"available"`
Bot *struct {
Url string `json:"url"`
Username string `json:"username"`
} `json:"bot"`
Identity *struct {
DisplayName *string `json:"displayName"`
LinkedAt time.Time `json:"linkedAt"`
TelegramUserId string `json:"telegramUserId"`
} `json:"identity"`
RequestWorkspaces *struct {
Current *struct {
Id string `json:"id"`
Name *string `json:"name"`
Usable bool `json:"usable"`
} `json:"current"`
Options []struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"options"`
RoutesTo *struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"routesTo"`
} `json:"requestWorkspaces"`
} `json:"telegram"`
} `json:"linkedAccounts"`
// Memberships Your memberships and dashboard workspace summaries, ordered by workspace name.
Memberships []struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
WorkspaceId string `json:"workspaceId"`
} `json:"membership"`
Workspace struct {
CreatedAt time.Time `json:"createdAt"`
GithubAccountLogin *string `json:"githubAccountLogin"`
GithubAccountType *string `json:"githubAccountType"`
Id string `json:"id"`
LinearOrganizationName *string `json:"linearOrganizationName"`
Name string `json:"name"`
} `json:"workspace"`
} `json:"memberships"`
// User Your dashboard-visible account identity. Credentials and session metadata are never returned.
User struct {
AvatarUrl *string `json:"avatarUrl"`
Email string `json:"email"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
LinearUserId *string `json:"linearUserId"`
Name *string `json:"name"`
} `json:"user"`
}
Account Your own account, combining the dashboard's profile and linked accounts. The workspace path checks membership; the account belongs to the token's user, not the workspace owner.
type CallOption ¶
type CallOption func(*callOptions)
CallOption configures one call of Tasks.Create or Messages.Create.
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) CallOption
WithIdempotencyKey sets the call's Idempotency-Key: 1 to 128 printable ASCII characters, with no spaces. Without it, the client makes a random UUID. Either way, every retry of the call sends the same key, so a retried start never starts a second task. Pass your own key to make a retry safe across process restarts too.
type Client ¶
type Client struct {
Me *MeService
Tasks *TasksService
Messages *MessagesService
Tickets *TicketsService
// contains filtered or unexported fields
}
Client is a Sinatra API client. Its services mirror the API's operations: Me.Get is GET /v1/me, Tasks.Create is POST /v1/workspaces/{workspaceId}/tasks. A Client is safe for concurrent use.
Requests that are safe to repeat (GETs, the token DELETE, and starts and messages, which always carry an Idempotency-Key) are retried up to 3 times on 429 and 503. Tasks.Stop is retried on 503 only, Tickets.Delegate never. Error responses are returned as *Error.
type CreateMessageRequest ¶
type CreateMessageRequest struct {
// Text The message, up to 100,000 characters after trimming.
Text string `json:"text"`
}
CreateMessageRequest A message to send on a task.
type CreateMessageResponse ¶
type CreateMessageResponse struct {
// MessageId The message's id: the `Idempotency-Key` you sent, or a generated id.
MessageId string `json:"messageId"`
}
CreateMessageResponse The message that was sent.
type CreateTaskRequest ¶
type CreateTaskRequest struct {
// Model A model from Sinatra's catalog, such as `anthropic/claude-opus-5-5` or `openai-codex/gpt-6.1-sol`, that every agent on the task runs on. The model picks its engine. Omit it to use the repository's or workspace's model.
Model *string `json:"model,omitempty"`
// Prompt What to do, as you'd ask a teammate. Up to 100,000 characters, after trimming.
Prompt string `json:"prompt"`
// Repo `owner/name` of a repository connected to the workspace. Omit it to let the agent choose.
Repo *string `json:"repo,omitempty"`
// Title The task's title, up to 200 characters. Defaults to the prompt's first line, cut to 80 characters.
Title *string `json:"title,omitempty"`
}
CreateTaskRequest A task to start.
type CreateTaskResponse ¶
type CreateTaskResponse struct {
// MessageId The id of your first message: the `Idempotency-Key` you sent, or a generated id.
MessageId string `json:"messageId"`
// Task A task: one piece of work Sinatra does, from any source.
Task Task `json:"task"`
}
CreateTaskResponse The task that started, and the id of your first message.
type DelegateGithubTicket ¶
type DelegateGithubTicket struct {
// Number The issue's number in that repository.
Number int `json:"number"`
// Repo `owner/name` of a repository enabled in the workspace.
Repo string `json:"repo"`
// Source `github` to delegate a GitHub issue.
Source DelegateGithubTicketSource `json:"source"`
}
DelegateGithubTicket A GitHub issue to delegate, by its repository and number.
type DelegateGithubTicketSource ¶
type DelegateGithubTicketSource string
DelegateGithubTicketSource `github` to delegate a GitHub issue.
const (
DelegateGithubTicketSourceGithub DelegateGithubTicketSource = "github"
)
Defines values for DelegateGithubTicketSource.
func (DelegateGithubTicketSource) Valid ¶
func (e DelegateGithubTicketSource) Valid() bool
Valid indicates whether the value is a known member of the DelegateGithubTicketSource enum.
type DelegateLinearTicket ¶
type DelegateLinearTicket struct {
// Id The issue's identifier, such as `ENG-123`, or its id.
Id string `json:"id"`
// Source `linear` to delegate a Linear issue.
Source DelegateLinearTicketSource `json:"source"`
}
DelegateLinearTicket A Linear issue to delegate, by its identifier or id.
type DelegateLinearTicketSource ¶
type DelegateLinearTicketSource string
DelegateLinearTicketSource `linear` to delegate a Linear issue.
const (
DelegateLinearTicketSourceLinear DelegateLinearTicketSource = "linear"
)
Defines values for DelegateLinearTicketSource.
func (DelegateLinearTicketSource) Valid ¶
func (e DelegateLinearTicketSource) Valid() bool
Valid indicates whether the value is a known member of the DelegateLinearTicketSource enum.
type DelegateTarget ¶
type DelegateTarget interface {
// contains filtered or unexported methods
}
DelegateTarget is an issue to delegate: a DelegateLinearTicket, a DelegateGithubTicket, or a DelegateTicketRequest. Source is filled in for you.
type DelegateTicketRequest ¶
type DelegateTicketRequest struct {
// contains filtered or unexported fields
}
DelegateTicketRequest An issue to delegate: a Linear issue by `id`, or a GitHub issue by `repo` and `number`.
func (DelegateTicketRequest) AsDelegateGithubTicket ¶
func (t DelegateTicketRequest) AsDelegateGithubTicket() (DelegateGithubTicket, error)
AsDelegateGithubTicket returns the union data inside the DelegateTicketRequest as a DelegateGithubTicket
func (DelegateTicketRequest) AsDelegateLinearTicket ¶
func (t DelegateTicketRequest) AsDelegateLinearTicket() (DelegateLinearTicket, error)
AsDelegateLinearTicket returns the union data inside the DelegateTicketRequest as a DelegateLinearTicket
func (DelegateTicketRequest) Discriminator ¶
func (t DelegateTicketRequest) Discriminator() (string, error)
func (*DelegateTicketRequest) FromDelegateGithubTicket ¶
func (t *DelegateTicketRequest) FromDelegateGithubTicket(v DelegateGithubTicket) error
FromDelegateGithubTicket overwrites any union data inside the DelegateTicketRequest as the provided DelegateGithubTicket
func (*DelegateTicketRequest) FromDelegateLinearTicket ¶
func (t *DelegateTicketRequest) FromDelegateLinearTicket(v DelegateLinearTicket) error
FromDelegateLinearTicket overwrites any union data inside the DelegateTicketRequest as the provided DelegateLinearTicket
func (DelegateTicketRequest) MarshalJSON ¶
func (t DelegateTicketRequest) MarshalJSON() ([]byte, error)
func (*DelegateTicketRequest) MergeDelegateGithubTicket ¶
func (t *DelegateTicketRequest) MergeDelegateGithubTicket(v DelegateGithubTicket) error
MergeDelegateGithubTicket performs a merge with any union data inside the DelegateTicketRequest, using the provided DelegateGithubTicket
func (*DelegateTicketRequest) MergeDelegateLinearTicket ¶
func (t *DelegateTicketRequest) MergeDelegateLinearTicket(v DelegateLinearTicket) error
MergeDelegateLinearTicket performs a merge with any union data inside the DelegateTicketRequest, using the provided DelegateLinearTicket
func (*DelegateTicketRequest) UnmarshalJSON ¶
func (t *DelegateTicketRequest) UnmarshalJSON(b []byte) error
func (DelegateTicketRequest) ValueByDiscriminator ¶
func (t DelegateTicketRequest) ValueByDiscriminator() (interface{}, error)
type DelegateTicketResponse ¶
type DelegateTicketResponse struct {
// Ok Always `true`: the issue was handed to Sinatra.
Ok DelegateTicketResponseOk `json:"ok"`
}
DelegateTicketResponse The issue was delegated.
type DelegateTicketResponseOk ¶
type DelegateTicketResponseOk bool
DelegateTicketResponseOk Always `true`: the issue was handed to Sinatra.
const (
DelegateTicketResponseOkTrue DelegateTicketResponseOk = true
)
Defines values for DelegateTicketResponseOk.
func (DelegateTicketResponseOk) Valid ¶
func (e DelegateTicketResponseOk) Valid() bool
Valid indicates whether the value is a known member of the DelegateTicketResponseOk enum.
type EmailPreferences ¶ added in v0.1.8
type EmailPreferences struct {
// SetupReminders Whether Sinatra may send you setup reminder emails.
SetupReminders bool `json:"setupReminders"`
// TaskAlerts Whether Sinatra may send you task alert emails.
TaskAlerts bool `json:"taskAlerts"`
}
EmailPreferences Your account-wide email preferences, shared with the signed email-preferences page.
type Error ¶
type Error struct {
// Status is the HTTP status, such as 409.
Status int
// Code is the API's machine-readable error code, such as "capacity_full".
// New codes can appear at any time, so treat it as an open string. It is
// "http_error" when the response carried no code, such as an HTML error
// page from a proxy. Branch on Code, not on Reason.
Code string
// Reason is a sentence saying what went wrong, written for a person.
Reason string
// RequestID is the request's id, from the body or the x-request-id
// header. Include it when you contact support.
RequestID string
// Body is the raw response body.
Body []byte
// Header holds the response headers.
Header http.Header
// Details is the decoded body when it was a JSON object, with fields such
// as BillingUrl on some refusals. Nil otherwise.
Details *ErrorBody
}
Error is the error every method returns for an HTTP error response. Get it with errors.As:
var apiErr *sinatra.Error
if errors.As(err, &apiErr) && apiErr.Code == "not_running" { ... }
Network failures, timeouts and cancellations are not an *Error: they are returned as net/http and context report them.
type ErrorBody ¶
type ErrorBody struct {
// BillingUrl The settings section that fixes the refusal: your model credentials or billing, on `payment_required`; billing, when starting a task, on `capacity_full`.
BillingUrl *string `json:"billingUrl,omitempty"`
// Error A machine-readable code, such as `invalid_prompt`. Branch on this, not on `reason`. New codes can appear. Known codes: `actor_not_authorized`, `already_member`, `assigned_to_other`, `bad_request`, `capacity_full`, `consumed`, `declined`, `expired`, `github_identity_required`, `github_not_connected`, `github_rate_limited`, `idempotency_conflict`, `illegal_role`, `internal_error`, `invalid_body`, `invalid_cursor`, `invalid_idempotency_key`, `invalid_limit`, `invalid_model`, `invalid_prompt`, `invalid_repo`, `invalid_status`, `invalid_title`, `invalid_token`, `invite_delivery_failed`, `invite_limit`, `invite_not_found`, `invite_revoked`, `issue_closed`, `issue_not_found`, `linear_app_user_missing`, `linear_identity_conflict`, `linear_identity_unlinked`, `linear_not_connected`, `linear_reconnect_required`, `membership_not_found`, `not_an_api_task`, `not_an_issue`, `not_found`, `not_running`, `payment_required`, `repo_disabled`, `request_not_found`, `request_not_pending`, `revoked`, `unavailable`.
Error string `json:"error"`
// MessageId On `unavailable`: the message that was saved but not sent yet. Retry with it as the `Idempotency-Key`.
MessageId *string `json:"messageId,omitempty"`
// Plan The workspace's plan, on `capacity_full` when starting a task.
Plan *string `json:"plan,omitempty"`
// Queued How many agents the plan lets wait, on `capacity_full` when starting a task.
Queued *int `json:"queued,omitempty"`
// Reason A sentence saying what went wrong and, where it helps, what to do. Written to show to a person.
Reason *string `json:"reason,omitempty"`
// Refusal Why a start was refused, on `payment_required` and `github_not_connected`. For `payment_required`: `own_credentials_required` or `subscription_inactive`. For `github_not_connected`: `missing` or `suspended`.
Refusal *string `json:"refusal,omitempty"`
// RequestId The request's id. Present on some errors, not all; the `x-request-id` response header always carries it. Share it with support.
RequestId *string `json:"requestId,omitempty"`
// Running How many agents the plan runs at a time, on `capacity_full` when starting a task.
Running *int `json:"running,omitempty"`
// SettingsUrl The settings page that fixes the refusal, on `github_not_connected`.
SettingsUrl *string `json:"settingsUrl,omitempty"`
// TaskId On `unavailable` after a start: the task that was made. Retry with the same key, or send a message on it.
TaskId *string `json:"taskId,omitempty"`
}
ErrorBody The body of every error response.
type Me ¶
type Me struct {
// User The user the token acts as.
User struct {
// Email The user's email address: the one they sign in with by email, or their primary GitHub email.
Email string `json:"email"`
// GithubLogin The user's GitHub login. `null` for a user without GitHub.
GithubLogin *string `json:"githubLogin"`
// Id The user's id.
Id string `json:"id"`
// Name The user's name, if they have one.
Name *string `json:"name"`
} `json:"user"`
// Workspaces The workspaces the user belongs to, ordered by name.
Workspaces []Workspace `json:"workspaces"`
}
Me The token's user and workspaces.
type MeService ¶
type MeService struct {
// contains filtered or unexported fields
}
MeService is the token's user: Client.Me.
type MeUpdateEmailPreferencesJSONRequestBody ¶ added in v0.1.8
type MeUpdateEmailPreferencesJSONRequestBody = UpdateEmailPreferencesRequest
MeUpdateEmailPreferencesJSONRequestBody defines body for MeUpdateEmailPreferences for application/json ContentType.
type Message ¶
type Message struct {
// Body The text.
Body string `json:"body"`
// CreatedAt When it was written.
CreatedAt time.Time `json:"createdAt"`
// Id The entry's id. Pass the last one you read as `after` to get only later entries.
Id string `json:"id"`
// Kind What it is: `message` (a person's message), `response` (the agent's answer, or a notice from Sinatra such as a stop or files the agent produced), `clarify` (a question the agent needs answered to continue) or `error` (a refusal or failure from Sinatra). New kinds can appear.
Kind string `json:"kind"`
// MessageId For a message a person sent: the id it was sent with, which is its idempotency key or a generated id. `null` on every other entry.
MessageId *string `json:"messageId"`
// Role Who wrote it: `user` for a person, `agent` for the agent, `platform` for Sinatra itself. New roles can appear.
Role string `json:"role"`
}
Message An entry in a task's conversation.
type MessageList ¶
type MessageList struct {
// Messages The page's entries, oldest first.
Messages []Message `json:"messages"`
// Next When it isn't `null`, more entries follow: pass it as `after` to get them. `null` on the last page.
Next *string `json:"next"`
}
MessageList A page of a task's conversation.
type MessagesCreateJSONRequestBody ¶
type MessagesCreateJSONRequestBody = CreateMessageRequest
MessagesCreateJSONRequestBody defines body for MessagesCreate for application/json ContentType.
type MessagesCreateParams ¶
type MessagesCreateParams struct {
// IdempotencyKey Makes a retry safe. 1 to 128 printable ASCII characters, with no spaces. A request repeated with the same key answers with the first one's result and does the work once; the same key with different content is `409 idempotency_conflict`. Keys belong to the person who sent them: two people using the same key start two tasks or send two messages. The key is also the `messageId` of the message the request sends, which is a start's first message.
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}
MessagesCreateParams defines parameters for MessagesCreate.
type MessagesListParams ¶
type MessagesListParams struct {
// After The `id` of the last entry you've read. Returns only later entries. An id that isn't an entry of this task is `invalid_cursor`.
After *string `form:"after,omitempty" json:"after,omitempty"`
// Limit How many entries to return, 1 to 200.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
MessagesListParams defines parameters for MessagesList.
type MessagesService ¶
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService is the conversation of a task: Client.Messages.
func (*MessagesService) Create ¶
func (s *MessagesService) Create(ctx context.Context, workspaceID, taskID string, body CreateMessageRequest, opts ...CallOption) (*CreateMessageResponse, error)
Create sends a follow-up on a task started from the API, CLI, MCP or dashboard (messages.create). It always sends an Idempotency-Key; see WithIdempotencyKey.
func (*MessagesService) List ¶
func (s *MessagesService) List(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) (*MessageList, error)
List returns one page of the task's conversation, oldest first (messages.list). params may be nil. To wait for a reply, poll with After set to the Id of the last entry you read.
func (*MessagesService) ListAll ¶
func (s *MessagesService) ListAll(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) iter.Seq2[Message, error]
ListAll returns every entry after params.After (or from the start), following next page by page. It stops after the first error, which it yields.
type Option ¶
type Option func(*Client)
Option configures NewClient.
func WithBaseURL ¶
WithBaseURL sets the API's address. It defaults to DefaultBaseURL.
func WithHTTPClient ¶
WithHTTPClient sets the *http.Client requests go through. It defaults to http.DefaultClient.
func WithTimeout ¶
WithTimeout sets how long each attempt of a request may take, from sending it to reading the whole response, before it fails with an error that wraps context.DeadlineExceeded. Timed-out attempts aren't retried. It defaults to DefaultTimeout; 0 means no limit. To limit a whole call, retries included, give it a context with a deadline.
type PullRequest ¶
type PullRequest struct {
// Merged `true` once the pull request is merged.
Merged bool `json:"merged"`
// Url The pull request's address on GitHub.
Url string `json:"url"`
}
PullRequest The pull request a task opened.
type StopTaskResponse ¶
type StopTaskResponse struct {
// Accepted Always `true`: the task was told to stop.
Accepted StopTaskResponseAccepted `json:"accepted"`
}
StopTaskResponse The stop was accepted.
type StopTaskResponseAccepted ¶
type StopTaskResponseAccepted bool
StopTaskResponseAccepted Always `true`: the task was told to stop.
const (
StopTaskResponseAcceptedTrue StopTaskResponseAccepted = true
)
Defines values for StopTaskResponseAccepted.
func (StopTaskResponseAccepted) Valid ¶
func (e StopTaskResponseAccepted) Valid() bool
Valid indicates whether the value is a known member of the StopTaskResponseAccepted enum.
type Task ¶
type Task struct {
// CreatedAt When the task was created.
CreatedAt time.Time `json:"createdAt"`
// Id The task's id. Use it as `taskId` in the task endpoints.
Id string `json:"id"`
// LastActivityAt When the task last did something. `null` if it hasn't yet.
LastActivityAt *time.Time `json:"lastActivityAt"`
// PullRequest The task's pull request. `null` until one opens.
PullRequest *PullRequest `json:"pullRequest"`
// Queued `true` while the task's agent waits because the workspace is already running as many agents at a time as its plan allows. The dashboard shows this as Waiting.
Queued bool `json:"queued"`
// Repo `owner/name` of the task's repository. `null` until a repository is chosen.
Repo *string `json:"repo"`
// Source Where the task started: `api` for the CLI, MCP, this API or the dashboard, `linear` or `github_issue` for an issue, `slack` or `telegram` for a chat. Other sources can appear, so treat an unknown value as a task started elsewhere.
Source string `json:"source"`
// Status Where the task is in its life, such as `pending`, `implementing`, `replied`, `pr_open` or `completed`. New statuses can appear, so don't treat the list as closed. See [Raw statuses](https://docs.sinatra.dev/docs/getting-started/how-it-works#raw-statuses) for each one.
Status string `json:"status"`
// Title The task's title: its issue's title, or a chat task's name. `null` for a task whose issue has no title, or a chat task not yet named.
Title *string `json:"title"`
// Url The task's page in the Sinatra dashboard, where anyone in the workspace can follow it. On a task started from the CLI, MCP, API or dashboard they can reply there too.
Url *string `json:"url"`
}
Task A task: one piece of work Sinatra does, from any source.
type TaskList ¶
type TaskList struct {
// NextCursor Pass it back as `cursor` to get the next page. Treat it as opaque. `null` on the last page.
NextCursor *string `json:"nextCursor"`
// Tasks The page's tasks, most recently active first.
Tasks []Task `json:"tasks"`
}
TaskList A page of tasks.
type TasksCreateJSONRequestBody ¶
type TasksCreateJSONRequestBody = CreateTaskRequest
TasksCreateJSONRequestBody defines body for TasksCreate for application/json ContentType.
type TasksCreateParams ¶
type TasksCreateParams struct {
// IdempotencyKey Makes a retry safe. 1 to 128 printable ASCII characters, with no spaces. A request repeated with the same key answers with the first one's result and does the work once; the same key with different content is `409 idempotency_conflict`. Keys belong to the person who sent them: two people using the same key start two tasks or send two messages. The key is also the `messageId` of the message the request sends, which is a start's first message.
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}
TasksCreateParams defines parameters for TasksCreate.
type TasksListParams ¶
type TasksListParams struct {
// Status Only tasks in this status, such as `implementing` or `pr_open`. A name that isn't a task status is `invalid_status`.
Status *string `form:"status,omitempty" json:"status,omitempty"`
// Limit How many tasks to return, 1 to 100.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// Cursor `nextCursor` from the previous page. Treat it as opaque.
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
}
TasksListParams defines parameters for TasksList.
type TasksService ¶
type TasksService struct {
// contains filtered or unexported fields
}
TasksService is a workspace's tasks: Client.Tasks.
func (*TasksService) Create ¶
func (s *TasksService) Create(ctx context.Context, workspaceID string, body CreateTaskRequest, opts ...CallOption) (*CreateTaskResponse, error)
Create starts a task (tasks.create). It returns once the task is made, not when it's done: follow it with Get and Messages.ListAll. It always sends an Idempotency-Key; see WithIdempotencyKey.
func (*TasksService) List ¶
func (s *TasksService) List(ctx context.Context, workspaceID string, params *TasksListParams) (*TaskList, error)
List returns one page of the workspace's tasks, most recently active first (tasks.list). params may be nil. ListAll follows the pages for you.
func (*TasksService) ListAll ¶
func (s *TasksService) ListAll(ctx context.Context, workspaceID string, params *TasksListParams) iter.Seq2[Task, error]
ListAll returns every task from params.Cursor on (or from the start), following nextCursor page by page. It stops after the first error, which it yields.
func (*TasksService) Stop ¶
func (s *TasksService) Stop(ctx context.Context, workspaceID, taskID string) (*StopTaskResponse, error)
Stop stops the task's running turn (tasks.stop). A task that isn't running is 409 not_running. Retried on 503 only.
type Ticket ¶
type Ticket struct {
// Context The Linear team's name, or the GitHub repository's name.
Context *string `json:"context"`
// Id The issue's id on Sinatra's side. For GitHub it looks like `github:owner/name#42`.
Id string `json:"id"`
// Identifier What to delegate it by. A Linear identifier such as `ENG-123` (send it as `id`), or a GitHub `owner/name#42` (send `owner/name` as `repo` and `42` as `number`).
Identifier string `json:"identifier"`
// Source Where the issue lives: `linear` or `github`. New sources can appear.
Source string `json:"source"`
// State A GitHub issue's state, such as `open`. `null` for a Linear issue.
State *string `json:"state"`
// Title The issue's title.
Title string `json:"title"`
// Url The issue's address on its tracker.
Url string `json:"url"`
// WorkspaceId The id of the workspace that was searched.
WorkspaceId string `json:"workspaceId"`
// WorkspaceLabel The name the dashboard's ticket picker gives that workspace.
WorkspaceLabel string `json:"workspaceLabel"`
// Yours `true` if the issue is assigned to you or you wrote it.
Yours bool `json:"yours"`
}
Ticket An open issue you could delegate to Sinatra.
type TicketSearchResult ¶
type TicketSearchResult struct {
// Github The workspace's GitHub connection.
Github struct {
// Connected Whether the workspace is connected to GitHub.
Connected bool `json:"connected"`
// Repo The repository the GitHub search covered, when the `repo` query matched an enabled one and had open issues. Otherwise `null`.
Repo *string `json:"repo"`
} `json:"github"`
// Linear The workspace's Linear connection, as it applies to you.
Linear struct {
// Connected Whether the workspace is connected to Linear.
Connected bool `json:"connected"`
// IdentityBound Whether your Linear identity is tied to your Sinatra user.
IdentityBound bool `json:"identityBound"`
// IdentityLinked Whether your Linear account is linked in this workspace. Linear issues are listed only when it is.
IdentityLinked bool `json:"identityLinked"`
} `json:"linear"`
// Tickets The issues you could delegate. Linear issues come first, then GitHub's, each with yours before your team's unassigned ones.
Tickets []Ticket `json:"tickets"`
}
TicketSearchResult The issues you could delegate, and how the workspace is connected to each tracker.
type TicketsDelegateJSONRequestBody ¶
type TicketsDelegateJSONRequestBody = DelegateTicketRequest
TicketsDelegateJSONRequestBody defines body for TicketsDelegate for application/json ContentType.
type TicketsSearchParams ¶
type TicketsSearchParams struct {
// Q Text to match: GitHub search terms, and a substring of a Linear issue's title. Up to 200 characters.
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Repo `owner/name` of an enabled repository to search first on GitHub. A repository that isn't enabled is ignored.
Repo *string `form:"repo,omitempty" json:"repo,omitempty"`
}
TicketsSearchParams defines parameters for TicketsSearch.
type TicketsService ¶
type TicketsService struct {
// contains filtered or unexported fields
}
TicketsService is the issues you could delegate: Client.Tickets.
func (*TicketsService) Delegate ¶
func (s *TicketsService) Delegate(ctx context.Context, workspaceID string, ticket DelegateTarget) (*DelegateTicketResponse, error)
Delegate hands Sinatra an existing issue, as you (tickets.delegate):
client.Tickets.Delegate(ctx, workspaceID, sinatra.DelegateLinearTicket{Id: "ENG-123"})
client.Tickets.Delegate(ctx, workspaceID, sinatra.DelegateGithubTicket{Repo: "acme/web", Number: 42})
Never retried: the operation takes no Idempotency-Key.
func (*TicketsService) Search ¶
func (s *TicketsService) Search(ctx context.Context, workspaceID string, params *TicketsSearchParams) (*TicketSearchResult, error)
Search returns open Linear and GitHub issues you could delegate (tickets.search). params may be nil.
type UpdateEmailPreferencesRequest ¶ added in v0.1.8
type UpdateEmailPreferencesRequest struct {
// contains filtered or unexported fields
}
UpdateEmailPreferencesRequest Set at least one boolean. Omitted categories are unchanged; these preferences belong to you across all your workspaces.
func (UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0() (UpdateEmailPreferencesRequest0, error)
AsUpdateEmailPreferencesRequest0 returns the union data inside the UpdateEmailPreferencesRequest as a UpdateEmailPreferencesRequest0
func (UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1() (UpdateEmailPreferencesRequest1, error)
AsUpdateEmailPreferencesRequest1 returns the union data inside the UpdateEmailPreferencesRequest as a UpdateEmailPreferencesRequest1
func (*UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
FromUpdateEmailPreferencesRequest0 overwrites any union data inside the UpdateEmailPreferencesRequest as the provided UpdateEmailPreferencesRequest0
func (*UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
FromUpdateEmailPreferencesRequest1 overwrites any union data inside the UpdateEmailPreferencesRequest as the provided UpdateEmailPreferencesRequest1
func (UpdateEmailPreferencesRequest) MarshalJSON ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) MarshalJSON() ([]byte, error)
func (*UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
MergeUpdateEmailPreferencesRequest0 performs a merge with any union data inside the UpdateEmailPreferencesRequest, using the provided UpdateEmailPreferencesRequest0
func (*UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
MergeUpdateEmailPreferencesRequest1 performs a merge with any union data inside the UpdateEmailPreferencesRequest, using the provided UpdateEmailPreferencesRequest1
func (*UpdateEmailPreferencesRequest) UnmarshalJSON ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) UnmarshalJSON(b []byte) error
type UpdateEmailPreferencesRequest0 ¶ added in v0.1.8
type UpdateEmailPreferencesRequest0 struct {
SetupReminders bool `json:"setupReminders"`
TaskAlerts *bool `json:"taskAlerts,omitempty"`
}
UpdateEmailPreferencesRequest0 defines model for UpdateEmailPreferencesRequest.0.
type UpdateEmailPreferencesRequest1 ¶ added in v0.1.8
type UpdateEmailPreferencesRequest1 struct {
SetupReminders *bool `json:"setupReminders,omitempty"`
TaskAlerts bool `json:"taskAlerts"`
}
UpdateEmailPreferencesRequest1 defines model for UpdateEmailPreferencesRequest.1.
type Workspace ¶
type Workspace struct {
// Id The workspace's id. Use it as `workspaceId` in the workspace endpoints.
Id string `json:"id"`
// Name The workspace's name.
Name string `json:"name"`
// Role Your role in it: `owner`, `admin` or `member`. New roles can appear.
Role string `json:"role"`
}
Workspace A workspace you belong to.
type WorkspaceAccess ¶ added in v0.1.8
type WorkspaceAccess struct {
AccessRequests []struct {
AssignedRole *string `json:"assignedRole"`
Id string `json:"id"`
RequestedAt time.Time `json:"requestedAt"`
Requester struct {
AvatarUrl *string `json:"avatarUrl"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
Name *string `json:"name"`
} `json:"requester"`
ReviewedAt *time.Time `json:"reviewedAt"`
State string `json:"state"`
} `json:"accessRequests"`
Invites []WorkspaceInvite `json:"invites"`
Memberships []struct {
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Role string `json:"role"`
User struct {
AvatarUrl *string `json:"avatarUrl"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
Name *string `json:"name"`
} `json:"user"`
} `json:"memberships"`
}
WorkspaceAccess defines model for WorkspaceAccess.
type WorkspaceAccessApproveRequestJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessApproveRequestJSONRequestBody = WorkspaceGrantRoleRequest
WorkspaceAccessApproveRequestJSONRequestBody defines body for WorkspaceAccessApproveRequest for application/json ContentType.
type WorkspaceAccessApproved ¶ added in v0.1.8
type WorkspaceAccessApproved struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"membership"`
Request struct {
AssignedRole *string `json:"assignedRole"`
Id string `json:"id"`
State string `json:"state"`
} `json:"request"`
}
WorkspaceAccessApproved defines model for WorkspaceAccessApproved.
type WorkspaceAccessCreateInviteJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessCreateInviteJSONRequestBody = WorkspaceInviteCreateRequest
WorkspaceAccessCreateInviteJSONRequestBody defines body for WorkspaceAccessCreateInvite for application/json ContentType.
type WorkspaceAccessDenied ¶ added in v0.1.8
type WorkspaceAccessDenied struct {
Request struct {
Id string `json:"id"`
State string `json:"state"`
} `json:"request"`
}
WorkspaceAccessDenied defines model for WorkspaceAccessDenied.
type WorkspaceAccessOk ¶ added in v0.1.8
type WorkspaceAccessOk struct {
Ok WorkspaceAccessOkOk `json:"ok"`
}
WorkspaceAccessOk defines model for WorkspaceAccessOk.
type WorkspaceAccessOkOk ¶ added in v0.1.8
type WorkspaceAccessOkOk bool
WorkspaceAccessOkOk defines model for WorkspaceAccessOk.Ok.
const (
WorkspaceAccessOkOkTrue WorkspaceAccessOkOk = true
)
Defines values for WorkspaceAccessOkOk.
func (WorkspaceAccessOkOk) Valid ¶ added in v0.1.8
func (e WorkspaceAccessOkOk) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceAccessOkOk enum.
type WorkspaceAccessSetRoleJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessSetRoleJSONRequestBody = WorkspaceGrantRoleRequest
WorkspaceAccessSetRoleJSONRequestBody defines body for WorkspaceAccessSetRole for application/json ContentType.
type WorkspaceGrantRoleRequest ¶ added in v0.1.8
type WorkspaceGrantRoleRequest struct {
// Role The role to grant. Ownership can only be transferred, never granted.
Role WorkspaceGrantRoleRequestRole `json:"role"`
}
WorkspaceGrantRoleRequest defines model for WorkspaceGrantRoleRequest.
type WorkspaceGrantRoleRequestRole ¶ added in v0.1.8
type WorkspaceGrantRoleRequestRole string
WorkspaceGrantRoleRequestRole The role to grant. Ownership can only be transferred, never granted.
const ( WorkspaceGrantRoleRequestRoleAdmin WorkspaceGrantRoleRequestRole = "admin" WorkspaceGrantRoleRequestRoleMember WorkspaceGrantRoleRequestRole = "member" )
Defines values for WorkspaceGrantRoleRequestRole.
func (WorkspaceGrantRoleRequestRole) Valid ¶ added in v0.1.8
func (e WorkspaceGrantRoleRequestRole) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceGrantRoleRequestRole enum.
type WorkspaceInvite ¶ added in v0.1.8
type WorkspaceInvite struct {
AcceptedAt *time.Time `json:"acceptedAt"`
CreatedAt time.Time `json:"createdAt"`
DeclinedAt *time.Time `json:"declinedAt"`
Email string `json:"email"`
ExpiresAt time.Time `json:"expiresAt"`
Id string `json:"id"`
RevokedAt *time.Time `json:"revokedAt"`
Role string `json:"role"`
// Status active, revoked, expired, consumed or declined.
Status string `json:"status"`
}
WorkspaceInvite An invitation's public metadata. No invitation token or redemption secret is returned.
type WorkspaceInviteCreateRequest ¶ added in v0.1.8
type WorkspaceInviteCreateRequest struct {
Email openapi_types.Email `json:"email"`
Role WorkspaceInviteCreateRequestRole `json:"role"`
}
WorkspaceInviteCreateRequest defines model for WorkspaceInviteCreateRequest.
type WorkspaceInviteCreateRequestRole ¶ added in v0.1.8
type WorkspaceInviteCreateRequestRole string
WorkspaceInviteCreateRequestRole defines model for WorkspaceInviteCreateRequest.Role.
const ( WorkspaceInviteCreateRequestRoleAdmin WorkspaceInviteCreateRequestRole = "admin" WorkspaceInviteCreateRequestRoleMember WorkspaceInviteCreateRequestRole = "member" )
Defines values for WorkspaceInviteCreateRequestRole.
func (WorkspaceInviteCreateRequestRole) Valid ¶ added in v0.1.8
func (e WorkspaceInviteCreateRequestRole) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceInviteCreateRequestRole enum.
type WorkspaceInviteResponse ¶ added in v0.1.8
type WorkspaceInviteResponse struct {
// Invite An invitation's public metadata. No invitation token or redemption secret is returned.
Invite WorkspaceInvite `json:"invite"`
}
WorkspaceInviteResponse defines model for WorkspaceInviteResponse.
type WorkspaceMembershipResponse ¶ added in v0.1.8
type WorkspaceMembershipResponse struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"membership"`
}
WorkspaceMembershipResponse defines model for WorkspaceMembershipResponse.
type WorkspaceOverview ¶ added in v0.1.8
type WorkspaceOverview struct {
// DefaultModel The workspace's saved model default, or null when unset. Personal and repository overrides aren't included.
DefaultModel *struct {
Effort *string `json:"effort,omitempty"`
Engine string `json:"engine"`
Model string `json:"model"`
} `json:"defaultModel"`
Github struct {
AccountLogin *string `json:"accountLogin"`
AccountType *string `json:"accountType"`
// InstallationId GitHub installation id as a decimal string.
InstallationId *string `json:"installationId"`
// Status `connected` or `not_connected`.
Status string `json:"status"`
} `json:"github"`
// Id The workspace's id. Use it as `workspaceId` in the workspace endpoints.
Id string `json:"id"`
Linear struct {
CurrentUserHasReadToken bool `json:"currentUserHasReadToken"`
NeedsReconnect bool `json:"needsReconnect"`
OrganizationName *string `json:"organizationName"`
OrganizationUrlKey *string `json:"organizationUrlKey"`
RecentTeams []struct {
Key string `json:"key"`
TaskCount int `json:"taskCount"`
} `json:"recentTeams"`
// Status `connected` or `not_connected`.
Status string `json:"status"`
} `json:"linear"`
// Name The workspace's name.
Name string `json:"name"`
PlanStatus WorkspaceOverview_PlanStatus `json:"planStatus"`
// RepoCatalog `none` without GitHub, `syncing` before its catalog is published, `ready` once published, or `suspended`. An empty repository list while syncing doesn't mean there are no connected repositories.
RepoCatalog string `json:"repoCatalog"`
RepoEnvironmentsEnabled bool `json:"repoEnvironmentsEnabled"`
// RepoEnvironmentsStage Repository environments rollout stage: `off`, `prepare` or `live`.
RepoEnvironmentsStage string `json:"repoEnvironmentsStage"`
Repos []struct {
Id string `json:"id"`
// Name Connected repository in `owner/name` form.
Name string `json:"name"`
Preprocessing struct {
Label struct {
Error *string `json:"error"`
Status string `json:"status"`
} `json:"label"`
Metadata struct {
Error *string `json:"error"`
Status string `json:"status"`
} `json:"metadata"`
OverallStatus string `json:"overallStatus"`
} `json:"preprocessing"`
PrimaryLanguage *string `json:"primaryLanguage"`
ShortDescription string `json:"shortDescription"`
Stack *string `json:"stack"`
} `json:"repos"`
// Role Your role in it: `owner`, `admin` or `member`. New roles can appear.
Role string `json:"role"`
Slack struct {
AllowExternalSharedChannels bool `json:"allowExternalSharedChannels"`
Available bool `json:"available"`
Identity *struct {
DisplayName *string `json:"displayName"`
SlackUserId string `json:"slackUserId"`
} `json:"identity"`
// Status `connected`, `inactive` or `not_connected`.
Status string `json:"status"`
TeamName *string `json:"teamName"`
} `json:"slack"`
Telegram struct {
Available bool `json:"available"`
Enabled bool `json:"enabled"`
} `json:"telegram"`
}
WorkspaceOverview Read-only workspace overview, with the same member-visible data as the dashboard. No credentials or tokens.
type WorkspaceOverviewPlanStatus0 ¶ added in v0.1.8
type WorkspaceOverviewPlanStatus0 struct {
Plan WorkspaceOverviewPlanStatus0Plan `json:"plan"`
}
WorkspaceOverviewPlanStatus0 defines model for WorkspaceOverview.PlanStatus.0.
type WorkspaceOverviewPlanStatus0Plan ¶ added in v0.1.8
type WorkspaceOverviewPlanStatus0Plan string
WorkspaceOverviewPlanStatus0Plan defines model for WorkspaceOverview.PlanStatus.0.Plan.
const (
WorkspaceOverviewPlanStatus0PlanEnterprise WorkspaceOverviewPlanStatus0Plan = "enterprise"
)
Defines values for WorkspaceOverviewPlanStatus0Plan.
func (WorkspaceOverviewPlanStatus0Plan) Valid ¶ added in v0.1.8
func (e WorkspaceOverviewPlanStatus0Plan) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceOverviewPlanStatus0Plan enum.
type WorkspaceOverviewPlanStatus1 ¶ added in v0.1.8
type WorkspaceOverviewPlanStatus1 struct {
// ByokConfigured Whether your model credentials or a workspace key are configured.
ByokConfigured bool `json:"byokConfigured"`
Capacity struct {
Plan string `json:"plan"`
Queued int `json:"queued"`
Running int `json:"running"`
} `json:"capacity"`
CapacityCatalog []struct {
Plan string `json:"plan"`
PriceUsd float32 `json:"priceUsd"`
Queued int `json:"queued"`
Running int `json:"running"`
} `json:"capacityCatalog"`
Plan WorkspaceOverviewPlanStatus1Plan `json:"plan"`
Subscription *struct {
ActionRequiredHostedInvoiceUrl *string `json:"actionRequiredHostedInvoiceUrl"`
CancelAtPeriodEnd bool `json:"cancelAtPeriodEnd"`
CapacityPlan *string `json:"capacityPlan"`
CurrentPeriodEnd *time.Time `json:"currentPeriodEnd"`
EndsAt *time.Time `json:"endsAt"`
PastDueSinceAt *time.Time `json:"pastDueSinceAt"`
Status string `json:"status"`
TrialEndsAt *time.Time `json:"trialEndsAt"`
} `json:"subscription"`
}
WorkspaceOverviewPlanStatus1 defines model for WorkspaceOverview.PlanStatus.1.
type WorkspaceOverviewPlanStatus1Plan ¶ added in v0.1.8
type WorkspaceOverviewPlanStatus1Plan string
WorkspaceOverviewPlanStatus1Plan defines model for WorkspaceOverview.PlanStatus.1.Plan.
const (
WorkspaceOverviewPlanStatus1PlanMonthly WorkspaceOverviewPlanStatus1Plan = "monthly"
)
Defines values for WorkspaceOverviewPlanStatus1Plan.
func (WorkspaceOverviewPlanStatus1Plan) Valid ¶ added in v0.1.8
func (e WorkspaceOverviewPlanStatus1Plan) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceOverviewPlanStatus1Plan enum.
type WorkspaceOverview_PlanStatus ¶ added in v0.1.8
type WorkspaceOverview_PlanStatus struct {
// contains filtered or unexported fields
}
WorkspaceOverview_PlanStatus defines model for WorkspaceOverview.PlanStatus.
func (WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus0 ¶ added in v0.1.8
func (t WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus0() (WorkspaceOverviewPlanStatus0, error)
AsWorkspaceOverviewPlanStatus0 returns the union data inside the WorkspaceOverview_PlanStatus as a WorkspaceOverviewPlanStatus0
func (WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus1 ¶ added in v0.1.8
func (t WorkspaceOverview_PlanStatus) AsWorkspaceOverviewPlanStatus1() (WorkspaceOverviewPlanStatus1, error)
AsWorkspaceOverviewPlanStatus1 returns the union data inside the WorkspaceOverview_PlanStatus as a WorkspaceOverviewPlanStatus1
func (*WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus0 ¶ added in v0.1.8
func (t *WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus0(v WorkspaceOverviewPlanStatus0) error
FromWorkspaceOverviewPlanStatus0 overwrites any union data inside the WorkspaceOverview_PlanStatus as the provided WorkspaceOverviewPlanStatus0
func (*WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus1 ¶ added in v0.1.8
func (t *WorkspaceOverview_PlanStatus) FromWorkspaceOverviewPlanStatus1(v WorkspaceOverviewPlanStatus1) error
FromWorkspaceOverviewPlanStatus1 overwrites any union data inside the WorkspaceOverview_PlanStatus as the provided WorkspaceOverviewPlanStatus1
func (WorkspaceOverview_PlanStatus) MarshalJSON ¶ added in v0.1.8
func (t WorkspaceOverview_PlanStatus) MarshalJSON() ([]byte, error)
func (*WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus0 ¶ added in v0.1.8
func (t *WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus0(v WorkspaceOverviewPlanStatus0) error
MergeWorkspaceOverviewPlanStatus0 performs a merge with any union data inside the WorkspaceOverview_PlanStatus, using the provided WorkspaceOverviewPlanStatus0
func (*WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus1 ¶ added in v0.1.8
func (t *WorkspaceOverview_PlanStatus) MergeWorkspaceOverviewPlanStatus1(v WorkspaceOverviewPlanStatus1) error
MergeWorkspaceOverviewPlanStatus1 performs a merge with any union data inside the WorkspaceOverview_PlanStatus, using the provided WorkspaceOverviewPlanStatus1
func (*WorkspaceOverview_PlanStatus) UnmarshalJSON ¶ added in v0.1.8
func (t *WorkspaceOverview_PlanStatus) UnmarshalJSON(b []byte) error
type WorkspaceOwnershipTransferred ¶ added in v0.1.8
type WorkspaceOwnershipTransferred struct {
From struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"from"`
To struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"to"`
}
WorkspaceOwnershipTransferred defines model for WorkspaceOwnershipTransferred.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
delegate-issue
command
Command delegate-issue hands Sinatra an issue you already have, the way assigning it in Linear or labelling it on GitHub would.
|
Command delegate-issue hands Sinatra an issue you already have, the way assigning it in Linear or labelling it on GitHub would. |
|
open-prs
command
Command open-prs prints every pull request Sinatra has open and waiting for review, in each of your workspaces, as a Markdown list you can paste into a standup or a Slack channel.
|
Command open-prs prints every pull request Sinatra has open and waiting for review, in each of your workspaces, as a Markdown list you can paste into a standup or a Slack channel. |
|
quickstart
command
Command quickstart is README.md's quick start as a whole program: it starts a task in your first workspace and prints the conversation until the turn ends.
|
Command quickstart is README.md's quick start as a whole program: it starts a task in your first workspace and prints the conversation until the turn ends. |
|
search-issues
command
Command search-issues lists open Linear and GitHub issues you could hand to Sinatra, yours first.
|
Command search-issues lists open Linear and GitHub issues you could hand to Sinatra, yours first. |