sdk

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 74 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TurnStatusQueued         = api.TurnStatusQueued
	TurnStatusRunning        = api.TurnStatusRunning
	TurnStatusWaitingForUser = api.TurnStatusWaitingForUser
	TurnStatusCompleted      = api.TurnStatusCompleted
	TurnStatusFailed         = api.TurnStatusFailed
	TurnStatusCanceled       = api.TurnStatusCanceled
)
View Source
const (
	ElicitationStatusPending  = api.ElicitationStatusPending
	ElicitationStatusAccepted = api.ElicitationStatusAccepted
	ElicitationStatusDeclined = api.ElicitationStatusDeclined
	ElicitationStatusCanceled = api.ElicitationStatusCanceled
)
View Source
const (
	HeaderDebugEnabled    = "X-Agently-Debug"
	HeaderDebugLevel      = "X-Agently-Debug-Level"
	HeaderDebugComponents = "X-Agently-Debug-Components"
)
View Source
const (
	DirectionBefore = api.DirectionBefore
	DirectionAfter  = api.DirectionAfter
	DirectionLatest = api.DirectionLatest
)
View Source
const (
	TranscriptSelectorTurn        = "Transcript"
	TranscriptSelectorMessage     = "Message"
	TranscriptSelectorToolMessage = "ToolMessage"
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(client Backend, opts ...HandlerOption) http.Handler

func NewHandlerWithContext

func NewHandlerWithContext(ctx context.Context, client Backend, opts ...HandlerOption) (http.Handler, error)

func SelectExecutionPageCount

func SelectExecutionPageCount(turn *TurnState) int

SelectExecutionPageCount returns the total number of execution pages (iterations) in a turn.

func SelectTotalElapsedMs

func SelectTotalElapsedMs(turn *TurnState) int64

SelectTotalElapsedMs returns the total elapsed time for execution in a turn.

func WaitForReady

func WaitForReady(baseURL string, timeout time.Duration) error

func WithDebug added in v0.1.7

func WithDebug(ctx context.Context, components ...string) context.Context

WithDebug enables debug logging for a single SDK call context. When no components are provided, all components are enabled for that context.

func WithDebugOptions added in v0.1.7

func WithDebugOptions(ctx context.Context, opts ...DebugOption) context.Context

WithDebugOptions enables debug logging for a single SDK call context using explicit options such as level and component filters.

Types

type ActiveFeedState

type ActiveFeedState = api.ActiveFeedState

type ApprovalCallback added in v0.1.7

type ApprovalCallback = api.ApprovalCallback

type ApprovalCallbackPayload added in v0.1.7

type ApprovalCallbackPayload = api.ApprovalCallbackPayload

type ApprovalCallbackResult added in v0.1.7

type ApprovalCallbackResult = api.ApprovalCallbackResult

type ApprovalEditor added in v0.1.7

type ApprovalEditor = api.ApprovalEditor

type ApprovalForgeView added in v0.1.7

type ApprovalForgeView = api.ApprovalForgeView

type ApprovalMeta added in v0.1.7

type ApprovalMeta = api.ApprovalMeta

type ApprovalOption added in v0.1.7

type ApprovalOption = api.ApprovalOption

type AssistantBubble

type AssistantBubble struct {
	MessageID string
	Content   string
	IsFinal   bool
}

AssistantBubble is the content to render as the assistant's visible response.

func SelectAssistantBubble

func SelectAssistantBubble(turn *TurnState, pageIndex int) *AssistantBubble

SelectAssistantBubble determines what assistant content to display for a turn. Rules (from the proposal):

  1. Exactly one assistant bubble per visible execution page.
  2. If visible page has final content, show final content.
  3. Else if visible page has preamble, show preamble.

type AssistantMessageState

type AssistantMessageState = api.AssistantMessageState

type AssistantState

type AssistantState = api.AssistantState

type AsyncOperationState added in v0.1.7

type AsyncOperationState = api.AsyncOperationState

type AuthProvider

type AuthProvider struct {
	Name  string `json:"name"`
	Label string `json:"label"`
	Mode  string `json:"mode"`
}

type Backend added in v0.1.7

type Backend interface {
	Client
}

Backend is the server-side implementation contract used by SDK HTTP handlers. It is intentionally separate from the caller-facing Client concept, even though today it currently embeds the same operation surface.

func NewBackendFromRuntime deprecated added in v0.1.7

func NewBackendFromRuntime(rt *executor.Runtime) (Backend, error)

Deprecated: prefer internal/sdkbackend.FromRuntime for server/bootstrap wiring and NewLocalHTTPFromRuntime for SDK callers.

NewBackendFromRuntime builds the in-process backend implementation used by local handlers and server wiring.

func NewEmbedded deprecated

func NewEmbedded(agent *agentsvc.Service, conv conversation.Client) (Backend, error)

Deprecated: use NewBackendFromRuntime for server wiring and NewLocalHTTPFromRuntime for SDK callers.

NewEmbedded builds the legacy in-process backend wrapper. Prefer NewBackendFromRuntime for server wiring and NewLocalHTTPFromRuntime for SDK callers that should exercise the public endpoint contract.

func NewEmbeddedFromRuntime deprecated

func NewEmbeddedFromRuntime(rt *executor.Runtime) (Backend, error)

Deprecated: use NewBackendFromRuntime for server wiring and NewLocalHTTPFromRuntime for SDK callers.

NewEmbeddedFromRuntime builds an in-process backend over a runtime. Prefer NewLocalHTTPFromRuntime for SDK callers that should exercise the public endpoint contract instead of calling services directly.

type Client

type Client interface {
	Mode() Mode

	// Query sends a user message and returns the agent response (ReAct loop).
	Query(ctx context.Context, input *agentsvc.QueryInput) (*agentsvc.QueryOutput, error)

	// GetMessages returns a cursor-paginated page of messages for a conversation.
	GetMessages(ctx context.Context, input *GetMessagesInput) (*MessagePage, error)

	// StreamEvents subscribes to real-time streaming events for a conversation.
	StreamEvents(ctx context.Context, input *StreamEventsInput) (streaming.Subscription, error)

	// CreateConversation initialises a new conversation record.
	CreateConversation(ctx context.Context, input *CreateConversationInput) (*conversation.Conversation, error)

	// ListConversations returns a cursor-paginated list of conversations.
	ListConversations(ctx context.Context, input *ListConversationsInput) (*ConversationPage, error)
	// ListLinkedConversations returns child conversations for a given parent conversation/turn,
	// including status and latest assistant response.
	ListLinkedConversations(ctx context.Context, input *ListLinkedConversationsInput) (*LinkedConversationPage, error)

	// GetConversation retrieves a single conversation by ID.
	GetConversation(ctx context.Context, id string) (*conversation.Conversation, error)
	// UpdateConversation updates mutable conversation fields such as visibility and shareability.
	UpdateConversation(ctx context.Context, input *UpdateConversationInput) (*conversation.Conversation, error)

	// GetRun returns the current state of a run.
	GetRun(ctx context.Context, id string) (*agrun.RunRowsView, error)

	// CancelTurn aborts the active turn. Returns true if a running turn was found.
	CancelTurn(ctx context.Context, turnID string) (bool, error)
	// SteerTurn injects a user message into a currently running turn.
	SteerTurn(ctx context.Context, input *SteerTurnInput) (*SteerTurnOutput, error)
	// CancelQueuedTurn cancels a queued turn.
	CancelQueuedTurn(ctx context.Context, conversationID, turnID string) error
	// MoveQueuedTurn reorders a queued turn up/down in queue order.
	MoveQueuedTurn(ctx context.Context, input *MoveQueuedTurnInput) error
	// EditQueuedTurn updates queued turn starter message content.
	EditQueuedTurn(ctx context.Context, input *EditQueuedTurnInput) error
	// ForceSteerQueuedTurn cancels queued turn and injects its message into active turn.
	ForceSteerQueuedTurn(ctx context.Context, conversationID, turnID string) (*SteerTurnOutput, error)

	// ResolveElicitation delivers the user response for an elicitation prompt.
	ResolveElicitation(ctx context.Context, input *ResolveElicitationInput) error
	// ListPendingElicitations returns unresolved elicitation prompts for a conversation.
	ListPendingElicitations(ctx context.Context, input *ListPendingElicitationsInput) ([]*PendingElicitation, error)
	// ListPendingToolApprovals returns queued tool approvals for a user/conversation.
	ListPendingToolApprovals(ctx context.Context, input *ListPendingToolApprovalsInput) (*PendingToolApprovalPage, error)
	// DecideToolApproval resolves a queued tool request with approve/reject.
	DecideToolApproval(ctx context.Context, input *DecideToolApprovalInput) (*DecideToolApprovalOutput, error)

	// ExecuteTool invokes a registered tool by name and returns its textual result.
	ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)

	// ListTemplates returns output templates available to the current agent/workspace.
	ListTemplates(ctx context.Context, input *ListTemplatesInput) (*ListTemplatesOutput, error)

	// GetTemplate resolves one output template by name and can request document inclusion.
	GetTemplate(ctx context.Context, input *GetTemplateInput) (*GetTemplateOutput, error)

	// ListToolDefinitions returns the set of tool definitions available in the workspace.
	ListToolDefinitions(ctx context.Context) ([]ToolDefinitionInfo, error)

	// UploadFile stores a file associated with a conversation.
	UploadFile(ctx context.Context, input *UploadFileInput) (*UploadFileOutput, error)

	// DownloadFile retrieves a previously uploaded file.
	DownloadFile(ctx context.Context, input *DownloadFileInput) (*DownloadFileOutput, error)

	// ListFiles returns all files associated with a conversation.
	ListFiles(ctx context.Context, input *ListFilesInput) (*ListFilesOutput, error)

	// ListResources returns resource names for a workspace kind.
	ListResources(ctx context.Context, input *ListResourcesInput) (*ListResourcesOutput, error)

	// GetResource retrieves a single workspace resource by kind and name.
	GetResource(ctx context.Context, input *ResourceRef) (*GetResourceOutput, error)

	// SaveResource creates or updates a workspace resource.
	SaveResource(ctx context.Context, input *SaveResourceInput) error

	// DeleteResource removes a workspace resource.
	DeleteResource(ctx context.Context, input *ResourceRef) error

	// ExportResources exports all resources of the given kinds.
	ExportResources(ctx context.Context, input *ExportResourcesInput) (*ExportResourcesOutput, error)

	// ImportResources imports resources in bulk.
	ImportResources(ctx context.Context, input *ImportResourcesInput) (*ImportResourcesOutput, error)

	// TerminateConversation cancels all active turns and marks the conversation as canceled.
	TerminateConversation(ctx context.Context, conversationID string) error

	// CompactConversation generates an LLM summary of conversation history, archiving old messages.
	CompactConversation(ctx context.Context, conversationID string) error

	// PruneConversation uses an LLM to select and remove low-value messages from conversation history.
	PruneConversation(ctx context.Context, conversationID string) error

	// GetTranscript returns the canonical conversation state for rendering.
	GetTranscript(ctx context.Context, input *GetTranscriptInput, options ...TranscriptOption) (*ConversationStateResponse, error)

	// GetLiveState returns the current canonical state snapshot with an EventCursor.
	// On SSE connect or reconnect the client should call GetLiveState first, then
	// consume the event stream starting at EventCursor to avoid replaying history
	// and to avoid missing events that arrived between page load and SSE connect.
	GetLiveState(ctx context.Context, conversationID string, options ...TranscriptOption) (*ConversationStateResponse, error)

	// GetPayloads returns a map of payload ID → payload for the given IDs.
	// Used for batch payload resolution in feed rendering, replacing per-step fetches.
	GetPayloads(ctx context.Context, ids []string) (map[string]*conversation.Payload, error)

	// GetA2AAgentCard returns the A2A agent card for the given agent.
	GetA2AAgentCard(ctx context.Context, agentID string) (*a2a.AgentCard, error)

	// SendA2AMessage sends a message to an A2A agent and returns the task envelope.
	SendA2AMessage(ctx context.Context, agentID string, req *a2a.SendMessageRequest) (*a2a.SendMessageResponse, error)

	// ListA2AAgents returns agent IDs that have A2A serving enabled.
	ListA2AAgents(ctx context.Context, agentIDs []string) ([]string, error)

	// GetSchedule returns a schedule by ID.
	GetSchedule(ctx context.Context, id string) (*scheduler.Schedule, error)

	// ListSchedules returns all schedules visible to the caller.
	ListSchedules(ctx context.Context) ([]*scheduler.Schedule, error)

	// UpsertSchedules creates or updates schedules in batch.
	UpsertSchedules(ctx context.Context, schedules []*scheduler.Schedule) error

	// RunScheduleNow triggers immediate execution of a schedule.
	RunScheduleNow(ctx context.Context, id string) error
}

