Documentation
¶
Index ¶
- func DefaultBaseURL() string
- type Client
- func (c *Client) AnswerQuestion(threadID, interactionID string, answers map[string][]string) error
- func (c *Client) Archive(threadID string) error
- func (c *Client) Delete(threadID string) error
- func (c *Client) ExecutionOptions(threadID string) (ExecutionOptions, error)
- func (c *Client) Files(projectID, query string, limit int) ([]ProjectFile, error)
- func (c *Client) Health() error
- func (c *Client) Interactions(threadID string) ([]Interaction, error)
- func (c *Client) ListProjects() ([]Project, error)
- func (c *Client) ListThreads() ([]Thread, error)
- func (c *Client) Options(providerID string) (ProviderOptions, error)
- func (c *Client) PermissionModes(providerID string) ([]string, error)
- func (c *Client) Pin(threadID string) error
- func (c *Client) ResolveApproval(threadID, interactionID, decision string) error
- func (c *Client) Retry(threadID string) error
- func (c *Client) Send(threadID, text string, attachments []LocalAttachment, model, permission string) error
- func (c *Client) Skills(projectID, environmentID string) ([]Skill, error)
- func (c *Client) Spawn(request SpawnRequest) (string, error)
- func (c *Client) Stop(threadID string) error
- func (c *Client) Timeline(threadID string, segmentLimit int) (*Timeline, error)
- func (c *Client) Unpin(threadID string) error
- type ExecutionOptions
- type Interaction
- type InteractionPayload
- type LocalAttachment
- type Model
- type Project
- type ProjectFile
- type ProviderOptions
- type Question
- type QuestionOption
- type Runtime
- type Skill
- type SpawnRequest
- type SpawnResult
- type Thread
- type Timeline
- type TimelineRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBaseURL ¶
func DefaultBaseURL() string
Types ¶
type Client ¶
func (*Client) AnswerQuestion ¶
AnswerQuestion answers a user_question. Answers map question id to the option values chosen for it.
func (*Client) ExecutionOptions ¶
func (c *Client) ExecutionOptions(threadID string) (ExecutionOptions, error)
func (*Client) Files ¶
func (c *Client) Files(projectID, query string, limit int) ([]ProjectFile, error)
Files searches the project's tree for "@" mentions. The query is applied by the server, so a repo with a hundred thousand files costs one request.
func (*Client) Interactions ¶
func (c *Client) Interactions(threadID string) ([]Interaction, error)
func (*Client) ListProjects ¶
func (*Client) ListThreads ¶
func (*Client) Options ¶
func (c *Client) Options(providerID string) (ProviderOptions, error)
Options reports what a provider will accept for the next message: its model catalogue and its permission modes. Both are per-provider, so the picker offers exactly what the app would.
func (*Client) PermissionModes ¶
PermissionModes reports what the provider will accept, so the composer offers the same choices the app does rather than a guessed list.
func (*Client) ResolveApproval ¶
ResolveApproval answers a tool approval. Decision is one of allow_once, allow_for_session, deny.
func (*Client) Retry ¶
Retry re-submits the thread's most recent failed turn. A null turnRequestId means that turn, which is the one whose failure put the thread in error.
func (*Client) Send ¶
func (c *Client) Send(threadID, text string, attachments []LocalAttachment, model, permission string) error
Send posts a message to a thread. "auto" lets bb decide between starting a turn and steering one already in flight, which is what the app's composer does.
func (*Client) Skills ¶
Skills lists what "/" can insert. environmentID may be empty, which asks for the project's own skills without an environment's overlay.
func (*Client) Spawn ¶
func (c *Client) Spawn(request SpawnRequest) (string, error)
Spawn creates a thread and dispatches its first message. The environment is left as the project default, which is what the app's new-thread composer does unless the user picks otherwise.
type ExecutionOptions ¶
type Interaction ¶
type Interaction struct {
ID string `json:"id"`
ThreadID string `json:"threadId"`
Status string `json:"status"`
CreatedAt int64 `json:"createdAt"`
Payload InteractionPayload `json:"payload"`
}
func (Interaction) Summary ¶
func (i Interaction) Summary() string
Summary is the one-line description shown in a picker.
type InteractionPayload ¶
type LocalAttachment ¶
LocalAttachment is a file on this machine to send with a message. bb reads it server-side, so only the path travels.
type ProjectFile ¶
type ProviderOptions ¶
type Question ¶
type Question struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
ShortLabel string `json:"shortLabel"`
MultiSelect bool `json:"multiSelect"`
Options []QuestionOption `json:"options"`
}
type QuestionOption ¶
type SpawnRequest ¶
type SpawnResult ¶
type SpawnResult struct {
ID string `json:"id"`
}
type Thread ¶
type Thread struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Title *string `json:"title"`
TitleFallback *string `json:"titleFallback"`
Status string `json:"status"`
Runtime Runtime `json:"runtime"`
QueuedWork string `json:"queuedWork"`
HasPendingInteraction bool `json:"hasPendingInteraction"`
PinnedAt *int64 `json:"pinnedAt"`
ArchivedAt *int64 `json:"archivedAt"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
EnvironmentBranchName *string `json:"environmentBranchName"`
EnvironmentPath *string `json:"environmentPath"`
ProviderID string `json:"providerId"`
}
type Timeline ¶
type Timeline struct {
MaxSeq int64 `json:"maxSeq"`
Rows []TimelineRow `json:"rows"`
}
type TimelineRow ¶
type TimelineRow struct {
ID string `json:"id"`
Kind string `json:"kind"`
Role string `json:"role"`
Text string `json:"text"`
Title string `json:"title"`
WorkKind string `json:"workKind"`
Status string `json:"status"`
Command string `json:"command"`
Path string `json:"path"`
Query string `json:"query"`
ExitCode *int `json:"exitCode"`
Question string `json:"question"`
CreatedAt int64 `json:"createdAt"`
StartedAt int64 `json:"startedAt"`
Summary *string `json:"summary"`
}