Documentation
¶
Index ¶
- type AISettings
- type AISettingsWrite
- type APIError
- type BatchAck
- type Bootstrap
- type BriefItem
- type ChangePage
- type Client
- func (c *Client) AISettings(ctx context.Context, projectID string) (AISettings, error)
- func (c *Client) Bootstrap(ctx context.Context) (Bootstrap, error)
- func (c *Client) Collaboration(ctx context.Context, projectID string) (CollaborationSnapshot, error)
- func (c *Client) CommentSyncCard(ctx context.Context, cardID, body string) (SyncComment, error)
- func (c *Client) CreateBrief(ctx context.Context, workstreamID, trigger, sinceCursor string, ...) (CoordinationBrief, error)
- func (c *Client) CreateDashboardTicket(ctx context.Context, projectID string) (DashboardTicket, error)
- func (c *Client) CreateInvite(ctx context.Context, projectID string, expiresInSeconds, maxUses int) (Invite, error)
- func (c *Client) CreateProject(ctx context.Context, label, deviceLabel, displayName, appVersion string) (Project, error)
- func (c *Client) CreateSyncCard(ctx context.Context, projectID, findingID, title, summary string) (SyncCard, error)
- func (c *Client) Enroll(ctx context.Context, ...) (Enrollment, error)
- func (c *Client) Heartbeat(ctx context.Context, workspaceID, state string) error
- func (c *Client) JoinProject(ctx context.Context, ...) (Membership, error)
- func (c *Client) ProjectChanges(ctx context.Context, projectID string) (ChangePage, error)
- func (c *Client) PublishBatch(ctx context.Context, batch []byte) (BatchAck, error)
- func (c *Client) PutAISettings(ctx context.Context, projectID string, write AISettingsWrite) (AISettings, error)
- func (c *Client) ResolveSyncCard(ctx context.Context, cardID string, expectedRevision int, summary string, ...) (Resolution, error)
- func (c *Client) RevokeDevice(ctx context.Context, deviceID string) error
- type CollaborationSnapshot
- type CoordinationBrief
- type CredentialStatus
- type DashboardTicket
- type Enrollment
- type Invite
- type Membership
- type Project
- type Resolution
- type SyncCard
- type SyncComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AISettings ¶
type AISettings struct {
Judgment struct {
Provider string `json:"provider"`
Model string `json:"model"`
BaseURL *string `json:"baseUrl"`
KeyConfigured bool `json:"keyConfigured"`
KeyHint *string `json:"keyHint"`
} `json:"judgment"`
Embeddings struct {
Provider string `json:"provider"`
Model string `json:"model"`
Dimensions int `json:"dimensions"`
BaseURL *string `json:"baseUrl"`
KeyConfigured bool `json:"keyConfigured"`
KeyHint *string `json:"keyHint"`
} `json:"embeddings"`
Effective struct {
Judgment string `json:"judgment"`
Embeddings string `json:"embeddings"`
} `json:"effective"`
Revision int `json:"revision"`
UpdatedAt time.Time `json:"updatedAt"`
}
type AISettingsWrite ¶
type AISettingsWrite = protocoltypes.PutProjectAISettingsJSONBody
type APIError ¶
type APIError struct {
Status int
Code string
RequestID string
Retryable bool
// Message is the service's own sentence about what went wrong. Callers use
// Code to decide; a member reads this.
Message string
}
func (*APIError) Error ¶
Error prefers the service's sentence over the code.
This error reaches a member unchanged - the desktop shows it under the invite field, the CLI prints it - and "hosted API invite_expired (409)" tells them nothing they can act on when "That invite has expired. Ask for a new one." was already on the wire and was being discarded. Code is still what every programmatic decision is made on, including ClassifyCredentialError.
type ChangePage ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AISettings ¶
func (*Client) Collaboration ¶
func (*Client) CommentSyncCard ¶
func (*Client) CreateBrief ¶
func (*Client) CreateDashboardTicket ¶
func (*Client) CreateInvite ¶
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, label, deviceLabel, displayName, appVersion string) (Project, error)
CreateProject sends displayName only when the member chose one; omitting it keeps the device label as a seed the member is later asked to replace.
func (*Client) CreateSyncCard ¶
func (*Client) JoinProject ¶
func (c *Client) JoinProject(ctx context.Context, inviteID, inviteSecret, deviceLabel, displayName, appVersion string) (Membership, error)
JoinProject redeems an invite as the already-enrolled device this client is authenticated as. Unlike Enroll it is authenticated, and it returns only the Project that was joined.
func (*Client) ProjectChanges ¶
func (*Client) PublishBatch ¶
func (*Client) PutAISettings ¶
func (c *Client) PutAISettings(ctx context.Context, projectID string, write AISettingsWrite) (AISettings, error)
func (*Client) ResolveSyncCard ¶
type CollaborationSnapshot ¶
type CollaborationSnapshot struct {
ProjectID string `json:"projectId"`
SyncCards []SyncCard `json:"syncCards"`
Resolutions []Resolution `json:"resolutions"`
Cursor string `json:"cursor"`
}
type CoordinationBrief ¶
type CoordinationBrief struct {
BriefID string `json:"briefId"`
ProjectID string `json:"projectId"`
RepositoryID string `json:"repositoryId"`
WorkstreamID string `json:"workstreamId"`
GeneratedAt string `json:"generatedAt"`
Trigger string `json:"trigger"`
NextCursor string `json:"nextCursor,omitempty"`
ContextRevision int `json:"contextRevision"`
RequestedBudget int `json:"requestedBudget"`
RenderedSize int `json:"renderedSize"`
Truncated bool `json:"truncated"`
Items []BriefItem `json:"items"`
}
type CredentialStatus ¶
type CredentialStatus string
CredentialStatus describes whether this device's stored credential is still accepted by the hosted API.
const ( // CredentialOK means the credential authenticated successfully. CredentialOK CredentialStatus = "ok" // CredentialRevoked means a Project owner revoked this device. The member // cannot recover alone; they need a fresh invite. CredentialRevoked CredentialStatus = "revoked" // CredentialUnknown means the hosted API has no record of this credential. // It happens when the backing deployment was reset or restored, or when a // keychain entry outlived the account it belonged to. CredentialUnknown CredentialStatus = "unknown" // CredentialUncertain means the check could not complete - offline, timeout, // or a server fault. It must never be treated as a reason to reset anything. CredentialUncertain CredentialStatus = "uncertain" )
func ClassifyCredentialError ¶
func ClassifyCredentialError(err error) CredentialStatus
ClassifyCredentialError maps an error from any authenticated call onto a credential status. Both rejection codes arrive as HTTP 401, so the code - not the status - decides whether the member can recover on their own.
func (CredentialStatus) Recoverable ¶
func (s CredentialStatus) Recoverable() bool
Recoverable reports whether a status means the local enrollment is dead and the member should be offered a reconnect.
type DashboardTicket ¶
type Enrollment ¶
type Enrollment struct{ DeviceID, DeviceToken, DashboardTicket string }
type Membership ¶
type Membership struct{ ProjectID, DashboardTicket string }
Membership is the result of joining another Project with the device credential this Mac already holds. It carries no device token, because no device was created: one Mac has one device identity across its Projects.
type Resolution ¶
type SyncCard ¶
type SyncCard struct {
ID, FindingID, Title, Summary, State, UpdatedAt string
Revision int
Comments []SyncComment
Resolution *Resolution
}
type SyncComment ¶
type SyncComment struct{ ID, MemberName, Body, CreatedAt string }