type ConversationPage

type ConversationPage = api.ConversationPage

type ConversationState

type ConversationState = api.ConversationState

func BuildCanonicalState

func BuildCanonicalState(conversationID string, turns convstore.Transcript) *ConversationState

BuildCanonicalState converts a transcript into the canonical ConversationState. This is the single entry point for producing renderable state from transcript data.

func Reduce

func Reduce(state *ConversationState, event *streaming.Event) *ConversationState

Reducer applies a stream event to a ConversationState, returning the updated state. The reducer is source-agnostic: both live stream events and transcript-derived events feed into the same function.

The reducer is the single owner of state transitions. UI and SDK callers must not infer execution structure outside this function.

type ConversationStateResponse added in v0.1.6

type ConversationStateResponse = api.ConversationStateResponse

type ConversationStreamSnapshot added in v0.1.6

type ConversationStreamSnapshot struct {
	ConversationID     string             `json:"conversationId,omitempty"`
	State              *ConversationState `json:"state,omitempty"`
	ActiveTurnID       string             `json:"activeTurnId,omitempty"`
	Feeds              []*ActiveFeedState `json:"feeds,omitempty"`
	PendingElicitation *ElicitationState  `json:"pendingElicitation,omitempty"`
}

type ConversationStreamTracker added in v0.1.5

type ConversationStreamTracker struct {
	// contains filtered or unexported fields
}

ConversationStreamTracker is a small semantic facade over the canonical reducer.

It gives SDK consumers one place to: - apply live stream events - replace/reconcile with transcript snapshots - read the current canonical state

The goal is to keep stream consumers out of direct reducer bookkeeping.

func NewConversationStreamTracker added in v0.1.5

func NewConversationStreamTracker(conversationID string) *ConversationStreamTracker

NewConversationStreamTracker creates a tracker optionally seeded with conversation ID.

func (*ConversationStreamTracker) ActiveTurn added in v0.1.6

func (t *ConversationStreamTracker) ActiveTurn() *TurnState

ActiveTurn returns the latest non-terminal turn when one exists.

func (*ConversationStreamTracker) ActiveTurnID added in v0.1.6

func (t *ConversationStreamTracker) ActiveTurnID() string

ActiveTurnID returns the ID of the latest non-terminal turn.

func (*ConversationStreamTracker) ApplyEvent added in v0.1.5

ApplyEvent applies a single streaming event to the tracked state.

func (*ConversationStreamTracker) ApplyTranscript added in v0.1.5

ApplyTranscript replaces the tracked state with an authoritative transcript snapshot.

func (*ConversationStreamTracker) Clear added in v0.1.6

func (t *ConversationStreamTracker) Clear()

Clear is an alias for Reset to align with the TS tracker surface.

func (*ConversationStreamTracker) ConversationID added in v0.1.6

func (t *ConversationStreamTracker) ConversationID() string

ConversationID returns the currently tracked conversation ID when known.

func (*ConversationStreamTracker) Feeds added in v0.1.6

Feeds returns the currently tracked active feeds.

func (*ConversationStreamTracker) PendingElicitation added in v0.1.6

func (t *ConversationStreamTracker) PendingElicitation() *ElicitationState

PendingElicitation returns the latest pending elicitation when present.

func (*ConversationStreamTracker) Reset added in v0.1.5

func (t *ConversationStreamTracker) Reset()

Reset clears the tracked state.

func (*ConversationStreamTracker) Snapshot added in v0.1.6

Snapshot returns a lightweight immutable view of the current tracked state.

func (*ConversationStreamTracker) State added in v0.1.5

State returns the current canonical state pointer. Returns nil when no events have been applied yet or after Reset/Clear is called. Callers must nil-check the result before dereferencing.

func (*ConversationStreamTracker) TrackSubscription added in v0.1.5

func (t *ConversationStreamTracker) TrackSubscription(ctx context.Context, sub streaming.Subscription) error

TrackSubscription consumes a streaming subscription until the context is done or the subscription channel closes, applying every event to the tracker.

type CreateConversationInput

type CreateConversationInput = api.CreateConversationInput

type CreateSessionRequest added in v0.1.2

type CreateSessionRequest struct {
	Username     string `json:"username,omitempty"`
	AccessToken  string `json:"accessToken,omitempty"`
	IDToken      string `json:"idToken,omitempty"`
	RefreshToken string `json:"refreshToken,omitempty"`
	ExpiresAt    string `json:"expiresAt,omitempty"`
}

type DebugOption added in v0.1.7

type DebugOption func(*debugOptions)

func WithDebugComponents added in v0.1.7

func WithDebugComponents(components ...string) DebugOption

func WithDebugLevel added in v0.1.7

func WithDebugLevel(level string) DebugOption

type DecideToolApprovalInput

type DecideToolApprovalInput = api.DecideToolApprovalInput

type DecideToolApprovalOutput

type DecideToolApprovalOutput = api.DecideToolApprovalOutput

type Direction

type Direction = api.Direction

type DownloadFileInput

type DownloadFileInput = api.DownloadFileInput

type DownloadFileOutput

type DownloadFileOutput = api.DownloadFileOutput

type EditQueuedTurnInput

type EditQueuedTurnInput = api.EditQueuedTurnInput

type ElicitationDialog

type ElicitationDialog struct {
	ElicitationID   string
	Status          ElicitationStatus
	Message         string
	RequestedSchema json.RawMessage
	CallbackURL     string
	ResponsePayload json.RawMessage
	// IsPending is true when the user needs to respond.
	IsPending bool
}

ElicitationDialog describes the elicitation UI to present to the user.

func SelectElicitationDialog

func SelectElicitationDialog(turn *TurnState) *ElicitationDialog

SelectElicitationDialog returns the elicitation dialog state for a turn, or nil if no elicitation is active.

Rules (from the proposal):

  • Show schema form in a dialog
  • Do not render duplicate inline form or duplicate assistant bubble with the same elicitation text

type ElicitationState

type ElicitationState = api.ElicitationState

type ElicitationStatus

type ElicitationStatus = api.ElicitationStatus

type ExecutionPageState

type ExecutionPageState = api.ExecutionPageState

func SelectVisibleExecutionPage

func SelectVisibleExecutionPage(turn *TurnState, pageIndex int) *ExecutionPageState

SelectVisibleExecutionPage returns the execution page at the given index. If pageIndex is out of range, returns the active (latest) page. Returns nil if the turn has no execution state.

type ExecutionState

type ExecutionState = api.ExecutionState

type ExportResourcesInput

type ExportResourcesInput = api.ExportResourcesInput

type ExportResourcesOutput

type ExportResourcesOutput = api.ExportResourcesOutput

type FeedActivation

type FeedActivation = api.FeedActivation

type FeedMatch

type FeedMatch = api.FeedMatch

type FeedRegistry

type FeedRegistry struct {
	// contains filtered or unexported fields
}

FeedRegistry loads feed specs from workspace and matches tool calls.

func NewFeedRegistry

func NewFeedRegistry() *FeedRegistry

NewFeedRegistry creates a registry and loads all feed specs from workspace.

func (*FeedRegistry) Match

func (r *FeedRegistry) Match(toolName string) []*FeedSpec

Match returns feed specs that match a tool name (service/method or service:method).

func (*FeedRegistry) MatchAny

func (r *FeedRegistry) MatchAny(toolName string) bool

MatchAny returns true if any feed spec matches the tool name.

func (*FeedRegistry) Reload

func (r *FeedRegistry) Reload()

Reload reloads all feed specs from workspace. Safe for hot-swap.

func (*FeedRegistry) Specs

func (r *FeedRegistry) Specs() []*FeedSpec

Specs returns all loaded feed specs.

type FeedSpec

type FeedSpec = api.FeedSpec

type FeedState

type FeedState = api.FeedState

type FileEntry

type FileEntry = api.FileEntry

type GetMessagesInput

type GetMessagesInput = api.GetMessagesInput

type GetResourceOutput

type GetResourceOutput = api.GetResourceOutput

type GetTemplateInput added in v0.1.7

type GetTemplateInput = api.GetTemplateInput

type GetTemplateOutput added in v0.1.7

type GetTemplateOutput = api.GetTemplateOutput

type GetTranscriptInput

type GetTranscriptInput = api.GetTranscriptInput

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func NewHTTP

func NewHTTP(baseURL string, opts ...HTTPOption) (*HTTPClient, error)

func NewLocalHTTPFromRuntime added in v0.1.7

func NewLocalHTTPFromRuntime(ctx context.Context, rt *executor.Runtime, opts ...HandlerOption) (*HTTPClient, func(), error)

NewLocalHTTPFromRuntime creates an endpoint-backed SDK client for a local runtime. It exposes the runtime through the standard SDK HTTP handler and returns a regular HTTPClient, so SDK callers exercise the same endpoint contract as remote clients.

func (*HTTPClient) AuthBrowserSession

func (c *HTTPClient) AuthBrowserSession(ctx context.Context) error

func (*HTTPClient) AuthCreateSession added in v0.1.2

func (c *HTTPClient) AuthCreateSession(ctx context.Context, req *CreateSessionRequest) error

func (*HTTPClient) AuthLocalLogin

func (c *HTTPClient) AuthLocalLogin(ctx context.Context, name string) error

func (*HTTPClient) AuthLocalOOBSession added in v0.1.2

func (c *HTTPClient) AuthLocalOOBSession(ctx context.Context, opts *LocalOOBSessionOptions) error

func (*HTTPClient) AuthMe

func (c *HTTPClient) AuthMe(ctx context.Context) (map[string]interface{}, error)

func (*HTTPClient) AuthOAuthConfig

func (c *HTTPClient) AuthOAuthConfig(ctx context.Context) (*OAuthConfigResponse, error)

func (*HTTPClient) AuthOOBLogin

func (c *HTTPClient) AuthOOBLogin(ctx context.Context, configURL, secretsURL string, scopes []string) (*oauth2.Token, error)

func (*HTTPClient) AuthOOBSession

func (c *HTTPClient) AuthOOBSession(ctx context.Context, secretsURL string, scopes []string) error

func (*HTTPClient) AuthProviders

func (c *HTTPClient) AuthProviders(ctx context.Context) ([]AuthProvider, error)

func (*HTTPClient) AuthSessionExchange

func (c *HTTPClient) AuthSessionExchange(ctx context.Context, idToken string) error

func (*HTTPClient) BaseURL added in v0.1.7

func (c *HTTPClient) BaseURL() string

func (*HTTPClient) CancelQueuedTurn

func (c *HTTPClient) CancelQueuedTurn(ctx context.Context, conversationID, turnID string) error

func (*HTTPClient) CancelTurn

func (c *HTTPClient) CancelTurn(ctx context.Context, turnID string) (bool, error)

func (*HTTPClient) CompactConversation

func (c *HTTPClient) CompactConversation(ctx context.Context, conversationID string) error

func (*HTTPClient) CreateConversation

func (c *HTTPClient) CreateConversation(ctx context.Context, input *CreateConversationInput) (*conversation.Conversation, error)

func (*HTTPClient) DecideToolApproval

func (c *HTTPClient) DecideToolApproval(ctx context.Context, input *DecideToolApprovalInput) (*DecideToolApprovalOutput, error)

func (*HTTPClient) DeleteResource

func (c *HTTPClient) DeleteResource(ctx context.Context, input *ResourceRef) error

func (*HTTPClient) DownloadFile

func (c *HTTPClient) DownloadFile(ctx context.Context, input *DownloadFileInput) (*DownloadFileOutput, error)

func (*HTTPClient) EditQueuedTurn

func (c *HTTPClient) EditQueuedTurn(ctx context.Context, input *EditQueuedTurnInput) error

func (*HTTPClient) ExecuteTool

func (c *HTTPClient) ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)

func (*HTTPClient) ExportResources

func (c *HTTPClient) ExportResources(ctx context.Context, input *ExportResourcesInput) (*ExportResourcesOutput, error)

func (*HTTPClient) ForceSteerQueuedTurn

func (c *HTTPClient) ForceSteerQueuedTurn(ctx context.Context, conversationID, turnID string) (*SteerTurnOutput, error)

func (*HTTPClient) GetA2AAgentCard

func (c *HTTPClient) GetA2AAgentCard(ctx context.Context, agentID string) (*a2a.AgentCard, error)

func (*HTTPClient) GetConversation

func (c *HTTPClient) GetConversation(ctx context.Context, id string) (*conversation.Conversation, error)

func (*HTTPClient) GetLiveState added in v0.1.6

func (c *HTTPClient) GetLiveState(ctx context.Context, conversationID string, options ...TranscriptOption) (*ConversationStateResponse, error)

GetLiveState returns the canonical state snapshot with an EventCursor by delegating to GetTranscript. HTTP clients should prefer a dedicated /live-state endpoint when available; this implementation is a safe fallback.

func (*HTTPClient) GetMessages

func (c *HTTPClient) GetMessages(ctx context.Context, input *GetMessagesInput) (*MessagePage, error)

func (*HTTPClient) GetPayloads added in v0.1.6

func (c *HTTPClient) GetPayloads(ctx context.Context, ids []string) (map[string]*conversation.Payload, error)

func (*HTTPClient) GetResource

func (c *HTTPClient) GetResource(ctx context.Context, input *ResourceRef) (*GetResourceOutput, error)

func (*HTTPClient) GetRun

func (c *HTTPClient) GetRun(ctx context.Context, id string) (*agrun.RunRowsView, error)

func (*HTTPClient) GetSchedule

func (c *HTTPClient) GetSchedule(ctx context.Context, id string) (*scheduler.Schedule, error)

func (*HTTPClient) GetTemplate added in v0.1.7

func (c *HTTPClient) GetTemplate(ctx context.Context, input *GetTemplateInput) (*GetTemplateOutput, error)

func (*HTTPClient) GetTranscript

func (c *HTTPClient) GetTranscript(ctx context.Context, input *GetTranscriptInput, options ...TranscriptOption) (*ConversationStateResponse, error)

func (*HTTPClient) GetWorkspaceMetadata

func (c *HTTPClient) GetWorkspaceMetadata(ctx context.Context) (*WorkspaceMetadata, error)

func (*HTTPClient) GetWorkspaceMetadataWithTarget added in v0.1.7

func (c *HTTPClient) GetWorkspaceMetadataWithTarget(ctx context.Context, target *MetadataTargetContext) (*WorkspaceMetadata, error)

func (*HTTPClient) HTTPClient added in v0.1.7

func (c *HTTPClient) HTTPClient() *http.Client

func (*HTTPClient) ImportResources

func (c *HTTPClient) ImportResources(ctx context.Context, input *ImportResourcesInput) (*ImportResourcesOutput, error)

func (*HTTPClient) ListA2AAgents

func (c *HTTPClient) ListA2AAgents(ctx context.Context, agentIDs []string) ([]string, error)

func (*HTTPClient) ListConversations

func (c *HTTPClient) ListConversations(ctx context.Context, input *ListConversationsInput) (*ConversationPage, error)

func (*HTTPClient) ListFiles

func (c *HTTPClient) ListFiles(ctx context.Context, input *ListFilesInput) (*ListFilesOutput, error)

func (*HTTPClient) ListLinkedConversations

func (c *HTTPClient) ListLinkedConversations(ctx context.Context, input *ListLinkedConversationsInput) (*LinkedConversationPage, error)

func (*HTTPClient) ListPendingElicitations

func (c *HTTPClient) ListPendingElicitations(ctx context.Context, input *ListPendingElicitationsInput) ([]*PendingElicitation, error)

func (*HTTPClient) ListPendingToolApprovals

func (c *HTTPClient) ListPendingToolApprovals(ctx context.Context, input *ListPendingToolApprovalsInput) (*PendingToolApprovalPage, error)

func (*HTTPClient) ListResources

func (c *HTTPClient) ListResources(ctx context.Context, input *ListResourcesInput) (*ListResourcesOutput, error)

func (*HTTPClient) ListSchedules

func (c *HTTPClient) ListSchedules(ctx context.Context) ([]*scheduler.Schedule, error)

func (*HTTPClient) ListTemplates added in v0.1.7

func (c *HTTPClient) ListTemplates(ctx context.Context, input *ListTemplatesInput) (*ListTemplatesOutput, error)

func (*HTTPClient) ListToolDefinitions

func (c *HTTPClient) ListToolDefinitions(ctx context.Context) ([]ToolDefinitionInfo, error)

func (*HTTPClient) Mode

func (c *HTTPClient) Mode() Mode

func (*HTTPClient) MoveQueuedTurn

func (c *HTTPClient) MoveQueuedTurn(ctx context.Context, input *MoveQueuedTurnInput) error

func (*HTTPClient) PruneConversation

func (c *HTTPClient) PruneConversation(ctx context.Context, conversationID string) error

func (*HTTPClient) Query

func (*HTTPClient) ResolveElicitation

func (c *HTTPClient) ResolveElicitation(ctx context.Context, input *ResolveElicitationInput) error

func (*HTTPClient) RunScheduleNow

func (c *HTTPClient) RunScheduleNow(ctx context.Context, id string) error

func (*HTTPClient) SaveResource

func (c *HTTPClient) SaveResource(ctx context.Context, input *SaveResourceInput) error

func (*HTTPClient) SendA2AMessage

func (c *HTTPClient) SendA2AMessage(ctx context.Context, agentID string, req *a2a.SendMessageRequest) (*a2a.SendMessageResponse, error)

func (*HTTPClient) SteerTurn

func (c *HTTPClient) SteerTurn(ctx context.Context, input *SteerTurnInput) (*SteerTurnOutput, error)

func (*HTTPClient) StreamEvents

func (c *HTTPClient) StreamEvents(ctx context.Context, input *StreamEventsInput) (streaming.Subscription, error)

func (*HTTPClient) TerminateConversation

func (c *HTTPClient) TerminateConversation(ctx context.Context, conversationID string) error

func (*HTTPClient) UpdateConversation

func (c *HTTPClient) UpdateConversation(ctx context.Context, input *UpdateConversationInput) (*conversation.Conversation, error)

func (*HTTPClient) UploadFile

func (c *HTTPClient) UploadFile(ctx context.Context, input *UploadFileInput) (*UploadFileOutput, error)

func (*HTTPClient) UpsertSchedules

func (c *HTTPClient) UpsertSchedules(ctx context.Context, schedules []*scheduler.Schedule) error

type HTTPOption

type HTTPOption func(*HTTPClient)

func WithAuthToken

func WithAuthToken(token string) HTTPOption

WithAuthToken sets a static Bearer token that is sent with every request.

func WithConversationsPath

func WithConversationsPath(path string) HTTPOption

func WithHTTPClient

func WithHTTPClient(client *http.Client) HTTPOption

func WithQueryPath

func WithQueryPath(path string) HTTPOption

func WithSchedulerPath

func WithSchedulerPath(path string) HTTPOption

func WithSessionDebug added in v0.1.7

func WithSessionDebug(level string, components ...string) HTTPOption

WithSessionDebug enables request-scoped debug logging headers for all requests issued by this HTTP client instance.

func WithTokenProvider

func WithTokenProvider(p TokenProvider) HTTPOption

WithTokenProvider sets a dynamic token provider called before each request.

type HandlerOption

type HandlerOption func(*handlerConfig)

HandlerOption customises the handler created by NewHandler.

func WithA2AHandler

func WithA2AHandler(h *svca2a.Handler) HandlerOption

func WithAuth

func WithAuth(cfg *svcauth.Config, sessions *svcauth.Manager, opts ...svcauth.HandlerOption) HandlerOption

func WithScheduler

func WithScheduler(svc *scheduler.Service, handler *scheduler.Handler, opts *SchedulerOptions) HandlerOption

func WithSchedulerHandler

func WithSchedulerHandler(h *scheduler.Handler) HandlerOption

func WithSpeechHandler

func WithSpeechHandler(h *speech.Handler) HandlerOption

func WithWorkflowHandler

func WithWorkflowHandler(h *workflow.Handler) HandlerOption

type ImportResourcesInput

type ImportResourcesInput = api.ImportResourcesInput

type ImportResourcesOutput

type ImportResourcesOutput = api.ImportResourcesOutput

type LinkedConversationEntry

type LinkedConversationEntry = api.LinkedConversationEntry

type LinkedConversationPage

type LinkedConversationPage = api.LinkedConversationPage

type LinkedConversationState

type LinkedConversationState = api.LinkedConversationState

func SelectLinkedConversationForToolCall

func SelectLinkedConversationForToolCall(turn *TurnState, toolCallID string) *LinkedConversationState

SelectLinkedConversationForToolCall returns the linked conversation associated with a specific tool call, or nil if none exists. This is the single source of truth for tool→child navigation.

func SelectLinkedConversations

func SelectLinkedConversations(turn *TurnState) []*LinkedConversationState

SelectLinkedConversations returns linked child conversations for a turn.

type ListConversationsInput

type ListConversationsInput = api.ListConversationsInput

type ListFilesInput

type ListFilesInput = api.ListFilesInput

type ListFilesOutput

type ListFilesOutput = api.ListFilesOutput

type ListLinkedConversationsInput

type ListLinkedConversationsInput = api.ListLinkedConversationsInput

type ListPendingElicitationsInput

type ListPendingElicitationsInput = api.ListPendingElicitationsInput

type ListPendingToolApprovalsInput

type ListPendingToolApprovalsInput = api.ListPendingToolApprovalsInput

type ListResourcesInput

type ListResourcesInput = api.ListResourcesInput

type ListResourcesOutput

type ListResourcesOutput = api.ListResourcesOutput

type ListTemplatesInput added in v0.1.7

type ListTemplatesInput = api.ListTemplatesInput

type ListTemplatesOutput added in v0.1.7

type ListTemplatesOutput = api.ListTemplatesOutput

type LocalLoginRequest

type LocalLoginRequest struct {
	Name string `json:"name"`
}

type LocalOOBSessionOptions added in v0.1.2

type LocalOOBSessionOptions struct {
	ConfigURL  string
	SecretsURL string
	Scopes     []string
}

type MessagePage

type MessagePage = api.MessagePage

type MetadataTargetContext added in v0.1.7

type MetadataTargetContext struct {
	Platform     string
	FormFactor   string
	Surface      string
	Capabilities []string
}

type Mode

type Mode string
const (
	ModeEmbedded Mode = "embedded"
	ModeHTTP     Mode = "http"
)

type ModelStepState

type ModelStepState = api.ModelStepState

type MoveQueuedTurnInput

type MoveQueuedTurnInput = api.MoveQueuedTurnInput

type OAuthConfigResponse

type OAuthConfigResponse struct {
	ConfigURL string   `json:"configURL"`
	Scopes    []string `json:"scopes,omitempty"`
}

type OOBRequest

type OOBRequest struct {
	SecretsURL string   `json:"secretsURL"`
	Scopes     []string `json:"scopes,omitempty"`
}

type PageInput

type PageInput = api.PageInput

type PendingElicitation

type PendingElicitation = api.PendingElicitation

type PendingToolApproval

type PendingToolApproval = api.PendingToolApproval

type PendingToolApprovalPage added in v0.1.7

type PendingToolApprovalPage = api.PendingToolApprovalPage

type PlanFeedPayload added in v0.1.6

type PlanFeedPayload = api.PlanFeedPayload

type PlanStep added in v0.1.6

type PlanStep = api.PlanStep

type QuerySelector

type QuerySelector = api.QuerySelector

type ResolveElicitationInput

type ResolveElicitationInput = api.ResolveElicitationInput

type Resource

type Resource = api.Resource

type ResourceRef

type ResourceRef = api.ResourceRef

type SaveResourceInput

type SaveResourceInput = api.SaveResourceInput

type SchedulerOptions

type SchedulerOptions struct {
	EnableAPI      bool
	EnableRunNow   bool
	EnableWatchdog bool
}

SchedulerOptions controls scheduler behavior at the SDK level.

type SessionDebugConfig added in v0.1.7

type SessionDebugConfig struct {
	Enabled    bool
	Level      string
	Components []string
}

type StarterTask

type StarterTask = api.StarterTask

type SteerTurnInput

type SteerTurnInput = api.SteerTurnInput

type SteerTurnOutput

type SteerTurnOutput = api.SteerTurnOutput

type StreamEventsInput

type StreamEventsInput = api.StreamEventsInput

type TemplateListItem added in v0.1.7

type TemplateListItem = api.TemplateListItem

type TokenProvider

type TokenProvider func(ctx context.Context) (string, error)

TokenProvider is a function that returns a current auth token. It is called before each request, allowing dynamic token refresh.

type ToolDefinitionInfo

type ToolDefinitionInfo = api.ToolDefinitionInfo

type ToolStepState

type ToolStepState = api.ToolStepState

type TranscriptOption

type TranscriptOption func(*transcriptOptions)

func WithIncludeFeeds

func WithIncludeFeeds() TranscriptOption

func WithTranscriptMessageSelector

func WithTranscriptMessageSelector(selector *QuerySelector) TranscriptOption

func WithTranscriptSelector

func WithTranscriptSelector(name string, selector *QuerySelector) TranscriptOption

func WithTranscriptToolMessageSelector

func WithTranscriptToolMessageSelector(selector *QuerySelector) TranscriptOption

func WithTranscriptTurnSelector

func WithTranscriptTurnSelector(selector *QuerySelector) TranscriptOption

type TurnState

type TurnState = api.TurnState

func SelectRenderTurns

func SelectRenderTurns(state *ConversationState) []*TurnState

SelectRenderTurns returns all turns suitable for rendering. It filters out turns that have no meaningful content to display.

type TurnStatus

type TurnStatus = api.TurnStatus

type UpdateConversationInput

type UpdateConversationInput = api.UpdateConversationInput

type UploadFileInput

type UploadFileInput = api.UploadFileInput

type UploadFileOutput

type UploadFileOutput = api.UploadFileOutput

type UsageSummary added in v0.1.6

type UsageSummary = api.UsageSummary

type UserMessageState

type UserMessageState = api.UserMessageState

type WorkspaceAgentInfo

type WorkspaceAgentInfo = api.WorkspaceAgentInfo

type WorkspaceCapabilities

type WorkspaceCapabilities = api.WorkspaceCapabilities

type WorkspaceDefaults

type WorkspaceDefaults = api.WorkspaceDefaults

type WorkspaceMetadata

type WorkspaceMetadata = api.WorkspaceMetadata

type WorkspaceModelInfo

type WorkspaceModelInfo = api.WorkspaceModelInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL