ai

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 94 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AskUserReasonUserDecisionRequired = "user_decision_required"
	AskUserReasonPermissionBlocked    = "permission_blocked"
	AskUserReasonMissingExternalInput = "missing_external_input"
	AskUserReasonConflictingWork      = "conflicting_constraints"
	AskUserReasonSafetyConfirmation   = "safety_confirmation"
)
View Source
const (
	FlowerCanonicalReferenceInvalidErrorCode     = "FLOWER_REFERENCE_INVALID"
	FlowerCanonicalReferenceNotFoundErrorCode    = "FLOWER_REFERENCE_NOT_FOUND"
	FlowerCanonicalReferenceDeniedErrorCode      = "FLOWER_REFERENCE_DENIED"
	FlowerCanonicalReferenceTypeErrorCode        = "FLOWER_REFERENCE_TYPE_MISMATCH"
	FlowerCanonicalReferenceUnavailableErrorCode = "FLOWER_REFERENCE_UNAVAILABLE"
)
View Source
const (
	DesktopModelSourceProviderType    = "desktop_model_source"
	DesktopModelSourceProtocolVersion = "redeven-desktop-model-source-rpc-v1"
	DesktopModelSourceDefaultSource   = "desktop_local_environment"
)
View Source
const (
	FlowerPermissionReadonly         = permissionsnapshot.PermissionReadonly
	FlowerPermissionApprovalRequired = permissionsnapshot.PermissionApprovalRequired
	FlowerPermissionFullAccess       = permissionsnapshot.PermissionFullAccess
)
View Source
const (
	ToolVisibilityReadonlyExclusive = permissionsnapshot.VisibilityReadonlyExclusive
	ToolVisibilityStandard          = permissionsnapshot.VisibilityStandard
	ToolVisibilitySharedReadonly    = permissionsnapshot.VisibilitySharedReadonly
	ToolVisibilityInteraction       = permissionsnapshot.VisibilityInteraction
	ToolVisibilityControl           = permissionsnapshot.VisibilityControl
	ToolVisibilityDelegationControl = permissionsnapshot.VisibilityDelegationControl
)
View Source
const (
	ToolCapabilityReadonlyLocal   = permissionsnapshot.CapabilityReadonlyLocal
	ToolCapabilityReadonlyNetwork = permissionsnapshot.CapabilityReadonlyNetwork
	ToolCapabilityInteraction     = permissionsnapshot.CapabilityInteraction
	ToolCapabilityMutation        = permissionsnapshot.CapabilityMutation
	ToolCapabilityShell           = permissionsnapshot.CapabilityShell
	ToolCapabilityDelegation      = permissionsnapshot.CapabilityDelegation
	ToolCapabilityOpenWorld       = permissionsnapshot.CapabilityOpenWorld
)
View Source
const (
	ApprovalDecisionAllow = permissionsnapshot.ApprovalAllow
	ApprovalDecisionAsk   = permissionsnapshot.ApprovalAsk
	ApprovalDecisionDeny  = permissionsnapshot.ApprovalDeny
)
View Source
const (
	// Type IDs must stay in sync with
	// internal/envapp/ui_src/src/ui/protocol/redeven_v1/typeIds.ts.
	TypeID_AI_SEND_USER_TURN                     uint32 = 6001
	TypeID_AI_EVENT_NOTIFY                       uint32 = 6004 // notify (agent -> client)
	TypeID_AI_MESSAGES_LIST                      uint32 = 6006
	TypeID_AI_STOP_THREAD                        uint32 = 6011
	TypeID_AI_SUBMIT_REQUEST_USER_INPUT_RESPONSE uint32 = 6012
)
View Source
const (
	ErrCodeAISkillsInvalidScope      = "AI_SKILLS_INVALID_SCOPE"
	ErrCodeAISkillsInvalidSource     = "AI_SKILLS_INVALID_SOURCE"
	ErrCodeAISkillsInvalidPath       = "AI_SKILLS_INVALID_PATH"
	ErrCodeAISkillsPathEscape        = "AI_SKILLS_PATH_ESCAPE"
	ErrCodeAISkillsSkillExists       = "AI_SKILLS_SKILL_EXISTS"
	ErrCodeAISkillsSkillNotFound     = "AI_SKILLS_SKILL_NOT_FOUND"
	ErrCodeAISkillsFrontmatterBad    = "AI_SKILLS_FRONTMATTER_INVALID"
	ErrCodeAISkillsGitHubFetchFailed = "AI_SKILLS_GITHUB_FETCH_FAILED"
	ErrCodeAISkillsGitFallbackFailed = "AI_SKILLS_GIT_FALLBACK_FAILED"
	ErrCodeAISkillsArchiveInvalid    = "AI_SKILLS_ARCHIVE_INVALID"
	ErrCodeAISkillsBrowseForbidden   = "AI_SKILLS_BROWSE_FORBIDDEN"
	ErrCodeAISkillsFileTooLarge      = "AI_SKILLS_FILE_TOO_LARGE"
	ErrCodeAISkillsInternal          = "AI_SKILLS_INTERNAL_ERROR"
)
View Source
const (
	ToolTargetModeLocalRuntime   = "local_runtime"
	ToolTargetModeExplicitTarget = "explicit_target"
)
View Source
const (
	TodoStatusPending    = "pending"
	TodoStatusInProgress = "in_progress"
	TodoStatusCompleted  = "completed"
)
View Source
const (
	UploadErrorInvalidRequest       = "upload_invalid_request"
	UploadErrorTooLarge             = "attachment_too_large"
	UploadErrorInvalidTextEncoding  = "attachment_invalid_text_encoding"
	UploadErrorUnsupportedMediaType = "attachment_unsupported_media_type"
	UploadErrorIdempotencyConflict  = "upload_idempotency_conflict"
	UploadErrorInProgress           = "upload_in_progress"
	UploadErrorIntegrityMismatch    = "attachment_integrity_mismatch"
	UploadErrorQuotaExceeded        = "attachment_quota_exceeded"
	UploadErrorNotFound             = "attachment_not_found"
	UploadErrorStoreUnavailable     = "attachment_store_unavailable"
)
View Source
const ApprovalConflictErrorCode = "AI_APPROVAL_CONFLICT"
View Source
const ContextActionSchemaVersion = 2
View Source
const FlowerLiveSchemaVersion int64 = 1
View Source
const (
	LongTextAttachmentRequiredErrorCode = "long_text_attachment_required"
)

Variables

View Source
var (
	ErrFlowerFileActionInvalid  = errors.New("flower file action is invalid")
	ErrFlowerFileActionNotFound = errors.New("flower file action was not found")
)
View Source
var (
	ErrFlowerCanonicalReferenceInvalid     = errors.New("flower reference request is invalid")
	ErrFlowerCanonicalReferenceNotFound    = errors.New("flower reference was not found")
	ErrFlowerCanonicalReferenceDenied      = errors.New("flower reference access denied")
	ErrFlowerCanonicalReferenceType        = errors.New("flower reference type does not match the resource")
	ErrFlowerCanonicalReferenceUnavailable = errors.New("flower reference is unavailable")
)
View Source
var (
	ErrCanonicalRootNotOrphaned      = errors.New("canonical Floret root is not orphaned")
	ErrCanonicalRootIdentityConflict = errors.New("canonical Floret root identity conflicts with product settings")
)
View Source
var (
	ErrNotConfigured         = errors.New("ai not configured")
	ErrRunActive             = errors.New("run already active")
	ErrThreadBusy            = errors.New("thread already active")
	ErrThreadForkUnavailable = errors.New("thread cannot be forked while active or waiting")
	ErrUserTurnNotAdmitted   = errors.New("user turn was not admitted by Floret")
)
View Source
var ErrApprovalConflict = errors.New("approval state changed")
View Source
var ErrFlowerGenerationClose = errors.New("failed to close the Flower generation")

ErrFlowerGenerationClose prevents another generation from opening storage whose previous owner could not be conclusively closed.

View Source
var ErrFlowerLiveTooManySubscribers = errors.New("too many Flower live observers")
View Source
var ErrFlowerStorageRestored = errors.New("data was restored; submit the preserved input as a new task")

ErrFlowerStorageRestored rejects transport retries from an older data set. The caller keeps its input and creates a new request after user confirmation.

View Source
var ErrInitialTurnStateConflict = errors.New("initial turn frozen state conflicts with canonical creation")
View Source
var ErrInteractionTakeoverRequired = errors.New("interaction takeover required")
View Source
var ErrInvalidContextAction = errors.New("invalid context action")
View Source
var ErrLongTextAttachmentRequired = threadstore.ErrLongTextAttachmentRequired
View Source
var ErrReadOnlyThread = errors.New("thread is read only")
View Source
var ErrRunChanged = errors.New("run changed")
View Source
var ErrRunExecutionClosed = errors.New("run execution is closed")
View Source
var ErrThreadContinuationRetryUnavailable = errors.New("thread continuation retry unavailable")
View Source
var ErrThreadModelConflict = errors.New("turn model conflicts with persisted thread model")
View Source
var ErrTurnIdempotencyConflict = errors.New("turn id conflicts with a different frozen command")
View Source
var ErrWaitingPromptChanged = errors.New("waiting prompt changed")
View Source
var ErrWaitingUserQueueConflict = errors.New("waiting-user queue request conflicts with waiting response")

Functions

func BrowserErrorCode added in v0.13.0

func BrowserErrorCode(err error) string

BrowserErrorCode is the single safe mapping for product recovery actions. Raw debugger errors can contain page content, credentials or private endpoints.

func CheckFlowerSnapshot added in v0.13.0

func CheckFlowerSnapshot(ctx context.Context, state, id string) error

CheckFlowerSnapshot validates immutable backup bytes without opening any live store. The controller checks before draining and restore checks again.

func ComputerControlErrorCode added in v0.13.0

func ComputerControlErrorCode(err error) string

ComputerControlErrorCode exposes only a closed, non-secret UI classification.

func ComputerControlErrorDetails added in v0.13.0

func ComputerControlErrorDetails(err error) map[string]any

ComputerControlErrorDetails carries only the latest host-observed blocking reason. It cannot authorize input or replace the canonical pending question.

func ComputerSelectionErrorCode added in v0.13.0

func ComputerSelectionErrorCode(err error) string

ComputerSelectionErrorCode retains actionable selection failures without reflecting page contents, endpoints or arbitrary adapter exceptions.

func IsActiveRunState

func IsActiveRunState(raw string) bool

func MarshalFlowerCurrentView added in v0.11.0

func MarshalFlowerCurrentView(current flruntime.ThreadView) (json.RawMessage, error)

MarshalFlowerCurrentView is the appserver handoff for detail envelopes that cannot embed FlowerThreadDetail directly. It keeps the same projection rule as every typed response and live frame.

func NewRunID

func NewRunID() (string, error)

NewRunID generates a cryptographically random run id.

func RegisterRPCServiceProviderWithAccessGate added in v0.11.0

func RegisterRPCServiceProviderWithAccessGate(r *sessionrpc.Router, meta *session.Meta, streamServer flowersec.RPCPeer, gate *accessgate.Gate, acquire RPCServiceAcquire) func()

func RestoreFlowerSnapshot added in v0.13.0

func RestoreFlowerSnapshot(ctx context.Context, opts Options, id string) (err error)

RestoreFlowerSnapshot requires the controller to drain and close its current generation first. The administrator confirms the exact snapshot in the UI.

func RunDesktopModelSourceConnector added in v0.6.8

func RunDesktopModelSourceConnector(ctx context.Context, opts DesktopModelSourceConnectorOptions) error

func SanitizeActivityTimelineBlockJSON added in v0.7.1

func SanitizeActivityTimelineBlockJSON(raw json.RawMessage) (json.RawMessage, error)

func SanitizeActivityTimelineBlockValue added in v0.7.1

func SanitizeActivityTimelineBlockValue(value any) (any, error)

func SanitizeActivityTimelineMessageJSON added in v0.7.1

func SanitizeActivityTimelineMessageJSON(raw string) (json.RawMessage, error)

func SkillErrorCode

func SkillErrorCode(err error) string

func SkillErrorStatus

func SkillErrorStatus(err error) int

func StripTargetToolArgs added in v0.7.1

func StripTargetToolArgs(args map[string]any) map[string]any

Types

type AIRuntimeStatus added in v0.6.4

type AIRuntimeStatus struct {
	RemoteConfigured   bool                      `json:"remote_configured"`
	DesktopModelSource *DesktopModelSourceStatus `json:"desktop_model_source,omitempty"`
}

type ActiveThreadRun

type ActiveThreadRun struct {
	ThreadID string `json:"thread_id"`
	RunID    string `json:"run_id"`
}

ActiveThreadRun is returned in subscribe snapshots so late subscribers can discover currently running threads before live events arrive.

type ActivityTimelineBlock added in v0.6.10

type ActivityTimelineBlock struct {
	Type        string                              `json:"type"`
	FileActions map[string]FlowerActivityFileAction `json:"file_actions,omitempty"`
	observation.ActivityTimeline
}

type AdoptOrphanCanonicalRootRequest added in v0.11.0

type AdoptOrphanCanonicalRootRequest struct {
	ThreadID          string
	EndpointID        string
	NamespacePublicID string
	ModelID           string
	PermissionType    string
	WorkingDir        string
	OperatorPublicID  string
	OperatorEmail     string
}

type ApplyPatchResult added in v0.7.1

type ApplyPatchResult struct {
	FilesChanged     int                  `json:"files_changed"`
	Hunks            int                  `json:"hunks"`
	Additions        int                  `json:"additions"`
	Deletions        int                  `json:"deletions"`
	InputFormat      string               `json:"input_format"`
	NormalizedFormat string               `json:"normalized_format"`
	Files            []patchFileSummary   `json:"files"`
	Mutations        []FileMutationResult `json:"mutations"`
}

type ApprovalDecisionKind added in v0.7.2

type ApprovalDecisionKind = permissionsnapshot.ApprovalDecision

type AttachmentCapabilities added in v0.11.0

type AttachmentCapabilities struct {
	Revision         string                          `json:"revision"`
	ModelID          string                          `json:"model_id"`
	Enabled          bool                            `json:"enabled"`
	MaxCount         int                             `json:"max_count"`
	MaxItemBytes     int64                           `json:"max_item_bytes"`
	MaxTurnBytes     int64                           `json:"max_turn_bytes"`
	MediaTypes       []AttachmentMediaTypeCapability `json:"media_types"`
	SupportsLongText bool                            `json:"supports_long_text"`
}

type AttachmentMediaTypeCapability added in v0.11.0

type AttachmentMediaTypeCapability struct {
	MediaType string `json:"media_type"`
	Mode      string `json:"mode"`
}

type BrowserServiceStatus added in v0.13.0

type BrowserServiceStatus struct {
	State      string `json:"state"`
	Generation string `json:"generation"`
}

type CanonicalAttachmentMembership added in v0.11.0

type CanonicalAttachmentMembership struct {
	ThreadID          string
	TurnID            string
	AttachmentID      string
	ResourceRef       string
	ContentSHA256     string
	Name              string
	DetectedMediaType string
	SizeBytes         int64
}

type ComputerAccess added in v0.13.0

type ComputerAccess = threadstore.ComputerAccess

type ComputerBrowserConnection added in v0.13.0

type ComputerBrowserConnection struct {
	ManagedProfileID   string `json:"managed_profile_id,omitempty"`
	ExtensionProfileID string `json:"extension_profile_id,omitempty"`
	NewTab             bool   `json:"new_tab,omitempty"`
	CDPURL             string `json:"cdp_url"`
	TabID              string `json:"tab_id"`
	TabTitle           string `json:"tab_title,omitempty"`
	TabURL             string `json:"tab_url,omitempty"`
	ProfileID          string `json:"profile_id"`
	// contains filtered or unexported fields
}

type ComputerBrowserInstallRequest added in v0.13.0

type ComputerBrowserInstallRequest struct {
	Action      string `json:"action"`
	PackageID   string `json:"package_id,omitempty"`
	Source      string `json:"source,omitempty"`
	OperationID string `json:"operation_id,omitempty"`
	Offset      int64  `json:"offset,omitempty"`
	Data        string `json:"data,omitempty"`
}

type ComputerBrowserTab added in v0.13.0

type ComputerBrowserTab struct {
	Availability          string   `json:"availability,omitempty"`
	Pinned                bool     `json:"pinned,omitempty"`
	Loading               bool     `json:"loading,omitempty"`
	Discarded             bool     `json:"discarded,omitempty"`
	Frozen                bool     `json:"frozen,omitempty"`
	WindowID              int      `json:"window_id,omitempty"`
	Index                 int      `json:"index,omitempty"`
	NativeTargetID        string   `json:"native_target_id,omitempty"`
	OpenerNativeTargetIDs []string `json:"opener_native_target_ids,omitempty"`
	Private               bool     `json:"private,omitempty"`
	OpenerTabIDs          []string `json:"opener_tab_ids,omitempty"`
	OpenerTabID           string   `json:"opener_tab_id,omitempty"`
	ID                    string   `json:"id"`
	ProfileID             string   `json:"profile_id"`
	Title                 string   `json:"title"`
	URL                   string   `json:"url"`
}

type ComputerCandidate added in v0.13.0

type ComputerCandidate struct {
	CandidateRef string `json:"candidate_ref"`
	TargetID     string `json:"target_id,omitempty"`
	Kind         string `json:"kind"`
	DisplayName  string `json:"display_name"`
	ProfileName  string `json:"profile_name,omitempty"`
	Title        string `json:"title,omitempty"`
	URL          string `json:"url,omitempty"`
	AppBundleID  string `json:"app_bundle_id,omitempty"`
	OpenerTabID  string `json:"opener_tab_id,omitempty"`
	State        string `json:"state"`
	NewTab       bool   `json:"new_tab,omitempty"`
}

Candidates are short-lived discovery facts, not grants or a second selection store. Only the Runtime can turn their opaque references into connections.

type ComputerCapability added in v0.13.0

type ComputerCapability struct {
	State  string `json:"state"`
	Reason string `json:"reason,omitempty"`
}

Environment capability is a current, read-only observation. It never grants access, creates a browser page, or starts a private desktop.

type ComputerEnvironment added in v0.13.0

type ComputerEnvironment struct {
	BrowserService BrowserServiceStatus    `json:"browser_service"`
	Hostname       string                  `json:"hostname"`
	Platform       string                  `json:"platform"`
	Managed        ComputerCapability      `json:"managed"`
	Desktop        ComputerCapability      `json:"desktop"`
	Chrome         ComputerExtensionStatus `json:"chrome"`
}

type ComputerExtensionDiagnostic added in v0.13.0

type ComputerExtensionDiagnostic = browserbridge.Diagnostic

Only these product facts cross the UI boundary. Platform errors stay in logs.

func ComputerExtensionDiagnosticForError added in v0.13.0

func ComputerExtensionDiagnosticForError(err error, stage string) ComputerExtensionDiagnostic

ComputerExtensionDiagnosticForError keeps native causes out of API responses.

type ComputerExtensionProfile added in v0.13.0

type ComputerExtensionProfile struct {
	InstallationID string `json:"installation_id"`
	LibraryID      string `json:"library_id"`
	ID             string `json:"id"`
	Name           string `json:"name"`
}

type ComputerExtensionSetup added in v0.13.0

type ComputerExtensionSetup struct {
	InstallationID    string   `json:"installation_id"`
	BrowserName       string   `json:"browser_name"`
	NativeHost        string   `json:"native_host"`
	ExtensionID       string   `json:"extension_id"`
	ExtensionPath     string   `json:"extension_path"`
	ExtensionHomePath []string `json:"extension_home_path"`
	Platform          string   `json:"platform"`
}

type ComputerExtensionStatus added in v0.13.0

type ComputerExtensionStatus struct {
	Installations    []browserbridge.Installation `json:"installations"`
	RuntimeVersion   string                       `json:"runtime_version,omitempty"`
	Hostname         string                       `json:"hostname,omitempty"`
	Platform         string                       `json:"platform,omitempty"`
	BrowserInstalled *bool                        `json:"browser_installed,omitempty"`
	Diagnostic       *ComputerExtensionDiagnostic `json:"diagnostic,omitempty"`
	Profiles         []ComputerExtensionProfile   `json:"profiles"`
	Prepared         bool                         `json:"prepared,omitempty"`
	Error            string                       `json:"error,omitempty"`
}

type ComputerManagedProfile added in v0.13.0

type ComputerManagedProfile struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type ComputerPrivateFrameRequest added in v0.13.0

type ComputerPrivateFrameRequest struct {
	ObserverID     string `json:"observer_id"`
	ViewerRevision uint64 `json:"viewer_revision"`
	ThreadID       string `json:"thread_id"`
	InteractionID  string `json:"interaction_id"`
	FrameID        string `json:"frame_id"`
}

Private frame IDs are meaningful only inside the exact active viewer.

type ComputerTargetBindingStore added in v0.13.0

type ComputerTargetBindingStore interface {
	GetComputerTarget(context.Context, string) (string, error)
	SetComputerTarget(context.Context, string, string) error
}

ComputerTargetBindingStore persists product target selection, never thread lifecycle or control authority. The Service installs its migrated product store before accepting turns. There is no process-local shadow binding.

type ComputerTargetInventory added in v0.13.0

type ComputerTargetInventory struct {
	BrowserSource       string              `json:"browser_source"`
	ConnectionRequired  bool                `json:"connection_required,omitempty"`
	CurrentTargetID     string              `json:"current_target_id"`
	DefaultCandidateRef string              `json:"default_candidate_ref,omitempty"`
	Candidates          []ComputerCandidate `json:"candidates"`
}

type ComputerUseRuntime added in v0.13.0

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

ComputerUseRuntime owns the adapters and the only target readiness path. Resolving identity is read-only. Preparation happens after target policy has authorized the action, and only a successful adapter handshake grants ready.

func NewComputerUseRuntime added in v0.13.0

func NewComputerUseRuntime(registry *TargetRegistry, executors map[string]TargetToolExecutor, mediaDirectory string) *ComputerUseRuntime

func (*ComputerUseRuntime) BindThreadTarget added in v0.13.0

func (r *ComputerUseRuntime) BindThreadTarget(ctx context.Context, threadID, targetID string) error

BindThreadTarget runs after policy, readiness and safety checks, before an effect. Storage failure must not discard the result of an already executed action or invite its replay. A failed effect retains the selected target.

func (*ComputerUseRuntime) BrowserExtensionSetup added in v0.13.0

func (r *ComputerUseRuntime) BrowserExtensionSetup(ctx context.Context, meta *session.Meta, installation string) (ComputerExtensionSetup, error)

Browser source setup and status do not require an AI provider or service.

func (*ComputerUseRuntime) BrowserExtensionStatus added in v0.13.0

func (r *ComputerUseRuntime) BrowserExtensionStatus(meta *session.Meta) (ComputerExtensionStatus, error)

func (*ComputerUseRuntime) BrowserTabs added in v0.13.0

func (r *ComputerUseRuntime) BrowserTabs(ctx context.Context, endpoint string) ([]ComputerBrowserTab, error)

func (*ComputerUseRuntime) Close added in v0.13.0

func (r *ComputerUseRuntime) Close() error

func (*ComputerUseRuntime) ComputerBrowserInstallation added in v0.13.0

func (r *ComputerUseRuntime) ComputerBrowserInstallation(_ context.Context, meta *session.Meta) (browserinstall.Status, error)

func (*ComputerUseRuntime) ComputerEnvironment added in v0.13.0

func (r *ComputerUseRuntime) ComputerEnvironment(ctx context.Context) (ComputerEnvironment, error)

func (*ComputerUseRuntime) ComputerTargets added in v0.13.0

func (*ComputerUseRuntime) ConfigureManagedBrowser added in v0.13.0

func (r *ComputerUseRuntime) ConfigureManagedBrowser(stateDirectory string)

ConfigureManagedBrowser is called once by the product runtime before serving. Helpers remain immutable; downloaded browsers and preferences live in state.

func (*ComputerUseRuntime) ConnectBrowser added in v0.13.0

func (r *ComputerUseRuntime) ConnectBrowser(ctx context.Context, connection ComputerBrowserConnection) (TargetDescriptor, error)

ConnectBrowser registers an explicitly authorized Chrome CDP session. A running system browser is never treated as connected implicitly; callers must provide the bridge endpoint returned by the user-facing connect flow.

func (*ComputerUseRuntime) ExecuteTargetTool added in v0.13.0

func (r *ComputerUseRuntime) ExecuteTargetTool(ctx context.Context, call TargetToolCall) (TargetToolResult, error)

func (*ComputerUseRuntime) InstallComputerBrowser added in v0.13.0

func (r *ComputerUseRuntime) InstallComputerBrowser(_ context.Context, meta *session.Meta, request ComputerBrowserInstallRequest) (browserinstall.Status, error)

func (*ComputerUseRuntime) ListComputerTargets added in v0.13.0

func (r *ComputerUseRuntime) ListComputerTargets(ctx context.Context) ([]TargetDescriptor, error)

Discovery describes local resources. Only the Runtime registers their opaque identities; a model cannot construct a window or tab binding.

func (*ComputerUseRuntime) ManagedBrowserProfiles added in v0.13.0

func (host *ComputerUseRuntime) ManagedBrowserProfiles(ctx context.Context, meta *session.Meta, name string) ([]ComputerManagedProfile, error)

func (*ComputerUseRuntime) ManagedBrowserTabs added in v0.13.0

func (host *ComputerUseRuntime) ManagedBrowserTabs(ctx context.Context, meta *session.Meta, profileID string) ([]ComputerBrowserTab, error)

func (*ComputerUseRuntime) OpenBrowserExtension added in v0.13.0

func (host *ComputerUseRuntime) OpenBrowserExtension(ctx context.Context, meta *session.Meta, action, installationID string) error

func (*ComputerUseRuntime) PrepareTarget added in v0.13.0

func (r *ComputerUseRuntime) PrepareTarget(ctx context.Context, target TargetDescriptor) (TargetDescriptor, error)

func (*ComputerUseRuntime) RecoverBrowser added in v0.13.0

func (r *ComputerUseRuntime) RecoverBrowser(ctx context.Context, meta *session.Meta, generation string) (BrowserServiceStatus, error)

An accepted recovery belongs to Runtime, not the HTTP request. Concurrent or delayed requests for the same generation observe the same bounded operation.

func (*ComputerUseRuntime) ReobserveComputerTarget added in v0.13.0

func (r *ComputerUseRuntime) ReobserveComputerTarget(ctx context.Context, call TargetToolCall) error

func (*ComputerUseRuntime) ResolveComputerLiveFrame added in v0.13.0

func (r *ComputerUseRuntime) ResolveComputerLiveFrame(ctx context.Context, threadID, targetID, ref string) ([]byte, error)

Public media lookup never resolves private viewing frames.

func (*ComputerUseRuntime) ResolveTarget added in v0.13.0

func (r *ComputerUseRuntime) ResolveTarget(ctx context.Context, alias string) (TargetDescriptor, error)

func (*ComputerUseRuntime) ResolveTargetForThread added in v0.13.0

func (r *ComputerUseRuntime) ResolveTargetForThread(ctx context.Context, threadID, alias string) (TargetDescriptor, error)

func (*ComputerUseRuntime) ResolveTargetToolAttachment added in v0.13.0

func (r *ComputerUseRuntime) ResolveTargetToolAttachment(ctx context.Context, ref string) ([]byte, error)

func (*ComputerUseRuntime) SelectComputerCandidate added in v0.13.0

func (r *ComputerUseRuntime) SelectComputerCandidate(ctx context.Context, call TargetToolCall, ref string, policy ToolTargetPolicy) (TargetDescriptor, error)

func (*ComputerUseRuntime) SetComputerBrowserEnabled added in v0.13.0

func (r *ComputerUseRuntime) SetComputerBrowserEnabled(_ context.Context, meta *session.Meta, enabled bool) (browserinstall.Status, error)

type ComputerUserInput added in v0.13.0

type ComputerUserInput struct {
	ObserverID     string  `json:"observer_id"`
	ViewerRevision uint64  `json:"viewer_revision"`
	ThreadID       string  `json:"thread_id"`
	InteractionID  string  `json:"interaction_id"`
	Action         string  `json:"action"`
	X              float64 `json:"x,omitempty"`
	Y              float64 `json:"y,omitempty"`
	Text           string  `json:"text,omitempty"`
	Key            string  `json:"key,omitempty"`
	DeltaX         float64 `json:"delta_x,omitempty"`
	DeltaY         float64 `json:"delta_y,omitempty"`
}

ComputerUserInput is an authenticated host command, never a model tool. Text is forwarded once to the target and must not be logged or persisted.

type ComputerViewerRequest added in v0.13.0

type ComputerViewerRequest struct {
	FPS           int    `json:"fps,omitempty"`
	InteractionID string `json:"interaction_id,omitempty"`
	ObserverID    string `json:"observer_id"`
	Revision      uint64 `json:"revision"`
	ThreadID      string `json:"thread_id,omitempty"`
	TargetID      string `json:"target_id,omitempty"`
	ResourceRef   string `json:"resource_ref,omitempty"`
}

ComputerViewerRequest selects ephemeral media on an existing workspace observer. A blank ThreadID closes viewing; it never cancels a model turn.

type ContentPart

type ContentPart struct {
	Type       string `json:"type"`
	Text       string `json:"text,omitempty"`
	FileURI    string `json:"file_uri,omitempty"`
	MimeType   string `json:"mime_type,omitempty"`
	ToolCallID string `json:"tool_call_id,omitempty"`
	ToolUseID  string `json:"tool_use_id,omitempty"`
	ToolName   string `json:"tool_name,omitempty"`
	ArgsJSON   string `json:"args_json,omitempty"`
	JSON       []byte `json:"json,omitempty"`
}

type ContextActionContextItem added in v0.7.1

type ContextActionContextItem struct {
	Kind           string  `json:"kind"`
	Path           string  `json:"path,omitempty"`
	IsDirectory    bool    `json:"is_directory,omitempty"`
	RootLabel      string  `json:"root_label,omitempty"`
	Selection      string  `json:"selection,omitempty"`
	SelectionChars int     `json:"selection_chars,omitempty"`
	WorkingDir     string  `json:"working_dir,omitempty"`
	PID            int     `json:"pid,omitempty"`
	Name           string  `json:"name,omitempty"`
	Username       string  `json:"username,omitempty"`
	CPUPercent     float64 `json:"cpu_percent,omitempty"`
	MemoryBytes    int64   `json:"memory_bytes,omitempty"`
	Platform       string  `json:"platform,omitempty"`
	CapturedAtMs   int64   `json:"captured_at_ms,omitempty"`
	Title          string  `json:"title,omitempty"`
	Detail         string  `json:"detail,omitempty"`
	Content        string  `json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (ContextActionContextItem) MarshalJSON added in v0.7.2

func (item ContextActionContextItem) MarshalJSON() ([]byte, error)

func (*ContextActionContextItem) UnmarshalJSON added in v0.11.0

func (item *ContextActionContextItem) UnmarshalJSON(data []byte) error

type ContextActionEnvelope added in v0.7.1

type ContextActionEnvelope struct {
	SchemaVersion       int                         `json:"schema_version"`
	ActionID            string                      `json:"action_id"`
	Provider            string                      `json:"provider,omitempty"`
	Target              ContextActionTarget         `json:"target"`
	Source              ContextActionSource         `json:"source"`
	ExecutionContext    *ContextActionExecutionHint `json:"execution_context,omitempty"`
	Context             []ContextActionContextItem  `json:"context"`
	Presentation        ContextActionPresentation   `json:"presentation"`
	SuggestedWorkingDir string                      `json:"suggested_working_dir_abs,omitempty"`
	// contains filtered or unexported fields
}

func (*ContextActionEnvelope) UnmarshalJSON added in v0.11.0

func (envelope *ContextActionEnvelope) UnmarshalJSON(data []byte) error

type ContextActionExecutionHint added in v0.7.1

type ContextActionExecutionHint struct {
	CurrentTargetID   string `json:"current_target_id,omitempty"`
	SourceEnvPublicID string `json:"source_env_public_id,omitempty"`
	RuntimeHint       string `json:"runtime_hint,omitempty"`
	SessionSource     string `json:"session_source,omitempty"`
}

type ContextActionPresentation added in v0.7.1

type ContextActionPresentation struct {
	Label          string `json:"label"`
	Priority       int    `json:"priority"`
	StatusLabel    string `json:"status_label,omitempty"`
	DisabledReason string `json:"disabled_reason,omitempty"`
}

type ContextActionSource added in v0.7.1

type ContextActionSource struct {
	Surface   string `json:"surface"`
	SurfaceID string `json:"surface_id,omitempty"`
}

type ContextActionTarget added in v0.7.1

type ContextActionTarget struct {
	TargetID string `json:"target_id"`
	Locality string `json:"locality"`
}

type CreateThreadRequest

type CreateThreadRequest struct {
	ClientRequestID    string                      `json:"client_request_id"`
	Title              string                      `json:"title"`
	ModelID            string                      `json:"model_id,omitempty"`
	PermissionType     string                      `json:"permission_type,omitempty"`
	WorkingDir         string                      `json:"working_dir,omitempty"`
	ReasoningSelection config.AIReasoningSelection `json:"reasoning_selection,omitempty"`
}

type CreateThreadResponse

type CreateThreadResponse struct {
	ClientRequestID string     `json:"client_request_id"`
	Thread          ThreadView `json:"thread"`
}

type DefaultPermissionToolFilter added in v0.7.2

type DefaultPermissionToolFilter struct{}

func (DefaultPermissionToolFilter) FilterTools added in v0.7.2

func (f DefaultPermissionToolFilter) FilterTools(permissionType FlowerPermissionType, all []ToolDef) []ToolDef

type DeleteOrphanCanonicalRootRequest added in v0.11.0

type DeleteOrphanCanonicalRootRequest struct {
	ThreadID         string
	OperatorPublicID string
}

type DesktopModelSourceConnectorOptions added in v0.6.8

type DesktopModelSourceConnectorOptions struct {
	Logger                *slog.Logger
	ConfigPath            string
	SecretsPath           string
	RuntimeControlBaseURL string
	RuntimeControlToken   string
	SessionID             string
	Source                string
	ExpiresAtUnixMS       int64
	StartupReportFile     string
	HTTPClient            *http.Client
}

type DesktopModelSourceModel added in v0.6.8

type DesktopModelSourceModel struct {
	ID                            string                        `json:"id"`
	Label                         string                        `json:"label,omitempty"`
	Provider                      string                        `json:"provider,omitempty"`
	ContextWindow                 int                           `json:"context_window,omitempty"`
	MaxOutputTokens               int                           `json:"max_output_tokens,omitempty"`
	EffectiveContextWindowPercent int                           `json:"effective_context_window_percent,omitempty"`
	InputModalities               []string                      `json:"input_modalities,omitempty"`
	SupportsImageInput            bool                          `json:"supports_image_input,omitempty"`
	ReasoningCapability           config.AIReasoningCapability  `json:"reasoning_capability,omitempty"`
	Capability                    *contextmodel.ModelCapability `json:"capability,omitempty"`
}

type DesktopModelSourceModelSnapshot added in v0.6.8

type DesktopModelSourceModelSnapshot struct {
	Configured            bool                      `json:"configured"`
	CurrentModel          string                    `json:"current_model"`
	Models                []DesktopModelSourceModel `json:"models"`
	MissingKeyProviderIDs []string                  `json:"missing_key_provider_ids,omitempty"`
}

type DesktopModelSourceRPCError added in v0.6.8

type DesktopModelSourceRPCError struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func (*DesktopModelSourceRPCError) Error added in v0.6.8

type DesktopModelSourceRPCFrame added in v0.6.8

type DesktopModelSourceRPCFrame struct {
	ProtocolVersion string                      `json:"protocol_version,omitempty"`
	ID              string                      `json:"id,omitempty"`
	Type            string                      `json:"type"`
	Method          string                      `json:"method,omitempty"`
	Params          json.RawMessage             `json:"params,omitempty"`
	Event           *StreamEvent                `json:"event,omitempty"`
	Result          json.RawMessage             `json:"result,omitempty"`
	Error           *DesktopModelSourceRPCError `json:"error,omitempty"`
}

type DesktopModelSourceSession added in v0.6.8

type DesktopModelSourceSession struct {
	SessionID       string
	Source          string
	ProtocolVersion string
	ExpiresAtUnixMS int64
}

type DesktopModelSourceStartupReport added in v0.6.8

type DesktopModelSourceStartupReport struct {
	Status                string   `json:"status"`
	SessionID             string   `json:"session_id"`
	PID                   int      `json:"pid"`
	Configured            bool     `json:"configured"`
	ModelCount            int      `json:"model_count"`
	MissingKeyProviderIDs []string `json:"missing_key_provider_ids,omitempty"`
}

type DesktopModelSourceStatus added in v0.6.8

type DesktopModelSourceStatus struct {
	BindingState          string   `json:"binding_state,omitempty"`
	Connected             bool     `json:"connected"`
	Configured            bool     `json:"configured"`
	Available             bool     `json:"available"`
	ModelSource           string   `json:"model_source,omitempty"`
	SessionID             string   `json:"session_id,omitempty"`
	ExpiresAtUnixMS       int64    `json:"expires_at_unix_ms,omitempty"`
	ConnectedAtUnixMS     int64    `json:"connected_at_unix_ms,omitempty"`
	ModelCount            int      `json:"model_count"`
	MissingKeyProviderIDs []string `json:"missing_key_provider_ids,omitempty"`
	LastError             string   `json:"last_error,omitempty"`
}

type ExtensionIcon added in v0.13.0

type ExtensionIcon struct {
	Source string `json:"src"`
	Theme  string `json:"theme,omitempty"`
}

ExtensionIcon is catalog-only presentation. It never enters model context or tool identity, and carries self-contained image data rather than host paths.

type FileEditArgs

type FileEditArgs struct {
	FilePath   string `json:"file_path"`
	OldString  string `json:"old_string"`
	NewString  string `json:"new_string"`
	ReplaceAll bool   `json:"replace_all,omitempty"`
}

type FileMutationResult

type FileMutationResult struct {
	FilePath              string `json:"file_path"`
	DisplayName           string `json:"display_name"`
	OldPath               string `json:"old_path,omitempty"`
	NewPath               string `json:"new_path,omitempty"`
	ChangeType            string `json:"change_type"`
	Additions             int    `json:"additions,omitempty"`
	Deletions             int    `json:"deletions,omitempty"`
	UnifiedDiff           string `json:"unified_diff,omitempty"`
	DiffUnavailableReason string `json:"diff_unavailable_reason,omitempty"`
	Truncated             bool   `json:"truncated,omitempty"`
}

type FileReadArgs

type FileReadArgs struct {
	FilePath string `json:"file_path"`
	Offset   int    `json:"offset,omitempty"`
	Limit    int    `json:"limit,omitempty"`
}

type FileReadResult

type FileReadResult struct {
	FilePath    string `json:"file_path"`
	DisplayName string `json:"display_name"`
	Content     string `json:"content"`
	LineOffset  int    `json:"line_offset,omitempty"`
	LineCount   int    `json:"line_count,omitempty"`
	TotalLines  int    `json:"total_lines,omitempty"`
	Truncated   bool   `json:"truncated,omitempty"`
}

type FileWriteArgs

type FileWriteArgs struct {
	FilePath string `json:"file_path"`
	Content  string `json:"content"`
}

type FloretContinuationRetry added in v0.11.0

type FloretContinuationRetry struct {
	LogicalRequestID identity.LogicalRequestID
	Reason           string
}

type FloretStoreStartupClass added in v0.11.0

type FloretStoreStartupClass string
const (
	FloretStoreStartupTemporarilyBlocked         FloretStoreStartupClass = "temporarily_blocked"
	FloretStoreStartupUpdateRequired             FloretStoreStartupClass = "update_required"
	FloretStoreStartupUnsupportedStore           FloretStoreStartupClass = "unsupported_store"
	FloretStoreStartupIntegrityError             FloretStoreStartupClass = "store_integrity_error"
	FloretStoreStartupEnvironmentPermissionError FloretStoreStartupClass = "environment_permission_error"
	FloretStoreStartupIOError                    FloretStoreStartupClass = "store_io_error"
	FloretStoreStartupCancelled                  FloretStoreStartupClass = "cancelled"
	FloretStoreStartupContractError              FloretStoreStartupClass = "contract_error"
	FloretStoreStartupInsufficientSpace          FloretStoreStartupClass = "insufficient_space"
	FloretStoreStartupMigrationFailed            FloretStoreStartupClass = "migration_failed"
	FloretStoreStartupBackupFailed               FloretStoreStartupClass = "backup_failed"
	FloretStoreStartupRestoreFailed              FloretStoreStartupClass = "restore_failed"
)

type FloretStoreStartupError added in v0.11.0

type FloretStoreStartupError struct {
	Component   string
	Phase       string
	Class       FloretStoreStartupClass
	Retryable   bool
	SafeToRetry bool
	// contains filtered or unexported fields
}

FloretStoreStartupError is Redeven's readiness-safe projection of a public owner storage or migration error. It intentionally contains no schema rows or backend implementation details.

func (*FloretStoreStartupError) Error added in v0.11.0

func (e *FloretStoreStartupError) Error() string

func (*FloretStoreStartupError) Unwrap added in v0.11.0

func (e *FloretStoreStartupError) Unwrap() error

type FloretStoreStartupPhase added in v0.11.0

type FloretStoreStartupPhase string
const (
	FloretStoreStartupInspecting FloretStoreStartupPhase = "inspecting"
	FloretStoreStartupOptimizing FloretStoreStartupPhase = "optimizing"
	FloretStoreStartupMigrating  FloretStoreStartupPhase = "migrating"
	FloretStoreStartupVerifying  FloretStoreStartupPhase = "verifying"
	FloretStoreStartupRecovering FloretStoreStartupPhase = "recovering"
	FloretStoreStartupBackingUp  FloretStoreStartupPhase = "backing_up"
	FloretStoreStartupRestoring  FloretStoreStartupPhase = "restoring"
)

type FlowerActivityFileAction added in v0.7.1

type FlowerActivityFileAction struct {
	ActionID      string `json:"action_id"`
	DisplayName   string `json:"display_name"`
	PreviewPath   string `json:"preview_path,omitempty"`
	DirectoryPath string `json:"directory_path,omitempty"`
}

type FlowerApprovalAction added in v0.7.1

type FlowerApprovalAction struct {
	ActionID       string                    `json:"action_id"`
	Origin         FlowerApprovalOrigin      `json:"origin"`
	RunID          string                    `json:"run_id,omitempty"`
	TurnID         string                    `json:"turn_id,omitempty"`
	StepID         string                    `json:"step_id,omitempty"`
	ToolID         string                    `json:"tool_id,omitempty"`
	ToolName       string                    `json:"tool_name"`
	State          FlowerApprovalState       `json:"state"`
	Status         FlowerApprovalStatus      `json:"status"`
	SurfaceRole    FlowerApprovalSurfaceRole `json:"surface_role,omitempty"`
	Scope          string                    `json:"scope,omitempty"`
	RequestedAtMs  int64                     `json:"requested_at_unix_ms"`
	ResolvedAtMs   int64                     `json:"resolved_at_unix_ms,omitempty"`
	ExpiresAtMs    int64                     `json:"expires_at_unix_ms,omitempty"`
	CanApprove     bool                      `json:"can_approve"`
	ReadOnlyReason string                    `json:"read_only_reason,omitempty"`
	QueueOrder     int64                     `json:"queue_order"`
	BatchIndex     int                       `json:"batch_index"`
	BatchSize      int                       `json:"batch_size"`
	Summary        FlowerApprovalSummary     `json:"summary"`
}

type FlowerApprovalOrigin added in v0.7.2

type FlowerApprovalOrigin string
const (
	FlowerApprovalOriginMainTool          FlowerApprovalOrigin = "main_tool"
	FlowerApprovalOriginDelegatedSubagent FlowerApprovalOrigin = "delegated_subagent"
	FlowerApprovalOriginControlConfirm    FlowerApprovalOrigin = "control_confirm"
)

type FlowerApprovalState added in v0.7.1

type FlowerApprovalState string
const (
	FlowerApprovalStateRequested   FlowerApprovalState = "requested"
	FlowerApprovalStateApproved    FlowerApprovalState = "approved"
	FlowerApprovalStateRejected    FlowerApprovalState = "rejected"
	FlowerApprovalStateTimedOut    FlowerApprovalState = "timed_out"
	FlowerApprovalStateCanceled    FlowerApprovalState = "canceled"
	FlowerApprovalStateUnavailable FlowerApprovalState = "unavailable"
)

type FlowerApprovalStatus added in v0.7.1

type FlowerApprovalStatus string
const (
	FlowerApprovalStatusPending     FlowerApprovalStatus = "pending"
	FlowerApprovalStatusResolved    FlowerApprovalStatus = "resolved"
	FlowerApprovalStatusUnavailable FlowerApprovalStatus = "unavailable"
)

type FlowerApprovalSummary added in v0.7.1

type FlowerApprovalSummary struct {
	Label       string             `json:"label"`
	Description string             `json:"description,omitempty"`
	Command     string             `json:"command,omitempty"`
	Cwd         string             `json:"cwd,omitempty"`
	Effects     []string           `json:"effects,omitempty"`
	Flags       []string           `json:"flags,omitempty"`
	Targets     []FlowerSafeTarget `json:"targets,omitempty"`
}

type FlowerApprovalSurfaceRole added in v0.7.2

type FlowerApprovalSurfaceRole string
const (
	FlowerApprovalSurfacePrimaryAction FlowerApprovalSurfaceRole = "primary_action"
	FlowerApprovalSurfaceLocator       FlowerApprovalSurfaceRole = "locator"
	FlowerApprovalSurfaceMirror        FlowerApprovalSurfaceRole = "mirror"
)

type FlowerAttachmentView added in v0.11.0

type FlowerAttachmentView struct {
	AttachmentID      string `json:"attachment_id"`
	Name              string `json:"name"`
	MimeType          string `json:"mime_type"`
	SizeBytes         int64  `json:"size_bytes"`
	UnicodeCodePoints *int64 `json:"unicode_code_points,omitempty"`
	LogicalLineCount  *int64 `json:"logical_line_count,omitempty"`
	URL               string `json:"url,omitempty"`
}

type FlowerCanonicalReferenceOpenRequest added in v0.11.0

type FlowerCanonicalReferenceOpenRequest struct {
	ThreadID    string `json:"-"`
	TurnID      string `json:"turn_id"`
	ReferenceID string `json:"reference_id"`
}

type FlowerCanonicalReferenceOpenTarget added in v0.11.0

type FlowerCanonicalReferenceOpenTarget struct {
	Kind  string `json:"kind"`
	Label string `json:"label"`
	Path  string `json:"-"`
}

FlowerCanonicalReferenceOpenTarget is host-only. Path must never be serialized as part of a timeline or reference DTO.

type FlowerComputerFrame added in v0.13.0

type FlowerComputerFrame struct {
	AssistanceKind string `json:"assistance_kind,omitempty"`
	ViewerRevision uint64 `json:"viewer_revision"`
	InteractionID  string `json:"interaction_id,omitempty"`
	FrameID        string `json:"frame_id,omitempty"`
	ErrorCode      string `json:"error_code,omitempty"`
	ThreadID       string `json:"thread_id"`
	SessionID      string `json:"session_id"`
	TargetID       string `json:"target_id"`
	ResourceRef    string `json:"resource_ref,omitempty"`
	SHA256         string `json:"sha256,omitempty"`
	MIMEType       string `json:"mime_type"`
	Width          int    `json:"width,omitempty"`
	Height         int    `json:"height,omitempty"`
	Sequence       uint64 `json:"sequence"`
	CapturedAtMS   int64  `json:"captured_at_ms,omitempty"`
}

type FlowerContextCompaction added in v0.7.2

type FlowerContextCompaction struct {
	OperationID         string `json:"operation_id"`
	RequestID           string `json:"request_id"`
	RunID               string `json:"run_id,omitempty"`
	StepIndex           int    `json:"step_index,omitempty"`
	Phase               string `json:"phase"`
	Status              string `json:"status"`
	Trigger             string `json:"trigger,omitempty"`
	Reason              string `json:"reason,omitempty"`
	Source              string `json:"source"`
	TokensBefore        int64  `json:"tokens_before,omitempty"`
	TokensAfterEstimate int64  `json:"tokens_after_estimate,omitempty"`
	Error               string `json:"error,omitempty"`
	UpdatedAtMs         int64  `json:"updated_at_ms"`
}

type FlowerContextSample added in v0.13.0

type FlowerContextSample struct {
	RunID                  string  `json:"run_id,omitempty"`
	StepIndex              int     `json:"step_index,omitempty"`
	Phase                  string  `json:"phase"`
	InputTokens            int64   `json:"input_tokens,omitempty"`
	ContextWindowTokens    int64   `json:"context_window_tokens,omitempty"`
	ThresholdTokens        int64   `json:"threshold_tokens,omitempty"`
	RequestSafeLimitTokens int64   `json:"request_safe_limit_tokens,omitempty"`
	OutputHeadroomTokens   int64   `json:"output_headroom_tokens,omitempty"`
	UsedRatio              float64 `json:"used_ratio,omitempty"`
	ThresholdRatio         float64 `json:"threshold_ratio,omitempty"`
	PressureStatus         string  `json:"pressure_status"`
	Source                 string  `json:"source,omitempty"`
	UpdatedAtMs            int64   `json:"updated_at_ms"`
}

type FlowerContextUsage added in v0.7.2

type FlowerContextUsage struct {
	Confirmed   *FlowerContextSample    `json:"confirmed,omitempty"`
	Estimate    *FlowerContextSample    `json:"estimate,omitempty"`
	ThreadUsage *FlowerThreadTokenUsage `json:"thread_usage,omitempty"`
}

type FlowerFileActionOpenRequest added in v0.7.1

type FlowerFileActionOpenRequest struct {
	ThreadID   string `json:"thread_id,omitempty"`
	MessageID  string `json:"message_id"`
	BlockIndex int    `json:"block_index"`
	ItemID     string `json:"item_id"`
	ActionID   string `json:"action_id"`
	Action     string `json:"action"`
}

type FlowerFileActionOpenTarget added in v0.7.1

type FlowerFileActionOpenTarget struct {
	ActionID string `json:"action_id"`
	Action   string `json:"action"`
	Path     string `json:"path"`
}

func ResolveFlowerFileActionOpenTargetFromMessages added in v0.7.1

func ResolveFlowerFileActionOpenTargetFromMessages(values []any, req FlowerFileActionOpenRequest) (FlowerFileActionOpenTarget, bool, error)

type FlowerLiveMetricsSnapshot added in v0.11.0

type FlowerLiveMetricsSnapshot struct {
	Batches                              uint64 `json:"batches"`
	LogicalEvents                        uint64 `json:"logical_events"`
	EncodedBytes                         uint64 `json:"encoded_bytes"`
	CurrentSubscribers                   int64  `json:"current_subscribers"`
	PeakSubscribers                      int64  `json:"peak_subscribers"`
	EncodeNanoseconds                    uint64 `json:"encode_nanoseconds"`
	FanoutNanoseconds                    uint64 `json:"fanout_nanoseconds"`
	RuntimeCurrentsReceived              uint64 `json:"runtime_currents_received"`
	RuntimeCurrentsPublished             uint64 `json:"runtime_currents_published"`
	RuntimeCurrentsCoalesced             uint64 `json:"runtime_currents_coalesced"`
	MaxRuntimeCurrentPublishGapNanos     uint64 `json:"max_runtime_current_publish_gap_nanoseconds"`
	FirstThinkingPublishSamples          uint64 `json:"first_thinking_publish_samples"`
	LastFirstThinkingPublishLatencyNanos uint64 `json:"last_first_thinking_publish_latency_nanoseconds"`
	MaxFirstThinkingPublishLatencyNanos  uint64 `json:"max_first_thinking_publish_latency_nanoseconds"`
	SubscriberQueueOverflows             uint64 `json:"subscriber_queue_overflows"`
	SubscriberOversizedBatches           uint64 `json:"subscriber_oversized_batches"`
	GlobalQueueOverflows                 uint64 `json:"global_queue_overflows"`
}

type FlowerLiveStreamEnvelope added in v0.11.0

type FlowerLiveStreamEnvelope struct {
	ObserverID          string                     `json:"observer_id,omitempty"`
	SchemaVersion       int64                      `json:"schema_version"`
	Kind                FlowerLiveStreamKind       `json:"kind"`
	ThreadID            string                     `json:"thread_id,omitempty"`
	Summaries           []ThreadView               `json:"summaries,omitempty"`
	Current             *flruntime.ThreadView      `json:"current,omitempty"`
	SubagentCurrent     *flruntime.ThreadView      `json:"subagent_current,omitempty"`
	Subagents           *[]FlowerSubagentSummary   `json:"subagents,omitempty"`
	ContextUsage        *FlowerContextUsage        `json:"context_usage,omitempty"`
	ContextCompactions  []FlowerContextCompaction  `json:"context_compactions,omitempty"`
	TimelineDecorations []FlowerTimelineDecoration `json:"timeline_decorations,omitempty"`
	ReadStatus          *FlowerThreadReadView      `json:"read_status,omitempty"`
	ComputerFrame       *FlowerComputerFrame       `json:"computer_frame,omitempty"`
}

func (FlowerLiveStreamEnvelope) MarshalJSON added in v0.11.0

func (e FlowerLiveStreamEnvelope) MarshalJSON() ([]byte, error)

type FlowerLiveStreamFrame added in v0.11.0

type FlowerLiveStreamFrame struct {
	Kind FlowerLiveStreamKind
	Data []byte
}

type FlowerLiveStreamKind added in v0.11.0

type FlowerLiveStreamKind string
const (
	FlowerLiveStreamReady           FlowerLiveStreamKind = "ready"
	FlowerLiveStreamSummaryBatch    FlowerLiveStreamKind = "summary.batch"
	FlowerLiveStreamThreadBatch     FlowerLiveStreamKind = "thread.batch"
	FlowerLiveStreamViewerReadState FlowerLiveStreamKind = "viewer.read_state"
	FlowerLiveStreamComputerFrame   FlowerLiveStreamKind = "computer.frame"
)

type FlowerLiveStreamRequest added in v0.11.0

type FlowerLiveStreamRequest struct{}

type FlowerLiveStreamSubscription added in v0.11.0

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

func (*FlowerLiveStreamSubscription) Close added in v0.11.0

func (s *FlowerLiveStreamSubscription) Close()

func (*FlowerLiveStreamSubscription) Next added in v0.11.0

type FlowerMessageReference added in v0.11.0

type FlowerMessageReference struct {
	ReferenceID string `json:"reference_id"`
	Kind        string `json:"kind"`
	Label       string `json:"label"`
	Text        string `json:"text,omitempty"`
	Truncated   bool   `json:"truncated,omitempty"`
}

type FlowerPermissionType added in v0.7.2

type FlowerPermissionType = permissionsnapshot.PermissionType

type FlowerReadStateCleaner added in v0.9.0

type FlowerReadStateCleaner interface {
	RetireFlowerThreadReadState(context.Context, string, string) error
}

FlowerReadStateCleaner owns only Redeven presentation cache cleanup. It has no Floret lifecycle capability and cannot mutate canonical thread state.

type FlowerRunProgress added in v0.13.0

type FlowerRunProgress struct {
	RunID  string                   `json:"run_id"`
	TurnID string                   `json:"turn_id"`
	Phase  flruntime.ThreadRunPhase `json:"phase"`
}

type FlowerSafeTarget added in v0.7.1

type FlowerSafeTarget struct {
	Kind  string `json:"kind"`
	Label string `json:"label"`
	URI   string `json:"uri,omitempty"`
}

type FlowerSnapshotSummary added in v0.13.0

type FlowerSnapshotSummary struct {
	ID          string    `json:"id"`
	CreatedAt   time.Time `json:"created_at"`
	SourceBuild string    `json:"source_build"`
	Bytes       int64     `json:"bytes"`
	Kind        string    `json:"kind"`
	Protected   bool      `json:"protected"`
	Unavailable bool      `json:"unavailable,omitempty"`
}

FlowerSnapshotSummary contains no conversation, database, or credential data.

func ListFlowerSnapshots added in v0.13.0

func ListFlowerSnapshots(ctx context.Context, state string) ([]FlowerSnapshotSummary, error)

type FlowerSubagentDetailResponse added in v0.7.2

type FlowerSubagentDetailResponse struct {
	Summary FlowerSubagentSummary `json:"summary"`
	Current flruntime.ThreadView  `json:"current"`
}

func (FlowerSubagentDetailResponse) MarshalJSON added in v0.13.0

func (d FlowerSubagentDetailResponse) MarshalJSON() ([]byte, error)

type FlowerSubagentSummary added in v0.7.2

type FlowerSubagentSummary struct {
	Title           string `json:"title"`
	TitleStatus     string `json:"title_status"`
	TitleGeneration int64  `json:"title_generation"`
	ParentThreadID  string `json:"parent_thread_id"`
	ThreadID        string `json:"thread_id"`
	TaskName        string `json:"task_name,omitempty"`
	TaskDescription string `json:"task_description,omitempty"`
	AgentType       string `json:"agent_type,omitempty"`
	ContextMode     string `json:"context_mode,omitempty"`
	Status          string `json:"status"`
	LastMessage     string `json:"last_message,omitempty"`
	WaitingPrompt   string `json:"waiting_prompt,omitempty"`
	QueuedInputs    int    `json:"queued_inputs,omitempty"`
	CanSendInput    bool   `json:"can_send_input"`
	CanInterrupt    bool   `json:"can_interrupt"`
	CanClose        bool   `json:"can_close"`
	CreatedAtUnixMs int64  `json:"created_at_ms,omitempty"`
	UpdatedAtUnixMs int64  `json:"updated_at_ms,omitempty"`
}

type FlowerThreadDetail added in v0.11.0

type FlowerThreadDetail struct {
	Thread  ThreadView           `json:"thread"`
	Current flruntime.ThreadView `json:"current"`
}

FlowerThreadDetail joins Redeven-owned thread metadata with Floret's typed current view. Current is serialized through the Flower projection boundary, which redacts opaque resource references and adds scoped attachment URLs. The two fields have distinct owners and are replaced atomically by the detail endpoint; summary updates never write Current.

func (FlowerThreadDetail) MarshalJSON added in v0.11.0

func (d FlowerThreadDetail) MarshalJSON() ([]byte, error)

type FlowerThreadReadRecord added in v0.7.1

type FlowerThreadReadRecord struct {
	LastSeenActivityRevision int64 `json:"last_seen_activity_revision"`
}

type FlowerThreadReadSnapshot added in v0.7.1

type FlowerThreadReadSnapshot struct {
	ActivityRevision int64 `json:"activity_revision"`
}

type FlowerThreadReadView added in v0.7.1

type FlowerThreadReadView struct {
	IsUnread  bool                     `json:"is_unread"`
	Snapshot  FlowerThreadReadSnapshot `json:"snapshot"`
	ReadState FlowerThreadReadRecord   `json:"read_state"`
}

type FlowerThreadTokenUsage added in v0.13.0

type FlowerThreadTokenUsage struct {
	InputTokens      int64 `json:"input_tokens"`
	OutputTokens     int64 `json:"output_tokens"`
	CacheReadTokens  int64 `json:"cache_read_tokens"`
	CacheWriteTokens int64 `json:"cache_write_tokens"`
}

type FlowerTimelineAnchor added in v0.7.2

type FlowerTimelineAnchor struct {
	TargetKind     string `json:"target_kind"`
	MessageID      string `json:"message_id"`
	BlockIndex     *int   `json:"block_index,omitempty"`
	ActivityItemID string `json:"activity_item_id,omitempty"`
	Edge           string `json:"edge"`
}

type FlowerTimelineDecoration added in v0.7.2

type FlowerTimelineDecoration struct {
	DecorationID          string                           `json:"decoration_id"`
	Kind                  FlowerTimelineDecorationKind     `json:"kind"`
	Anchor                FlowerTimelineAnchor             `json:"anchor"`
	Ordinal               int                              `json:"ordinal"`
	Compaction            FlowerContextCompaction          `json:"-"`
	ProjectionUnavailable *FlowerTurnProjectionUnavailable `json:"-"`
	// contains filtered or unexported fields
}

func (FlowerTimelineDecoration) MarshalJSON added in v0.9.0

func (decoration FlowerTimelineDecoration) MarshalJSON() ([]byte, error)

func (*FlowerTimelineDecoration) UnmarshalJSON added in v0.9.0

func (decoration *FlowerTimelineDecoration) UnmarshalJSON(data []byte) error

func (FlowerTimelineDecoration) Validate added in v0.9.0

func (decoration FlowerTimelineDecoration) Validate() error

type FlowerTimelineDecorationKind added in v0.9.0

type FlowerTimelineDecorationKind string
const (
	FlowerTimelineDecorationContextCompaction         FlowerTimelineDecorationKind = "context_compaction"
	FlowerTimelineDecorationTurnProjectionUnavailable FlowerTimelineDecorationKind = "turn_projection_unavailable"
)

type FlowerTimelineMessage added in v0.7.1

type FlowerTimelineMessage struct {
	MessageID        string                   `json:"id"`
	ThreadID         string                   `json:"thread_id"`
	TurnID           string                   `json:"turn_id"`
	RunID            string                   `json:"run_id"`
	LogicalRequestID string                   `json:"logical_request_id,omitempty"`
	TurnOrdinal      int64                    `json:"turn_ordinal,omitempty"`
	Role             string                   `json:"role"`
	Content          string                   `json:"content"`
	Status           string                   `json:"status"`
	CreatedAtMs      int64                    `json:"created_at_ms"`
	Blocks           []any                    `json:"blocks,omitempty"`
	References       []FlowerMessageReference `json:"references,omitempty"`
	Live             bool                     `json:"live"`
	ActiveCursor     bool                     `json:"active_cursor"`
}

type FlowerTurnProjectionUnavailable added in v0.9.0

type FlowerTurnProjectionUnavailable struct {
	TurnID            string                                `json:"turn_id"`
	RunID             string                                `json:"run_id"`
	ExpectedMessageID string                                `json:"expected_message_id"`
	Reason            FlowerTurnProjectionUnavailableReason `json:"reason"`
}

type FlowerTurnProjectionUnavailableReason added in v0.9.0

type FlowerTurnProjectionUnavailableReason string
const (
	FlowerTurnProjectionUnavailableNotRenderable FlowerTurnProjectionUnavailableReason = "not_renderable"
)

func (FlowerTurnProjectionUnavailableReason) Valid added in v0.9.0

type ForkThreadRequest added in v0.11.0

type ForkThreadRequest struct {
	ClientRequestID string `json:"client_request_id"`
	Title           string `json:"title,omitempty"`
}

type ForkThreadResponse added in v0.11.0

type ForkThreadResponse struct {
	ClientRequestID string     `json:"client_request_id"`
	Thread          ThreadView `json:"thread"`
}

type InMemoryToolRegistry

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

func NewInMemoryToolRegistry

func NewInMemoryToolRegistry() *InMemoryToolRegistry

func (*InMemoryToolRegistry) Register

func (r *InMemoryToolRegistry) Register(tool ToolDef) error

func (*InMemoryToolRegistry) Snapshot

func (r *InMemoryToolRegistry) Snapshot() []ToolDef

func (*InMemoryToolRegistry) Unregister

func (r *InMemoryToolRegistry) Unregister(name string) error

type InteractionSafetyDecision added in v0.13.0

type InteractionSafetyDecision struct {
	ActionID          string   `json:"action_id"`
	Level             string   `json:"level"`
	ReasonCodes       []string `json:"reason_codes,omitempty"`
	Confidence        float64  `json:"confidence,omitempty"`
	SafeToCapture     bool     `json:"safe_to_capture"`
	SafeToSendToModel bool     `json:"safe_to_send_to_model"`
	RequiredOrigin    string   `json:"required_origin,omitempty"`
	RequiredApp       string   `json:"required_app,omitempty"`
	ConfirmationScope string   `json:"confirmation_scope,omitempty"`
}

InteractionSafetyDecision is the policy result immediately before a target action is executed. A safety gate may request user takeover, but it can never authorize an action that the existing permission policy rejected.

type InteractionSafetyGate added in v0.13.0

type InteractionSafetyGate interface {
	AssessInteraction(ctx context.Context, call TargetToolCall, target TargetDescriptor) (InteractionSafetyDecision, error)
}

InteractionSafetyGate is called for every computer/browser action. The default implementation is conservative for secrets and external side effects while allowing ordinary observation and navigation.

type ListThreadMessagesResponse

type ListThreadMessagesResponse struct {
	Messages            []any                      `json:"messages"`
	TimelineDecorations []FlowerTimelineDecoration `json:"timeline_decorations,omitempty"`
	NextBeforeID        int64                      `json:"next_before_id,omitempty"`
	HasMore             bool                       `json:"has_more,omitempty"`
	TotalReturned       int                        `json:"total_returned,omitempty"`
}

type ListThreadsResponse

type ListThreadsResponse struct {
	Threads    []ThreadView `json:"threads"`
	NextCursor string       `json:"next_cursor,omitempty"`
}

type LiveAttachmentCanonicalAuthority added in v0.11.0

type LiveAttachmentCanonicalAuthority interface {
	ReadCanonicalAttachmentMembership(context.Context, string, string, string) (CanonicalAttachmentMembership, error)
}

LiveAttachmentCanonicalAuthority must read one exact turn through Floret's public runtime API on every call. A product retention claim is not evidence.

type MCPCatalog added in v0.13.0

type MCPCatalog struct {
	Servers []MCPServerView `json:"servers"`
}

type MCPServerInput added in v0.13.0

type MCPServerInput struct {
	ID        string            `json:"id"`
	Revision  int64             `json:"revision"`
	Name      string            `json:"name"`
	Transport string            `json:"transport"`
	URL       string            `json:"url,omitempty"`
	Command   string            `json:"command,omitempty"`
	Args      []string          `json:"args,omitempty"`
	Headers   map[string]string `json:"headers,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
	Enabled   bool              `json:"enabled"`
}

MCP credentials are write-only through the management API. A nil secret map preserves existing values; an explicitly empty map clears them.

type MCPServerView added in v0.13.0

type MCPServerView struct {
	Icons      []ExtensionIcon `json:"icons,omitempty"`
	ID         string          `json:"id"`
	Revision   int64           `json:"revision"`
	Name       string          `json:"name"`
	Transport  string          `json:"transport"`
	URL        string          `json:"url,omitempty"`
	Command    string          `json:"command,omitempty"`
	Args       []string        `json:"args,omitempty"`
	HeaderKeys []string        `json:"header_keys"`
	EnvKeys    []string        `json:"env_keys"`
	Enabled    bool            `json:"enabled"`
	Tools      []mcpToolRecord `json:"tools"`
	CheckedAt  int64           `json:"checked_at"`
}

type Message

type Message struct {
	Role    string        `json:"role"`
	Content []ContentPart `json:"content"`
}

type ModeFlags

type ModeFlags struct {
	ReasoningOnly bool `json:"reasoning_only,omitempty"`
}

type Model

type Model struct {
	WebSearch           config.AIWebSearchAvailability `json:"web_search"`
	ID                  string                         `json:"id"`
	Label               string                         `json:"label,omitempty"`
	Source              string                         `json:"source,omitempty"`
	SourceLabel         string                         `json:"source_label,omitempty"`
	ContextWindow       int                            `json:"context_window,omitempty"`
	MaxOutputTokens     int                            `json:"max_output_tokens,omitempty"`
	InputModalities     []string                       `json:"input_modalities,omitempty"`
	SupportsImageInput  bool                           `json:"supports_image_input,omitempty"`
	ReasoningCapability config.AIReasoningCapability   `json:"reasoning_capability,omitempty"`
}

type ModelCatalogModel added in v0.13.0

type ModelCatalogModel struct {
	config.AIProviderModel
	WebSearch config.AIWebSearchAvailability `json:"web_search"`
}

type ModelCatalogRequest added in v0.13.0

type ModelCatalogRequest struct {
	ProviderID string `json:"provider_id,omitempty"`
	Type       string `json:"type"`
	BaseURL    string `json:"base_url,omitempty"`
	APIKey     string `json:"api_key,omitempty"`
}

type ModelCatalogResponse added in v0.13.0

type ModelCatalogResponse struct {
	Models []ModelCatalogModel `json:"models"`
}

type ModelGateway added in v0.7.1

type ModelGateway interface {
	StreamTurn(ctx context.Context, req ModelGatewayRequest, onEvent func(StreamEvent)) (ModelGatewayResult, error)
}

ModelGateway streams one provider request for a Floret hosted turn.

type ModelGatewayRequest added in v0.7.1

type ModelGatewayRequest struct {
	Protocol         string                   `json:"protocol,omitempty"`
	RunID            flidentity.RunID         `json:"run_id,omitempty"`
	PromptScopeID    flidentity.PromptScopeID `json:"prompt_scope_id,omitempty"`
	PreviousState    *ModelGatewayState       `json:"previous_state,omitempty"`
	Model            string                   `json:"model"`
	Messages         []Message                `json:"messages"`
	Tools            []ToolDef                `json:"tools"`
	Budgets          TurnBudgets              `json:"budgets"`
	ModeFlags        ModeFlags                `json:"mode_flags"`
	ProviderControls ProviderControls         `json:"provider_controls,omitempty"`
	WebSearchMode    string                   `json:"web_search_mode,omitempty"`
}

type ModelGatewayResult added in v0.7.1

type ModelGatewayResult struct {
	FinishReason    string             `json:"finish_reason"`
	Text            string             `json:"text,omitempty"`
	Reasoning       string             `json:"reasoning,omitempty"`
	ToolCalls       []ToolCall         `json:"tool_calls,omitempty"`
	Sources         []SourceRef        `json:"sources,omitempty"`
	Usage           TurnUsage          `json:"usage,omitempty"`
	ProviderState   *ModelGatewayState `json:"provider_state,omitempty"`
	RawProviderDiag map[string]any     `json:"raw_provider_diag,omitempty"`
	StreamEvents    []StreamEvent      `json:"stream_events,omitempty"`
	ToolResults     []ToolResult       `json:"tool_results,omitempty"`
}

type ModelGatewayState added in v0.7.1

type ModelGatewayState struct {
	Kind       string            `json:"kind,omitempty"`
	ID         string            `json:"id,omitempty"`
	Attributes map[string]string `json:"attributes,omitempty"`
}

type ModelSelectInput

type ModelSelectInput struct {
	Mode          string
	ReasoningOnly bool
	Configured    string
}

type ModelSelector

type ModelSelector interface {
	Select(ctx context.Context, in ModelSelectInput) (provider string, model string, reason string)
}

type ModelsResponse

type ModelsResponse struct {
	CurrentModel string           `json:"current_model"`
	Models       []Model          `json:"models"`
	Runtime      *AIRuntimeStatus `json:"runtime,omitempty"`
}

func NewModelsResponse added in v0.6.10

func NewModelsResponse(runtime *AIRuntimeStatus) *ModelsResponse

NewModelsResponse keeps the public models contract stable for empty results.

type NativeDesktopTargetExecutor added in v0.13.0

type NativeDesktopTargetExecutor struct {
	HelperPath string
	Timeout    time.Duration
	// contains filtered or unexported fields
}

NativeDesktopTargetExecutor speaks the versioned JSONL protocol implemented by desktop/native/computer-host. The helper owns macOS Accessibility, CGEvent, and screen capture permissions; this adapter owns routing and opaque frame storage.

func NewNativeDesktopTargetExecutor added in v0.13.0

func NewNativeDesktopTargetExecutor(helperPath string) *NativeDesktopTargetExecutor

func (*NativeDesktopTargetExecutor) CheckComputerSetup added in v0.13.0

func (e *NativeDesktopTargetExecutor) CheckComputerSetup(ctx context.Context) error

CheckComputerSetup probes OS permissions without starting a control session.

func (*NativeDesktopTargetExecutor) Close added in v0.13.0

func (*NativeDesktopTargetExecutor) EnsureTargetReady added in v0.13.0

func (e *NativeDesktopTargetExecutor) EnsureTargetReady(ctx context.Context, _ string) error

func (*NativeDesktopTargetExecutor) ExecuteComputerUserInput added in v0.13.0

func (e *NativeDesktopTargetExecutor) ExecuteComputerUserInput(ctx context.Context, call TargetToolCall) ([]byte, error)

func (*NativeDesktopTargetExecutor) ExecuteTargetTool added in v0.13.0

func (*NativeDesktopTargetExecutor) ListTargets added in v0.13.0

func (*NativeDesktopTargetExecutor) ResolveTargetToolAttachment added in v0.13.0

func (e *NativeDesktopTargetExecutor) ResolveTargetToolAttachment(_ context.Context, ref string) ([]byte, error)

type OpenUploadResult added in v0.11.0

type OpenUploadResult struct {
	Info     *UploadResponse
	FilePath string
}

type Options

type Options struct {
	Logger         *slog.Logger
	StateDir       string
	BuildVersion   string
	DeferExecution bool

	AgentHomeDir    string
	Shell           string
	FilesystemScope *filesystemscope.Registry

	Config *config.AIConfig

	ToolTargetPolicy      ToolTargetPolicy
	TargetToolExecutor    TargetToolExecutor
	TargetResolver        TargetResolver
	InteractionSafetyGate InteractionSafetyGate
	WorkloadAdmission     WorkloadAdmission

	// PersistOpTimeout is the per-operation timeout for threadstore persistence
	// (SQLite reads/writes). It must NOT be tied to a run's overall lifetime, since
	// runs can take much longer than persistence should ever be allowed to block.
	//
	// When zero, it defaults to 10 seconds.
	PersistOpTimeout time.Duration

	// RunMaxWallTime is the hard cap for a single run's lifetime.
	//
	// When zero, it defaults to 15 minutes.
	RunMaxWallTime time.Duration
	// RunIdleTimeout cancels a run if no runtime stream activity is observed for the duration.
	//
	// When zero, it defaults to 2 minutes.
	RunIdleTimeout time.Duration
	// ToolApprovalTimeout is the max time a run waits for user approval for high-risk tools.
	//
	// When zero, it defaults to 10 minutes.
	ToolApprovalTimeout time.Duration
	// StreamWriteTimeout is the best-effort per-frame write deadline for the NDJSON stream.
	//
	// When zero, it defaults to 5 seconds.
	StreamWriteTimeout time.Duration

	// ResolveProviderAPIKey returns the API key for the given provider id.
	//
	// It should read from a local secrets store, not from config.json.
	ResolveProviderAPIKey func(providerID string) (string, bool, error)

	// ResolveWebSearchProviderAPIKey returns the API key for a provider-scoped web search backend.
	//
	// It should read from a local secrets store, not from config.json.
	ResolveWebSearchProviderAPIKey func(providerID string) (string, bool, error)

	FlowerReadStateCleaner FlowerReadStateCleaner
	StoreStartupProgress   func(FloretStoreStartupPhase)
	// contains filtered or unexported fields
}

type OrphanCanonicalRoot added in v0.11.0

type OrphanCanonicalRoot struct {
	ThreadID         string `json:"thread_id"`
	Phase            string `json:"phase"`
	Status           string `json:"status"`
	CanAppendMessage bool   `json:"can_append_message"`
	Recoverable      bool   `json:"recoverable"`
}

type OrphanCanonicalRootReview added in v0.11.0

type OrphanCanonicalRootReview struct {
	IssueCount int                   `json:"issue_count"`
	Items      []OrphanCanonicalRoot `json:"items"`
}

type PartialToolCall

type PartialToolCall struct {
	ID            string         `json:"id,omitempty"`
	Name          string         `json:"name,omitempty"`
	ArgumentsJSON string         `json:"arguments_json,omitempty"`
	Arguments     map[string]any `json:"arguments,omitempty"`
}

type PartialUsage

type PartialUsage struct {
	InputTokens      int64 `json:"input_tokens,omitempty"`
	OutputTokens     int64 `json:"output_tokens,omitempty"`
	ReasoningTokens  int64 `json:"reasoning_tokens,omitempty"`
	CacheReadTokens  int64 `json:"cache_read_tokens,omitempty"`
	CacheWriteTokens int64 `json:"cache_write_tokens,omitempty"`
}

type PatchThreadRequest

type PatchThreadRequest struct {
	Title              *string         `json:"title,omitempty"`
	ModelID            *string         `json:"model_id,omitempty"`
	PermissionType     *string         `json:"permission_type,omitempty"`
	Pinned             *bool           `json:"pinned,omitempty"`
	ReasoningSelection json.RawMessage `json:"reasoning_selection,omitempty"`
}

type PendingToolResult added in v0.7.2

type PendingToolResult struct {
	Handle      string            `json:"handle"`
	Summary     string            `json:"summary"`
	Instruction string            `json:"instruction"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type PermissionSnapshot added in v0.7.2

type PermissionSnapshot = permissionsnapshot.Snapshot

type PermissionToolFilter added in v0.7.2

type PermissionToolFilter interface {
	FilterTools(permissionType FlowerPermissionType, all []ToolDef) []ToolDef
}

type PlaywrightTargetExecutor added in v0.13.0

type PlaywrightTargetExecutor struct {
	ManagedAttachment bool
	DownloadDir       string
	NodeBinary        string
	HelperPath        string
	ProfileDir        string
	CDPURL            string
	TabID             string
	BrowserContextID  string
	Timeout           time.Duration
	// contains filtered or unexported fields
}

PlaywrightTargetExecutor is the headless Linux BrowserTarget. The Node helper owns Playwright and browser profiles; this process owns target policy and opaque screenshot attachment bytes.

func NewPlaywrightTargetExecutor added in v0.13.0

func NewPlaywrightTargetExecutor(nodeBinary, helperPath, profileDir string) *PlaywrightTargetExecutor

func (*PlaywrightTargetExecutor) CheckComputerSetup added in v0.13.0

func (e *PlaywrightTargetExecutor) CheckComputerSetup() error

CheckComputerSetup reports installed entrypoints without launching Chromium.

func (*PlaywrightTargetExecutor) Close added in v0.13.0

func (e *PlaywrightTargetExecutor) Close() error

func (*PlaywrightTargetExecutor) EnsureTargetReady added in v0.13.0

func (e *PlaywrightTargetExecutor) EnsureTargetReady(ctx context.Context, targetID string) error

func (*PlaywrightTargetExecutor) ExecuteComputerUserInput added in v0.13.0

func (e *PlaywrightTargetExecutor) ExecuteComputerUserInput(ctx context.Context, call TargetToolCall) ([]byte, error)

User input uses the same serialized browser exchange, but its frames and inputs never enter model attachments, activity, or the executor media cache.

func (*PlaywrightTargetExecutor) ExecuteTargetTool added in v0.13.0

func (e *PlaywrightTargetExecutor) ExecuteTargetTool(ctx context.Context, call TargetToolCall) (TargetToolResult, error)

func (*PlaywrightTargetExecutor) ResolveTargetToolAttachment added in v0.13.0

func (e *PlaywrightTargetExecutor) ResolveTargetToolAttachment(_ context.Context, resourceRef string) ([]byte, error)

type ProviderControls

type ProviderControls struct {
	ReasoningSelection  config.AIReasoningSelection  `json:"reasoning_selection,omitempty"`
	ReasoningCapability config.AIReasoningCapability `json:"reasoning_capability,omitempty"`
	CacheControl        string                       `json:"cache_control,omitempty"`
	ResponseFormat      string                       `json:"response_format,omitempty"`
	Temperature         *float64                     `json:"temperature,omitempty"`
	TopP                *float64                     `json:"top_p,omitempty"`
}

type QueuedTurnView added in v0.7.2

type QueuedTurnView struct {
	QueueID         string                 `json:"queue_id"`
	Text            string                 `json:"text"`
	CreatedAtUnixMs int64                  `json:"created_at_unix_ms"`
	Attachments     []FlowerAttachmentView `json:"attachments,omitempty"`
	ContextAction   *ContextActionEnvelope `json:"context_action,omitempty"`
}

type RPCDirection added in v0.11.0

type RPCDirection string

RPCDirection distinguishes request handlers from server notifications.

const (
	RPCDirectionRequest RPCDirection = "request"
	RPCDirectionNotify  RPCDirection = "notify"
)

type RPCMethodContract added in v0.11.0

type RPCMethodContract struct {
	Method    string
	TypeID    uint32
	Direction RPCDirection
}

RPCMethodContract is the canonical inventory for the AI RPC domain. Production session assembly and protocol parity tests consume this list so a declared capability cannot silently omit its server handler.

func RPCMethodInventory added in v0.11.0

func RPCMethodInventory() []RPCMethodContract

RPCMethodInventory returns an immutable copy of the AI RPC contract.

type RPCServiceAcquire added in v0.11.0

type RPCServiceAcquire func(context.Context) (*Service, context.Context, uint64, func(), error)

type RealtimeEvent

type RealtimeEvent struct {
	EventType     RealtimeEventType       `json:"event_type"`
	EndpointID    string                  `json:"endpoint_id"`
	ThreadID      string                  `json:"thread_id"`
	TurnID        string                  `json:"turn_id,omitempty"`
	RunID         string                  `json:"run_id"`
	AtUnixMs      int64                   `json:"at_unix_ms"`
	StreamKind    RealtimeStreamKind      `json:"stream_kind,omitempty"`
	Phase         RealtimeLifecyclePhase  `json:"phase,omitempty"`
	Diag          map[string]any          `json:"diag,omitempty"`
	StreamEvent   any                     `json:"stream_event,omitempty"`
	RunStatus     string                  `json:"run_status,omitempty"`
	RunErrorCode  string                  `json:"run_error_code,omitempty"`
	RunError      string                  `json:"run_error,omitempty"`
	WaitingPrompt *RequestUserInputPrompt `json:"waiting_prompt,omitempty"`

	// Thread summary events (EventType=thread_summary).
	Title                string                       `json:"title,omitempty"`
	TitleStatus          string                       `json:"title_status,omitempty"`
	ModelID              string                       `json:"model_id,omitempty"`
	UpdatedAtUnixMs      int64                        `json:"updated_at_unix_ms,omitempty"`
	LastMessagePreview   string                       `json:"last_message_preview,omitempty"`
	LastMessageAtUnixMs  int64                        `json:"last_message_at_unix_ms,omitempty"`
	ActiveRunID          string                       `json:"active_run_id,omitempty"`
	ApprovalPending      *bool                        `json:"approval_pending,omitempty"`
	ApprovalPendingCount int                          `json:"approval_pending_count,omitempty"`
	PermissionType       string                       `json:"permission_type,omitempty"`
	QueuedTurnCount      int                          `json:"queued_turn_count,omitempty"`
	QueuedTurns          []QueuedTurnView             `json:"queued_turns,omitempty"`
	ReasoningSelection   config.AIReasoningSelection  `json:"reasoning_selection,omitempty"`
	ReasoningCapability  config.AIReasoningCapability `json:"reasoning_capability,omitempty"`
}

RealtimeEvent is emitted by the agent for cross-session AI chat collaboration.

JSON fields use snake_case because this payload is transported over Redeven RPC wire.

type RealtimeEventType

type RealtimeEventType string

RealtimeEventType defines the high-level AI event category sent over Flowersec RPC notify.

const (
	RealtimeEventTypeStream        RealtimeEventType = "stream_event"
	RealtimeEventTypeThreadState   RealtimeEventType = "thread_state"
	RealtimeEventTypeThreadSummary RealtimeEventType = "thread_summary"
)

type RealtimeLifecyclePhase

type RealtimeLifecyclePhase string

RealtimeLifecyclePhase marks lifecycle transitions.

const (
	RealtimePhaseStart       RealtimeLifecyclePhase = "start"
	RealtimePhaseStateChange RealtimeLifecyclePhase = "state_change"
	RealtimePhaseEnd         RealtimeLifecyclePhase = "end"
	RealtimePhaseError       RealtimeLifecyclePhase = "error"
)

type RealtimeStreamKind

type RealtimeStreamKind string

RealtimeStreamKind is a low-cardinality stream category for diagnostics/UI routing.

const (
	RealtimeStreamKindLifecycle RealtimeStreamKind = "lifecycle"
	RealtimeStreamKindAssistant RealtimeStreamKind = "assistant"
	RealtimeStreamKindTool      RealtimeStreamKind = "tool"
	RealtimeStreamKindContext   RealtimeStreamKind = "context"
)

type ReorderQueueRequest added in v0.11.0

type ReorderQueueRequest struct {
	OrderedQueueIDs []string `json:"ordered_queue_ids"`
}

type RequestUserInputAction

type RequestUserInputAction struct {
	Type string `json:"type"`
}

type RequestUserInputAnswer

type RequestUserInputAnswer struct {
	ChoiceID string `json:"choice_id,omitempty"`
	Text     string `json:"text,omitempty"`
}

type RequestUserInputChoice

type RequestUserInputChoice struct {
	ChoiceID         string                   `json:"choice_id"`
	Label            string                   `json:"label"`
	Description      string                   `json:"description,omitempty"`
	Kind             string                   `json:"kind"`
	InputPlaceholder string                   `json:"input_placeholder,omitempty"`
	Actions          []RequestUserInputAction `json:"actions,omitempty"`
}

type RequestUserInputPrompt

type RequestUserInputPrompt struct {
	PromptID           string                      `json:"prompt_id"`
	MessageID          string                      `json:"message_id"`
	ToolID             string                      `json:"tool_id"`
	ToolName           string                      `json:"tool_name"`
	ReasonCode         string                      `json:"reason_code,omitempty"`
	ReasoningSelection config.AIReasoningSelection `json:"reasoning_selection,omitempty"`
	RequiredFromUser   []string                    `json:"required_from_user,omitempty"`
	EvidenceRefs       []string                    `json:"evidence_refs,omitempty"`
	Questions          []RequestUserInputQuestion  `json:"questions,omitempty"`
	PublicSummary      string                      `json:"public_summary,omitempty"`
	ContainsSecret     bool                        `json:"contains_secret,omitempty"`
}

type RequestUserInputQuestion

type RequestUserInputQuestion struct {
	ID                string                   `json:"id"`
	Header            string                   `json:"header"`
	Question          string                   `json:"question"`
	IsSecret          bool                     `json:"is_secret"`
	ResponseMode      string                   `json:"response_mode,omitempty"`
	ChoicesExhaustive *bool                    `json:"choices_exhaustive,omitempty"`
	WriteLabel        string                   `json:"write_label,omitempty"`
	WritePlaceholder  string                   `json:"write_placeholder,omitempty"`
	Choices           []RequestUserInputChoice `json:"choices,omitempty"`
}

type RequestUserInputResolvedQuestion

type RequestUserInputResolvedQuestion struct {
	QuestionID          string `json:"question_id"`
	Header              string `json:"header,omitempty"`
	Question            string `json:"question,omitempty"`
	SelectedChoiceID    string `json:"selected_choice_id,omitempty"`
	SelectedChoiceLabel string `json:"selected_choice_label,omitempty"`
	Text                string `json:"text,omitempty"`
	PublicSummary       string `json:"public_summary,omitempty"`
	ContainsSecret      bool   `json:"contains_secret,omitempty"`
}

type RequestUserInputResponse

type RequestUserInputResponse struct {
	PromptID string                            `json:"prompt_id"`
	Answers  map[string]RequestUserInputAnswer `json:"answers"`
}

type RequestUserInputResponseRecord

type RequestUserInputResponseRecord struct {
	PromptID       string                             `json:"prompt_id"`
	ToolID         string                             `json:"tool_id,omitempty"`
	ReasonCode     string                             `json:"reason_code,omitempty"`
	Responses      []RequestUserInputResolvedQuestion `json:"responses,omitempty"`
	PublicSummary  string                             `json:"public_summary,omitempty"`
	ContainsSecret bool                               `json:"contains_secret,omitempty"`
}

type RequestUserInputSecretAnswer

type RequestUserInputSecretAnswer struct {
	QuestionID string `json:"question_id"`
	Text       string `json:"text,omitempty"`
}

type RetryThreadContinuationResponse added in v0.11.0

type RetryThreadContinuationResponse struct {
	OK bool `json:"ok"`
}

type RunAttachmentIn

type RunAttachmentIn struct {
	AttachmentID string `json:"attachment_id"`
}

type RunInput

type RunInput struct {
	Text               string                          `json:"text"`
	Attachments        []RunAttachmentIn               `json:"attachments"`
	ContextAction      *ContextActionEnvelope          `json:"context_action,omitempty"`
	StructuredResponse *RequestUserInputResponseRecord `json:"-"`
	SecretAnswers      []RequestUserInputSecretAnswer  `json:"-"`
}

func (*RunInput) UnmarshalJSON added in v0.10.0

func (input *RunInput) UnmarshalJSON(data []byte) error

type RunOptions

type RunOptions struct {
	// ReasoningOnly relaxes tool-pressure heuristics while preserving the same Floret turn flow.
	ReasoningOnly bool `json:"reasoning_only,omitempty"`

	// NoUserInteraction prevents direct user-input prompts for autonomous runs.
	// Tool approval waits are governed by the explicit approver/delegation policy.
	NoUserInteraction bool `json:"no_user_interaction,omitempty"`

	// ToolAllowlist is an internal runtime guard that limits the visible tool surface
	// for the current run. It is intended for runtime-owned callers such as evals and
	// subagents rather than general user-facing requests.
	ToolAllowlist []string `json:"tool_allowlist,omitempty"`

	// PermissionType controls the run tool surface and approval policy.
	PermissionType string `json:"permission_type,omitempty"`

	// Provider controls.
	ReasoningSelection config.AIReasoningSelection `json:"reasoning_selection,omitempty"`
	CacheControl       string                      `json:"cache_control,omitempty"`
	ResponseFormat     string                      `json:"response_format,omitempty"`
	Temperature        *float64                    `json:"temperature,omitempty"`
	TopP               *float64                    `json:"top_p,omitempty"`

	// Optional hard budgets (0 means unset). Input is cumulative across one run;
	// output is the maximum for each provider request.
	MaxInputTokens  int     `json:"max_input_tokens,omitempty"`
	MaxOutputTokens int     `json:"max_output_tokens,omitempty"`
	MaxCostUSD      float64 `json:"max_cost_usd,omitempty"`

	// CompactionThreshold controls when runtime compaction is triggered.
	// Value is a fraction in range [0,1]. 0 means use runtime default.
	CompactionThreshold float64 `json:"compaction_threshold,omitempty"`
}

type RunRequest

type RunRequest struct {
	Model           string                       `json:"model"`
	Objective       string                       `json:"objective,omitempty"`
	Input           RunInput                     `json:"input"`
	Options         RunOptions                   `json:"options"`
	ModelCapability contextmodel.ModelCapability `json:"-"`
	Retry           *FloretContinuationRetry     `json:"-"`
}

RunRequest is the internal run request for Go runtime execution.

type RunStartRequest

type RunStartRequest struct {
	ThreadID          string                   `json:"thread_id"`
	Model             string                   `json:"model"`
	Input             RunInput                 `json:"input"`
	Options           RunOptions               `json:"options"`
	StagingScopeID    string                   `json:"-"`
	StagingCapability string                   `json:"-"`
	Retry             *FloretContinuationRetry `json:"-"`
}

RunStartRequest is the HTTP request body for starting an AI run.

Notes: - thread_id is mandatory; the agent builds history from the persisted thread store. - history must NOT be provided by clients (agent is the source of truth).

type RunState

type RunState string

RunState is the normalized state machine for a single AI run.

const (
	RunStateIdle            RunState = "idle"
	RunStateAccepted        RunState = "accepted"
	RunStateRunning         RunState = "running"
	RunStateWaitingApproval RunState = "waiting_approval"
	RunStateRecovering      RunState = "recovering"
	RunStateFinalizing      RunState = "finalizing"
	RunStateWaitingUser     RunState = "waiting_user"
	RunStateSuccess         RunState = "success"
	RunStateFailed          RunState = "failed"
	RunStateCanceled        RunState = "canceled"
	RunStateTimedOut        RunState = "timed_out"
)

func NormalizeRunState

func NormalizeRunState(raw string) RunState

type SaveUploadRequest added in v0.11.0

type SaveUploadRequest struct {
	Owner                 UploadOwner
	StagingScopeID        string
	StagingCapability     string
	Reader                io.Reader
	DisplayName           string
	DeclaredMediaType     string
	Source                string
	UploadRequestID       string
	ExpectedContentSHA256 string
	ExpectedSizeBytes     int64
	DisplayNameSHA256     string
	MaxBytes              int64
}

type SendUserTurnRequest

type SendUserTurnRequest struct {
	StorageGeneration string               `json:"storage_generation,omitempty"`
	ClientRequestID   string               `json:"client_request_id,omitempty"`
	ThreadID          string               `json:"thread_id"`
	Create            *CreateThreadRequest `json:"create,omitempty"`
	StagingScopeID    string               `json:"staging_scope_id,omitempty"`
	StagingCapability string               `json:"-"`
	Model             string               `json:"model,omitempty"`
	Input             RunInput             `json:"input"`
	Options           RunOptions           `json:"options"`
}

type SendUserTurnResponse

type SendUserTurnResponse struct {
	ClientRequestID       string               `json:"client_request_id"`
	ThreadID              string               `json:"thread_id"`
	RunID                 string               `json:"run_id"`
	TurnID                string               `json:"turn_id"`
	Kind                  string               `json:"kind"` // "start" | "queued"
	QueueID               string               `json:"queue_id,omitempty"`
	QueuePosition         int                  `json:"queue_position,omitempty"`
	AppliedPermissionType string               `json:"applied_permission_type,omitempty"`
	Current               flruntime.ThreadView `json:"current"`
}

func (SendUserTurnResponse) MarshalJSON added in v0.11.0

func (r SendUserTurnResponse) MarshalJSON() ([]byte, error)

type Service

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

func NewService

func NewService(opts Options) (*Service, error)

func NewServiceContext added in v0.11.0

func NewServiceContext(ctx context.Context, opts Options) (*Service, error)

func (*Service) Activate added in v0.13.0

func (s *Service) Activate(ctx context.Context) error

Activate is the final preparation boundary. The controller calls it only after checking that the selected options still belong to its current attempt.

func (*Service) ActiveRunCount

func (s *Service) ActiveRunCount(endpointID string) int

ActiveRunCount returns the number of active runs for the given endpoint.

When endpointID is empty, it returns the global active run count.

func (*Service) AdoptOrphanCanonicalRoot added in v0.11.0

func (service *Service) AdoptOrphanCanonicalRoot(ctx context.Context, req AdoptOrphanCanonicalRootRequest) (int, error)

func (*Service) AttachmentCapabilities added in v0.11.0

func (s *Service) AttachmentCapabilities(ctx context.Context, modelID string) AttachmentCapabilities

func (*Service) BrowseSkillFile

func (s *Service) BrowseSkillFile(skillPath string, file string, encoding string, maxBytes int) (*SkillBrowseFileResult, error)

func (*Service) BrowseSkillTree

func (s *Service) BrowseSkillTree(skillPath string, dir string) (*SkillBrowseTreeResult, error)

func (*Service) CancelThread

func (s *Service) CancelThread(meta *session.Meta, threadID string) error

func (*Service) CheckMCPServer added in v0.13.0

func (s *Service) CheckMCPServer(ctx context.Context, id string, revision int64) (MCPCatalog, error)

func (*Service) ClearThreadReasoningSelection added in v0.7.2

func (s *Service) ClearThreadReasoningSelection(ctx context.Context, meta *session.Meta, threadID string) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) ComputerAccess added in v0.13.0

func (s *Service) ComputerAccess(ctx context.Context, meta *session.Meta, threadID string) (ComputerAccess, error)

func (*Service) ComputerBrowserCandidates added in v0.13.0

func (s *Service) ComputerBrowserCandidates(ctx context.Context, meta *session.Meta, threadID, endpoint string) (ComputerTargetInventory, error)

Advanced discovery uses the same expiring, thread-scoped candidates as all other page selection. Merely entering an endpoint never connects a page.

func (*Service) ComputerBrowserInstallation added in v0.13.0

func (s *Service) ComputerBrowserInstallation(ctx context.Context, meta *session.Meta) (browserinstall.Status, error)

func (*Service) ComputerBrowserTabs added in v0.13.0

func (s *Service) ComputerBrowserTabs(ctx context.Context, meta *session.Meta, endpoint string) ([]ComputerBrowserTab, error)

func (*Service) ComputerCandidates added in v0.13.0

func (s *Service) ComputerCandidates(ctx context.Context, meta *session.Meta, threadID string) (ComputerTargetInventory, error)

func (*Service) ComputerEnvironment added in v0.13.0

func (s *Service) ComputerEnvironment(ctx context.Context, meta *session.Meta) (ComputerEnvironment, error)

func (*Service) ComputerExtensionConnectionStatus added in v0.13.0

func (s *Service) ComputerExtensionConnectionStatus(ctx context.Context, meta *session.Meta) (ComputerExtensionStatus, error)

func (*Service) ComputerExtensionTabs added in v0.13.0

func (s *Service) ComputerExtensionTabs(ctx context.Context, meta *session.Meta, profileID string) ([]ComputerBrowserTab, error)

func (*Service) ComputerTarget added in v0.13.0

func (s *Service) ComputerTarget(ctx context.Context, meta *session.Meta, threadID string) (string, error)

func (*Service) ConnectComputerBrowser added in v0.13.0

func (s *Service) ConnectComputerBrowser(ctx context.Context, meta *session.Meta, connection ComputerBrowserConnection) (TargetDescriptor, error)

ConnectComputerBrowser exposes the explicit user-authorized browser bridge without creating a second executor owner in the HTTP layer.

func (*Service) CreateSkill

func (s *Service) CreateSkill(scope string, name string, description string, body string) (*SkillCatalog, error)

func (*Service) CreateThread

func (s *Service) CreateThread(ctx context.Context, meta *session.Meta, title string, modelID string, permissionType string, workingDir string) (*ThreadView, error)

func (*Service) CreateThreadWithOptions added in v0.7.2

func (s *Service) CreateThreadWithOptions(ctx context.Context, meta *session.Meta, req CreateThreadRequest) (*ThreadView, error)

func (*Service) CreateUploadStagingScope added in v0.11.0

func (s *Service) CreateUploadStagingScope(ctx context.Context, owner UploadOwner, targetID string) (UploadStagingScopeResponse, error)

func (*Service) DeleteMCPServer added in v0.13.0

func (s *Service) DeleteMCPServer(id string, revision int64) (MCPCatalog, error)

func (*Service) DeleteOrphanCanonicalRoot added in v0.11.0

func (service *Service) DeleteOrphanCanonicalRoot(ctx context.Context, req DeleteOrphanCanonicalRootRequest) (int, error)

func (*Service) DeleteQueuedInput added in v0.11.0

func (s *Service) DeleteQueuedInput(ctx context.Context, meta *session.Meta, threadID string, queueID string) error

func (*Service) DeleteSkill

func (s *Service) DeleteSkill(scope string, name string) (*SkillCatalog, error)

func (*Service) DeleteStagedUpload added in v0.11.0

func (s *Service) DeleteStagedUpload(ctx context.Context, owner UploadOwner, uploadID string) error

func (*Service) DeleteStagingScopeUpload added in v0.11.0

func (s *Service) DeleteStagingScopeUpload(ctx context.Context, owner UploadOwner, stagingScopeID, capability, uploadID string) error

func (*Service) DeleteThread

func (s *Service) DeleteThread(ctx context.Context, meta *session.Meta, threadID string, force bool) error

func (*Service) DesktopModelSourceBindingSnapshot added in v0.6.8

func (s *Service) DesktopModelSourceBindingSnapshot() runtimeservice.Binding

func (*Service) DesktopModelSourceBindingStatus added in v0.6.8

func (s *Service) DesktopModelSourceBindingStatus(ctx context.Context) runtimeservice.Binding

func (*Service) DisconnectComputerBrowser added in v0.13.0

func (s *Service) DisconnectComputerBrowser(ctx context.Context, meta *session.Meta, targetID string) error

func (*Service) DisconnectDesktopModelSource added in v0.6.8

func (s *Service) DisconnectDesktopModelSource() *AIRuntimeStatus

func (*Service) DiscoverModelCatalog added in v0.13.0

func (s *Service) DiscoverModelCatalog(ctx context.Context, in ModelCatalogRequest) (ModelCatalogResponse, error)

DiscoverModelCatalog queries an explicitly selected endpoint without changing configuration, installing models, or retaining credentials in catalog data.

func (*Service) Enabled

func (s *Service) Enabled() bool

func (*Service) FlowerLiveMetrics added in v0.11.0

func (s *Service) FlowerLiveMetrics() FlowerLiveMetricsSnapshot

func (*Service) ForkThread added in v0.7.1

func (s *Service) ForkThread(ctx context.Context, meta *session.Meta, sourceThreadID string, title string) (*ThreadView, error)

func (*Service) ForkThreadWithOptions added in v0.11.0

func (s *Service) ForkThreadWithOptions(ctx context.Context, meta *session.Meta, sourceThreadID string, req ForkThreadRequest) (*ThreadView, error)

func (*Service) GetFlowerSubagentDetail added in v0.7.2

func (service *Service) GetFlowerSubagentDetail(ctx context.Context, meta *session.Meta, parentThreadID, childThreadID string) (*FlowerSubagentDetailResponse, error)

func (*Service) GetFlowerThreadDetail added in v0.11.0

func (s *Service) GetFlowerThreadDetail(ctx context.Context, meta *session.Meta, threadID string) (*FlowerThreadDetail, error)

GetFlowerThreadDetail is the single detail read boundary for Flower. The product thread metadata remains owned by Redeven while Floret supplies the renderable current view; callers must replace both fields together.

func (*Service) GetThread

func (s *Service) GetThread(ctx context.Context, meta *session.Meta, threadID string) (*ThreadView, error)

func (*Service) ImportGitHubSkills

func (s *Service) ImportGitHubSkills(req SkillGitHubImportRequest) (*SkillGitHubImportResult, error)

func (*Service) InputComputerControl added in v0.13.0

func (s *Service) InputComputerControl(ctx context.Context, meta *session.Meta, request ComputerUserInput) error

func (*Service) InstallComputerBrowser added in v0.13.0

func (s *Service) InstallComputerBrowser(ctx context.Context, meta *session.Meta, request ComputerBrowserInstallRequest) (browserinstall.Status, error)

func (*Service) ListComputerTargets added in v0.13.0

func (s *Service) ListComputerTargets(ctx context.Context, meta *session.Meta) ([]TargetDescriptor, error)

func (*Service) ListFlowerSubagents added in v0.7.2

func (service *Service) ListFlowerSubagents(ctx context.Context, meta *session.Meta, parentThreadID string) ([]FlowerSubagentSummary, error)

func (*Service) ListGitHubSkillCatalog

func (s *Service) ListGitHubSkillCatalog(req SkillGitHubCatalogRequest) (*SkillGitHubCatalog, error)

func (*Service) ListMCPServers added in v0.13.0

func (s *Service) ListMCPServers() (MCPCatalog, error)

func (*Service) ListModels

func (s *Service) ListModels() (*ModelsResponse, error)

func (*Service) ListSkillSources

func (s *Service) ListSkillSources() (*SkillSourcesView, error)

func (*Service) ListSkillsCatalog

func (s *Service) ListSkillsCatalog() (*SkillCatalog, error)

func (*Service) ListThreadMessages

func (s *Service) ListThreadMessages(ctx context.Context, meta *session.Meta, threadID string, limit int, beforeID int64) (*ListThreadMessagesResponse, error)

func (*Service) ListThreads

func (s *Service) ListThreads(ctx context.Context, meta *session.Meta, limit int, cursor string) (*ListThreadsResponse, error)

func (*Service) ManagedBrowserProfiles added in v0.13.0

func (s *Service) ManagedBrowserProfiles(ctx context.Context, meta *session.Meta, name string) ([]ComputerManagedProfile, error)

func (*Service) ManagedBrowserTabs added in v0.13.0

func (s *Service) ManagedBrowserTabs(ctx context.Context, meta *session.Meta, profileID string) ([]ComputerBrowserTab, error)

func (*Service) MovePinnedThread added in v0.13.0

func (s *Service) MovePinnedThread(ctx context.Context, meta *session.Meta, threadID, anchorID, placement string) ([]threadstore.ThreadPinMetadata, error)

MovePinnedThread changes only Redeven navigation metadata, including during an active Turn.

func (*Service) OpenCanonicalLiveAttachmentForTurn added in v0.11.0

func (service *Service) OpenCanonicalLiveAttachmentForTurn(ctx context.Context, owner UploadOwner, threadID, turnID, attachmentID string) (*OpenUploadResult, error)

func (*Service) OpenComputerExtension added in v0.13.0

func (s *Service) OpenComputerExtension(ctx context.Context, meta *session.Meta, action, installationID string) error

Only explicit UI commands open native applications. Neither model tools nor caller-provided paths, URLs or command arguments reach this boundary.

func (*Service) OpenLiveUpload added in v0.11.0

func (s *Service) OpenLiveUpload(ctx context.Context, owner UploadOwner, threadID string, turnID string, uploadID string, authority LiveAttachmentCanonicalAuthority) (*OpenUploadResult, error)

func (*Service) OpenQueuedUpload added in v0.11.0

func (s *Service) OpenQueuedUpload(ctx context.Context, owner UploadOwner, threadID, queueID, uploadID string) (*OpenUploadResult, error)

func (*Service) OpenStagingUpload added in v0.11.0

func (s *Service) OpenStagingUpload(ctx context.Context, owner UploadOwner, stagingScopeID, capability, uploadID string) (*OpenUploadResult, error)

func (*Service) OrphanCanonicalRootIssueCount added in v0.11.0

func (service *Service) OrphanCanonicalRootIssueCount() int

func (*Service) PatchSkillToggles

func (s *Service) PatchSkillToggles(patches []SkillTogglePatch) (*SkillCatalog, error)

func (*Service) PrepareDesktopModelSource added in v0.6.8

func (s *Service) PrepareDesktopModelSource(session DesktopModelSourceSession) (*AIRuntimeStatus, error)

func (*Service) PromoteQueuedInput added in v0.11.0

func (s *Service) PromoteQueuedInput(ctx context.Context, meta *session.Meta, threadID string, queueID string) (flruntime.ThreadView, error)

func (*Service) PublishFlowerComputerFrame added in v0.13.0

func (s *Service) PublishFlowerComputerFrame(meta *session.Meta, frame FlowerComputerFrame) error

PublishFlowerComputerFrame sends only the latest target-scoped frame metadata to observers. The frame is ephemeral and never enters the durable timeline.

func (*Service) PublishFlowerViewerReadState added in v0.11.0

func (s *Service) PublishFlowerViewerReadState(meta *session.Meta, threadID string, readStatus FlowerThreadReadView) error

PublishFlowerViewerReadState broadcasts a validated product-owned read state only to live views owned by the same endpoint user. Canonical shared batches never contain this viewer-private state.

func (*Service) ReadPrivateComputerFrame added in v0.13.0

func (s *Service) ReadPrivateComputerFrame(ctx context.Context, meta *session.Meta, request ComputerPrivateFrameRequest) ([]byte, error)

func (*Service) ReadStagingLongText added in v0.11.0

func (s *Service) ReadStagingLongText(ctx context.Context, owner UploadOwner, stagingScopeID, capability, uploadID string) (*StagedLongTextResponse, error)

func (*Service) ReadTerminalProcess added in v0.7.2

func (s *Service) ReadTerminalProcess(ctx context.Context, meta *session.Meta, runID string, processID string, afterSeq int64) (*terminalProcessSnapshot, error)

func (*Service) ReconcileCanonicalRootOwnership added in v0.11.0

func (service *Service) ReconcileCanonicalRootOwnership(ctx context.Context) (int, error)

func (*Service) RegisterRPC

func (s *Service) RegisterRPC(r *sessionrpc.Router, meta *session.Meta, streamServer flowersec.RPCPeer)

func (*Service) RegisterRPCWithAccessGate

func (s *Service) RegisterRPCWithAccessGate(r *sessionrpc.Router, meta *session.Meta, streamServer flowersec.RPCPeer, gate *accessgate.Gate)

func (*Service) ReinstallSkills

func (s *Service) ReinstallSkills(paths []string, overwrite bool) (*SkillReinstallResult, error)

func (*Service) ReleaseUploadStagingScope added in v0.11.0

func (s *Service) ReleaseUploadStagingScope(ctx context.Context, owner UploadOwner, stagingScopeID, capability string) error

func (*Service) ReloadSkillsCatalog

func (s *Service) ReloadSkillsCatalog() (*SkillCatalog, error)

func (*Service) RenameThread

func (s *Service) RenameThread(ctx context.Context, meta *session.Meta, threadID string, title string) error

func (*Service) ReorderQueue added in v0.11.0

func (s *Service) ReorderQueue(ctx context.Context, meta *session.Meta, threadID string, req ReorderQueueRequest) error

func (*Service) ResolveFlowerCanonicalReferenceOpenTarget added in v0.11.0

func (s *Service) ResolveFlowerCanonicalReferenceOpenTarget(ctx context.Context, meta *session.Meta, req FlowerCanonicalReferenceOpenRequest) (FlowerCanonicalReferenceOpenTarget, error)

func (*Service) ResolveFlowerFileActionOpenTarget added in v0.7.1

func (s *Service) ResolveFlowerFileActionOpenTarget(ctx context.Context, meta *session.Meta, req FlowerFileActionOpenRequest) (FlowerFileActionOpenTarget, error)

func (*Service) ResolveTargetToolAttachment added in v0.13.0

func (s *Service) ResolveTargetToolAttachment(ctx context.Context, resourceRef string) ([]byte, error)

ResolveTargetToolAttachment exposes a short-lived target screenshot to the authenticated Flower media boundary. The executor remains the sole owner of the bytes; Service only provides the runtime access boundary.

func (*Service) ResolveTargetToolAttachmentForThread added in v0.13.0

func (s *Service) ResolveTargetToolAttachmentForThread(ctx context.Context, meta *session.Meta, threadID, targetID, resourceRef string) ([]byte, error)

ResolveTargetToolAttachmentForThread enforces that a frame was emitted by the requested thread and target before expanding its opaque bytes.

func (*Service) RetryThreadContinuation added in v0.11.0

func (s *Service) RetryThreadContinuation(ctx context.Context, meta *session.Meta, threadID string) (RetryThreadContinuationResponse, error)

func (*Service) RevealComputerTarget added in v0.13.0

func (s *Service) RevealComputerTarget(ctx context.Context, meta *session.Meta, threadID, targetID string) error

Reveal is an authenticated user action on the already bound browser page. It never changes selection, grants, private control, or canonical execution.

func (*Service) ReviewOrphanCanonicalRoots added in v0.11.0

func (service *Service) ReviewOrphanCanonicalRoots(ctx context.Context) (OrphanCanonicalRootReview, error)

func (*Service) RuntimeStatus added in v0.6.4

func (s *Service) RuntimeStatus(ctx context.Context) *AIRuntimeStatus

func (*Service) SaveMCPServer added in v0.13.0

func (s *Service) SaveMCPServer(ctx context.Context, input MCPServerInput) (MCPCatalog, error)

func (*Service) SaveUpload

func (s *Service) SaveUpload(ctx context.Context, req SaveUploadRequest) (*UploadResponse, error)

func (*Service) SelectComputerCandidate added in v0.13.0

func (s *Service) SelectComputerCandidate(ctx context.Context, meta *session.Meta, threadID, ref string) (TargetDescriptor, error)

func (*Service) SelectComputerTarget added in v0.13.0

func (s *Service) SelectComputerTarget(ctx context.Context, meta *session.Meta, threadID, targetID string) error

func (*Service) SendUserTurn

func (s *Service) SendUserTurn(ctx context.Context, meta *session.Meta, req SendUserTurnRequest) (SendUserTurnResponse, error)

func (*Service) ServeDesktopModelSourceRPC added in v0.6.8

func (s *Service) ServeDesktopModelSourceRPC(ctx context.Context, session DesktopModelSourceSession, ws *websocket.Conn, onChange func()) error

func (*Service) SetComputerAccess added in v0.13.0

func (s *Service) SetComputerAccess(ctx context.Context, meta *session.Meta, threadID string, access ComputerAccess) error

func (*Service) SetComputerBrowserEnabled added in v0.13.0

func (s *Service) SetComputerBrowserEnabled(ctx context.Context, meta *session.Meta, enabled bool) (browserinstall.Status, error)

func (*Service) SetComputerUseEnabled added in v0.13.0

func (s *Service) SetComputerUseEnabled(enabled bool, persist func(next *config.AIConfig) error) error

SetComputerUseEnabled updates whether future Flower turns may use browser and desktop interaction tools. Existing runs keep their admitted tool surface; the setting applies when a new run is prepared.

func (*Service) SetComputerViewer added in v0.13.0

func (s *Service) SetComputerViewer(ctx context.Context, meta *session.Meta, request ComputerViewerRequest) error

func (*Service) SetCurrentModelID

func (s *Service) SetCurrentModelID(modelID string, persist func(next *config.AIConfig) error) error

SetCurrentModelID updates current_model_id while keeping the provider/model registry unchanged.

Unlike UpdateConfig, this method is lightweight and allowed while runs are active because it only changes the current model for future chats.

func (*Service) SetDefaultPermissionType added in v0.10.0

func (s *Service) SetDefaultPermissionType(permissionType string, persist func(next *config.AIConfig) error) error

SetDefaultPermissionType updates the default permission for future Flower threads without changing the environment model profile or active runs.

func (*Service) SetModelProfile added in v0.10.0

func (s *Service) SetModelProfile(profile *config.AIModelProfile, persist func(next *config.AIConfig) error) error

SetModelProfile replaces the environment model profile while preserving Flower defaults and runtime recovery settings. Passing nil clears only the model profile.

func (*Service) SetThreadModel

func (s *Service) SetThreadModel(ctx context.Context, meta *session.Meta, threadID string, modelID string) error

func (*Service) SetThreadPermissionType added in v0.7.2

func (s *Service) SetThreadPermissionType(ctx context.Context, meta *session.Meta, threadID string, permissionType string) error

func (*Service) SetThreadPinned added in v0.7.1

func (s *Service) SetThreadPinned(ctx context.Context, meta *session.Meta, threadID string, pinned bool) (*ThreadView, error)

func (*Service) SetThreadReasoningSelection added in v0.7.2

func (s *Service) SetThreadReasoningSelection(ctx context.Context, meta *session.Meta, threadID string, selection config.AIReasoningSelection) error

func (*Service) SetWorkloadAdmission added in v0.11.0

func (s *Service) SetWorkloadAdmission(admit WorkloadAdmission)

func (*Service) SetupComputerExtension added in v0.13.0

func (s *Service) SetupComputerExtension(ctx context.Context, meta *session.Meta, installation string) (ComputerExtensionSetup, error)

Initial setup is an explicit local user command. Later Runtime starts restore that registration; neither path binds a tab or creates a thread grant.

func (*Service) StopThread

func (s *Service) StopThread(ctx context.Context, meta *session.Meta, threadID string) (StopThreadResponse, error)

StopThread asks Floret's single thread runtime owner to cancel the current turn. Cancel is idempotent for every known thread, including a thread whose provider effect adapter is not resident in this process.

func (*Service) StorageGeneration added in v0.13.0

func (s *Service) StorageGeneration() string

StorageGeneration identifies a restored data set, not an execution or lease.

func (*Service) SubmitFlowerApproval added in v0.7.1

func (s *Service) SubmitFlowerApproval(meta *session.Meta, req SubmitFlowerApprovalRequest) (SubmitFlowerApprovalResponse, error)

SubmitFlowerApproval atomically resolves the explicitly selected interactions. The command returns after the thread runtime updates its current view; provider continuation is dispatched independently by Floret.

func (*Service) SubmitRequestUserInputResponse added in v0.7.1

func (*Service) SubscribeFlowerLiveStream added in v0.11.0

func (s *Service) SubscribeFlowerLiveStream(ctx context.Context, meta *session.Meta, _ FlowerLiveStreamRequest) (*FlowerLiveStreamSubscription, error)

func (*Service) TerminateTerminalProcess added in v0.7.2

func (s *Service) TerminateTerminalProcess(ctx context.Context, meta *session.Meta, runID string, processID string) (*terminalProcessSnapshot, error)

func (*Service) ThreadReadState added in v0.13.0

func (s *Service) ThreadReadState() *threadreadstate.Store

ThreadReadState belongs to this service generation. Callers must retain their generation lease until all reads and writes through this handle complete.

func (*Service) ToolTargetPolicy added in v0.7.1

func (s *Service) ToolTargetPolicy() ToolTargetPolicy

func (*Service) UpdateConfig

func (s *Service) UpdateConfig(next *config.AIConfig, persist func() error) error

UpdateConfig updates the in-memory AI config after persisting it via the provided callback.

Active runs keep their existing run-local config snapshot. The updated config applies to runs created after this method returns.

func (*Service) UpdateFilesystemScope added in v0.6.8

func (s *Service) UpdateFilesystemScope(scope *filesystemscope.Registry) error

UpdateFilesystemScope refreshes the in-memory filesystem roots for future runs.

func (*Service) ValidateGitHubSkillImport

func (s *Service) ValidateGitHubSkillImport(req SkillGitHubImportRequest) (*SkillGitHubValidateResult, error)

func (*Service) ValidateWorkingDir

func (s *Service) ValidateWorkingDir(workingDir string) (string, error)

func (*Service) WriteTerminalProcess added in v0.7.2

func (s *Service) WriteTerminalProcess(ctx context.Context, meta *session.Meta, runID string, processID string, input string) (*terminalProcessSnapshot, error)

type SkillActivation

type SkillActivation struct {
	ActivationID    string               `json:"activation_id"`
	Name            string               `json:"name"`
	RootDir         string               `json:"root_dir"`
	Priority        int                  `json:"priority"`
	Content         string               `json:"content"`
	ContentRef      string               `json:"content_ref"`
	PermissionHints []string             `json:"permission_hints,omitempty"`
	Dependencies    []SkillMCPDependency `json:"dependencies,omitempty"`
	ActivatedAt     int64                `json:"activated_at_unix_ms"`
}

type SkillBrowseFileResult

type SkillBrowseFileResult struct {
	Root      string `json:"root"`
	File      string `json:"file"`
	Encoding  string `json:"encoding"`
	Truncated bool   `json:"truncated"`
	Size      int64  `json:"size"`
	Content   string `json:"content"`
}

type SkillBrowseTreeEntry

type SkillBrowseTreeEntry struct {
	Name             string `json:"name"`
	Path             string `json:"path"`
	IsDir            bool   `json:"is_dir"`
	Size             int64  `json:"size"`
	ModifiedAtUnixMs int64  `json:"modified_at_unix_ms"`
}

type SkillBrowseTreeResult

type SkillBrowseTreeResult struct {
	Root    string                 `json:"root"`
	Dir     string                 `json:"dir"`
	Entries []SkillBrowseTreeEntry `json:"entries"`
}

type SkillCatalog

type SkillCatalog struct {
	CatalogVersion int64                `json:"catalog_version"`
	Skills         []SkillCatalogEntry  `json:"skills"`
	Conflicts      []SkillCatalogNotice `json:"conflicts,omitempty"`
	Errors         []SkillCatalogNotice `json:"errors,omitempty"`
}

type SkillCatalogEntry

type SkillCatalogEntry struct {
	ID                      string               `json:"id"`
	Icons                   []ExtensionIcon      `json:"icons,omitempty"`
	Name                    string               `json:"name"`
	Description             string               `json:"description"`
	Path                    string               `json:"path"`
	Scope                   string               `json:"scope"`
	Priority                int                  `json:"priority,omitempty"`
	PermissionHints         []string             `json:"permission_hints,omitempty"`
	AllowImplicitInvocation bool                 `json:"allow_implicit_invocation"`
	Dependencies            []SkillMCPDependency `json:"dependencies,omitempty"`
	DependencyState         string               `json:"dependency_state,omitempty"`
	Enabled                 bool                 `json:"enabled"`
	Effective               bool                 `json:"effective"`
	ShadowedBy              string               `json:"shadowed_by,omitempty"`
}

type SkillCatalogNotice

type SkillCatalogNotice struct {
	Name       string `json:"name,omitempty"`
	Path       string `json:"path,omitempty"`
	Message    string `json:"message,omitempty"`
	WinnerPath string `json:"winner_path,omitempty"`
}

type SkillError

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

func AsSkillError

func AsSkillError(err error) (*SkillError, bool)

func (*SkillError) Code

func (e *SkillError) Code() string

func (*SkillError) Error

func (e *SkillError) Error() string

func (*SkillError) HTTPStatus

func (e *SkillError) HTTPStatus() int

func (*SkillError) Unwrap

func (e *SkillError) Unwrap() error

type SkillGitHubAuth

type SkillGitHubAuth struct {
	GitHubToken            string `json:"github_token,omitempty"`
	UseLocalGitCredentials bool   `json:"use_local_git_credentials,omitempty"`
}

type SkillGitHubCatalog

type SkillGitHubCatalog struct {
	Source SkillGitHubCatalogSource `json:"source"`
	Skills []SkillGitHubCatalogItem `json:"skills"`
}

type SkillGitHubCatalogItem

type SkillGitHubCatalogItem struct {
	RemoteID       string   `json:"remote_id"`
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	RepoPath       string   `json:"repo_path"`
	ExistsLocal    bool     `json:"exists_local"`
	InstalledPaths []string `json:"installed_paths,omitempty"`
}

type SkillGitHubCatalogRequest

type SkillGitHubCatalogRequest struct {
	Repo        string `json:"repo,omitempty"`
	Ref         string `json:"ref,omitempty"`
	BasePath    string `json:"base_path,omitempty"`
	ForceReload bool   `json:"force_reload,omitempty"`
}

type SkillGitHubCatalogSource

type SkillGitHubCatalogSource struct {
	Repo     string `json:"repo"`
	Ref      string `json:"ref"`
	BasePath string `json:"base_path"`
}

type SkillGitHubImportItem

type SkillGitHubImportItem struct {
	Name            string          `json:"name"`
	Scope           string          `json:"scope"`
	SkillPath       string          `json:"skill_path"`
	SourceType      SkillSourceType `json:"source_type"`
	SourceID        string          `json:"source_id"`
	InstallMode     string          `json:"install_mode"`
	InstalledCommit string          `json:"installed_commit,omitempty"`
}

type SkillGitHubImportRequest

type SkillGitHubImportRequest struct {
	Scope     string          `json:"scope"`
	Repo      string          `json:"repo,omitempty"`
	Ref       string          `json:"ref,omitempty"`
	Paths     []string        `json:"paths,omitempty"`
	URL       string          `json:"url,omitempty"`
	Overwrite bool            `json:"overwrite,omitempty"`
	Auth      SkillGitHubAuth `json:"auth,omitempty"`
}

type SkillGitHubImportResult

type SkillGitHubImportResult struct {
	Catalog SkillCatalog            `json:"catalog"`
	Imports []SkillGitHubImportItem `json:"imports"`
}

type SkillGitHubResolvedSkill

type SkillGitHubResolvedSkill struct {
	Name            string `json:"name"`
	Description     string `json:"description"`
	Scope           string `json:"scope,omitempty"`
	Repo            string `json:"repo"`
	Ref             string `json:"ref"`
	RepoPath        string `json:"repo_path"`
	TargetDir       string `json:"target_dir"`
	TargetSkillPath string `json:"target_skill_path"`
	AlreadyExists   bool   `json:"already_exists"`
}

type SkillGitHubValidateResult

type SkillGitHubValidateResult struct {
	Resolved []SkillGitHubResolvedSkill `json:"resolved"`
}

type SkillMCPDependency

type SkillMCPDependency struct {
	Name      string `json:"name,omitempty" yaml:"name"`
	Transport string `json:"transport,omitempty" yaml:"transport"`
	Command   string `json:"command,omitempty" yaml:"command"`
	URL       string `json:"url,omitempty" yaml:"url"`
}

type SkillMeta

type SkillMeta struct {
	Name                    string               `json:"name"`
	Description             string               `json:"description"`
	Path                    string               `json:"path"`
	Scope                   string               `json:"scope"`
	Priority                int                  `json:"priority,omitempty"`
	PermissionHints         []string             `json:"permission_hints,omitempty"`
	AllowImplicitInvocation bool                 `json:"allow_implicit_invocation"`
	Dependencies            []SkillMCPDependency `json:"dependencies,omitempty"`
}

type SkillReinstallItem

type SkillReinstallItem struct {
	SkillPath   string `json:"skill_path"`
	SourceID    string `json:"source_id"`
	InstallMode string `json:"install_mode"`
}

type SkillReinstallResult

type SkillReinstallResult struct {
	Catalog     SkillCatalog         `json:"catalog"`
	Reinstalled []SkillReinstallItem `json:"reinstalled"`
}

type SkillSourceRecord

type SkillSourceRecord struct {
	SkillPath           string          `json:"skill_path"`
	SourceType          SkillSourceType `json:"source_type"`
	SourceID            string          `json:"source_id"`
	Repo                string          `json:"repo,omitempty"`
	Ref                 string          `json:"ref,omitempty"`
	RepoPath            string          `json:"repo_path,omitempty"`
	InstallMode         string          `json:"install_mode,omitempty"`
	InstalledCommit     string          `json:"installed_commit,omitempty"`
	InstalledAtUnixMs   int64           `json:"installed_at_unix_ms,omitempty"`
	LastCheckedAtUnixMs int64           `json:"last_checked_at_unix_ms,omitempty"`
}

type SkillSourceType

type SkillSourceType string
const (
	SkillSourceTypeLocalManual SkillSourceType = "local_manual"
	SkillSourceTypeGitHub      SkillSourceType = "github_import"
	SkillSourceTypeSystem      SkillSourceType = "system_bundle"
)

type SkillSourcesView

type SkillSourcesView struct {
	Items []SkillSourceRecord `json:"items"`
}

type SkillTogglePatch

type SkillTogglePatch struct {
	Path    string `json:"path"`
	Enabled bool   `json:"enabled"`
}

type SourceRef

type SourceRef struct {
	Title string `json:"title,omitempty"`
	URL   string `json:"url"`
}

type StagedLongTextResponse added in v0.11.0

type StagedLongTextResponse struct {
	Attachment    *UploadResponse `json:"attachment"`
	Text          string          `json:"text"`
	ContentSHA256 string          `json:"content_sha256"`
}

type StopThreadResponse

type StopThreadResponse struct {
	OK bool `json:"ok"`
}

type StreamEvent

type StreamEvent struct {
	HostedToolEvent *flprovider.Event `json:"-"`
	Type            StreamEventType   `json:"type"`
	Text            string            `json:"text,omitempty"`
	ToolCall        *PartialToolCall  `json:"tool_call,omitempty"`
	Usage           *PartialUsage     `json:"usage,omitempty"`
	FinishHint      string            `json:"finish_hint,omitempty"`
}

type StreamEventType

type StreamEventType string

StreamEventType is the normalized stream event kind produced by provider adapters.

const (
	StreamEventHostedTool    StreamEventType = "hosted_tool"
	StreamEventTextDelta     StreamEventType = "text_delta"
	StreamEventToolCallStart StreamEventType = "tool_call_start"
	StreamEventToolCallDelta StreamEventType = "tool_call_delta"
	StreamEventToolCallEnd   StreamEventType = "tool_call_end"
	StreamEventThinkingDelta StreamEventType = "thinking_delta"
	StreamEventUsage         StreamEventType = "usage"
	StreamEventFinishReason  StreamEventType = "finish_reason"
)

type SubmitFlowerApprovalRequest added in v0.7.1

type SubmitFlowerApprovalRequest struct {
	ThreadID       string   `json:"thread_id"`
	InteractionID  string   `json:"interaction_id,omitempty"`
	InteractionIDs []string `json:"interaction_ids,omitempty"`
	Approved       bool     `json:"approved"`
	RejectAll      bool     `json:"reject_all,omitempty"`
}

type SubmitFlowerApprovalResponse added in v0.7.1

type SubmitFlowerApprovalResponse struct {
	OK      bool                 `json:"ok"`
	Current flruntime.ThreadView `json:"current"`
}

func (SubmitFlowerApprovalResponse) MarshalJSON added in v0.11.0

func (r SubmitFlowerApprovalResponse) MarshalJSON() ([]byte, error)

type SubmitRequestUserInputResponseRequest added in v0.7.1

type SubmitRequestUserInputResponseRequest struct {
	ThreadID string                   `json:"thread_id"`
	Model    string                   `json:"model,omitempty"`
	Response RequestUserInputResponse `json:"response"`
	Input    RunInput                 `json:"input"`
	Options  RunOptions               `json:"options"`
}

type SubmitRequestUserInputResponseResponse added in v0.7.1

type SubmitRequestUserInputResponseResponse struct {
	Kind                    string               `json:"kind"`
	ConsumedWaitingPromptID string               `json:"consumed_waiting_prompt_id,omitempty"`
	AppliedPermissionType   string               `json:"applied_permission_type,omitempty"`
	Current                 flruntime.ThreadView `json:"current"`
}

func (SubmitRequestUserInputResponseResponse) MarshalJSON added in v0.11.0

func (r SubmitRequestUserInputResponseResponse) MarshalJSON() ([]byte, error)

type TargetDescriptor added in v0.13.0

type TargetDescriptor struct {
	ID              string   `json:"id"`
	Kind            string   `json:"kind"`
	DisplayName     string   `json:"display_name"`
	Locality        string   `json:"locality"`
	State           string   `json:"state,omitempty"`
	Reason          string   `json:"reason,omitempty"`
	Capabilities    []string `json:"capabilities,omitempty"`
	Ready           bool     `json:"ready"`
	PermissionState string   `json:"permission_state,omitempty"`
	CurrentURL      string   `json:"current_url,omitempty"`
	AppBundleID     string   `json:"app_bundle_id,omitempty"`
	// contains filtered or unexported fields
}

TargetDescriptor is the user-facing identity and capability snapshot for a computer-use target. The executor owns the actual target session; the registry only resolves logical aliases and prevents cross-target routing.

type TargetPreparer added in v0.13.0

type TargetPreparer interface {
	PrepareTarget(context.Context, TargetDescriptor) (TargetDescriptor, error)
}

type TargetRegistry added in v0.13.0

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

TargetRegistry owns target identities and readiness snapshots. It has no mutable current target or thread bindings; the Computer Use Runtime resolves persisted thread selection through the product store.

func NewTargetRegistry added in v0.13.0

func NewTargetRegistry() *TargetRegistry

func (*TargetRegistry) Register added in v0.13.0

func (r *TargetRegistry) Register(target TargetDescriptor) error

func (*TargetRegistry) ResolveTarget added in v0.13.0

func (r *TargetRegistry) ResolveTarget(_ context.Context, alias string) (TargetDescriptor, error)

func (*TargetRegistry) Snapshot added in v0.13.0

func (r *TargetRegistry) Snapshot() []TargetDescriptor

func (*TargetRegistry) Update added in v0.13.0

func (r *TargetRegistry) Update(target TargetDescriptor) error

Update replaces a target readiness snapshot without changing the current alias. Adapters call this when a helper disconnects or permissions change.

type TargetResolver added in v0.13.0

type TargetResolver interface {
	ResolveTarget(ctx context.Context, alias string) (TargetDescriptor, error)
}

TargetResolver maps the model-safe "current" alias to an executor target. It is deliberately separate from TargetToolExecutor so target selection is observable and testable without starting a browser or desktop helper.

type TargetStartupError added in v0.13.0

type TargetStartupError struct{ Code, Reason string }

func (*TargetStartupError) Error added in v0.13.0

func (e *TargetStartupError) Error() string

type TargetToolAttachment added in v0.13.0

type TargetToolAttachment struct {
	ResourceRef string `json:"resource_ref"`
	Name        string `json:"name,omitempty"`
	MIMEType    string `json:"mime_type"`
	SizeBytes   int64  `json:"size_bytes,omitempty"`
	SHA256      string `json:"sha256,omitempty"`
}

type TargetToolAttachmentResolver added in v0.13.0

type TargetToolAttachmentResolver interface {
	ResolveTargetToolAttachment(ctx context.Context, resourceRef string) ([]byte, error)
}

TargetToolAttachmentResolver expands opaque media references returned by a target executor. Bytes stay owned by the executor and are never persisted in tool results or provider state.

type TargetToolCall added in v0.7.1

type TargetToolCall struct {
	ThreadID             string          `json:"thread_id,omitempty"`
	TurnID               string          `json:"turn_id,omitempty"`
	RunID                string          `json:"run_id,omitempty"`
	ToolCallID           string          `json:"tool_call_id"`
	TargetID             string          `json:"target_id"`
	ToolName             string          `json:"tool_name"`
	Arguments            json.RawMessage `json:"arguments"`
	RequiredCapabilities []string        `json:"required_capabilities"`
	// contains filtered or unexported fields
}

type TargetToolExecutor added in v0.7.1

type TargetToolExecutor interface {
	ExecuteTargetTool(ctx context.Context, call TargetToolCall) (TargetToolResult, error)
}

type TargetToolResult added in v0.7.1

type TargetToolResult struct {
	TargetID          string                     `json:"target_id"`
	TargetName        string                     `json:"target_name,omitempty"`
	ExecutionLocation string                     `json:"execution_location,omitempty"`
	ActionSummary     string                     `json:"action_summary,omitempty"`
	Safety            *InteractionSafetyDecision `json:"safety,omitempty"`
	Result            any                        `json:"result,omitempty"`
	Attachments       []TargetToolAttachment     `json:"attachments,omitempty"`
	// contains filtered or unexported fields
}

type ThreadView

type ThreadView struct {
	Cancellation         *flruntime.ThreadCancellation `json:"cancellation,omitempty"`
	ThreadID             string                        `json:"thread_id"`
	Title                string                        `json:"title"`
	TitleStatus          string                        `json:"title_status"`
	TitleGeneration      int64                         `json:"title_generation"`
	ModelID              string                        `json:"model_id"`
	PermissionType       string                        `json:"permission_type"`
	WorkingDir           string                        `json:"working_dir"`
	QueuedTurnCount      int                           `json:"queued_turn_count"`
	QueuedTurns          []QueuedTurnView              `json:"queued_turns"`
	RunStatus            string                        `json:"run_status"`
	ReadOnlyReason       string                        `json:"read_only_reason,omitempty"`
	RunUpdatedAtUnixMs   int64                         `json:"run_updated_at_unix_ms"`
	RunErrorCode         string                        `json:"run_error_code,omitempty"`
	RunError             string                        `json:"run_error,omitempty"`
	WaitingPrompt        *RequestUserInputPrompt       `json:"waiting_prompt,omitempty"`
	ActiveRunID          string                        `json:"active_run_id,omitempty"`
	RunProgress          *FlowerRunProgress            `json:"run_progress,omitempty"`
	ApprovalPending      *bool                         `json:"approval_pending,omitempty"`
	ApprovalPendingCount int                           `json:"approval_pending_count,omitempty"`
	ReasoningSelection   config.AIReasoningSelection   `json:"reasoning_selection,omitempty"`
	ReasoningCapability  config.AIReasoningCapability  `json:"reasoning_capability,omitempty"`
	PinRank              int64                         `json:"pin_rank"`
	PinnedAtUnixMs       int64                         `json:"pinned_at_unix_ms,omitempty"`
	SettingsRevision     int64                         `json:"settings_revision"`
	CreatedAtUnixMs      int64                         `json:"created_at_unix_ms"`
	UpdatedAtUnixMs      int64                         `json:"updated_at_unix_ms"`
	LastMessageAtUnixMs  int64                         `json:"last_message_at_unix_ms"`
	LastMessagePreview   string                        `json:"last_message_preview"`
	Subagents            []FlowerSubagentSummary       `json:"subagents,omitempty"`
	ContextUsage         *FlowerContextUsage           `json:"context_usage,omitempty"`
	ContextCompactions   []FlowerContextCompaction     `json:"context_compactions,omitempty"`
	TimelineDecorations  []FlowerTimelineDecoration    `json:"timeline_decorations,omitempty"`
	FlowerActivity       FlowerThreadReadSnapshot      `json:"-"`
}

type TodoItem

type TodoItem struct {
	ID      string `json:"id"`
	Content string `json:"content"`
	Status  string `json:"status"`
}

type TodoSummary

type TodoSummary struct {
	Total      int `json:"total"`
	Pending    int `json:"pending"`
	InProgress int `json:"in_progress"`
	Completed  int `json:"completed"`
}

type ToolApprovalRequest

type ToolApprovalRequest struct {
	ToolID   string `json:"tool_id"`
	Approved bool   `json:"approved"`
}

type ToolAttachment added in v0.13.0

type ToolAttachment struct {
	ResourceRef string `json:"resource_ref"`
	Name        string `json:"name,omitempty"`
	MIMEType    string `json:"mime_type"`
	SizeBytes   int64  `json:"size_bytes,omitempty"`
	SHA256      string `json:"sha256,omitempty"`
}

type ToolCall

type ToolCall struct {
	ID   string         `json:"id"`
	Name string         `json:"name"`
	Args map[string]any `json:"args"`
}

type ToolCapabilityClass added in v0.7.2

type ToolCapabilityClass = permissionsnapshot.CapabilityClass

type ToolDef

type ToolDef struct {
	Name             string                       `json:"name"`
	Description      string                       `json:"description,omitempty"`
	InputSchema      json.RawMessage              `json:"input_schema,omitempty"`
	Mutating         bool                         `json:"mutating,omitempty"`
	RequiresApproval bool                         `json:"requires_approval,omitempty"`
	Visibility       ToolVisibilityClass          `json:"visibility,omitempty"`
	Capabilities     []ToolCapabilityClass        `json:"capabilities,omitempty"`
	Presentation     aitools.ToolPresentationSpec `json:"presentation,omitempty"`
	Source           string                       `json:"source,omitempty"`
	Namespace        string                       `json:"namespace,omitempty"`
	Priority         int                          `json:"priority,omitempty"`
}

func (ToolDef) HasCapability added in v0.7.2

func (d ToolDef) HasCapability(capability ToolCapabilityClass) bool

type ToolPermissionPolicy added in v0.7.2

type ToolPermissionPolicy = permissionsnapshot.ToolPolicy

type ToolResult

type ToolResult struct {
	ToolID      string             `json:"tool_id,omitempty"`
	ToolName    string             `json:"tool_name,omitempty"`
	Status      string             `json:"status"`
	Summary     string             `json:"summary,omitempty"`
	Details     string             `json:"details,omitempty"`
	Data        any                `json:"data,omitempty"`
	Pending     *PendingToolResult `json:"pending,omitempty"`
	Error       *aitools.ToolError `json:"error,omitempty"`
	Truncated   bool               `json:"truncated,omitempty"`
	ContentRef  string             `json:"content_ref,omitempty"`
	Attachments []ToolAttachment   `json:"attachments,omitempty"`
	// contains filtered or unexported fields
}

type ToolTargetPolicy added in v0.7.1

type ToolTargetPolicy struct {
	Mode             string   `json:"mode"`
	DefaultTargetID  string   `json:"default_target_id,omitempty"`
	AllowedTargetIDs []string `json:"allowed_target_ids,omitempty"`
}

type ToolVisibilityClass added in v0.7.2

type ToolVisibilityClass = permissionsnapshot.VisibilityClass

type TurnBudgets

type TurnBudgets struct {
	// MaxOutputToken limits one provider request, not cumulative run output.
	MaxOutputToken int     `json:"max_output_tokens,omitempty"`
	MaxCostUSD     float64 `json:"max_cost_usd,omitempty"`
}

type TurnUsage

type TurnUsage struct {
	InputTokens      int64 `json:"input_tokens,omitempty"`
	OutputTokens     int64 `json:"output_tokens,omitempty"`
	ReasoningTokens  int64 `json:"reasoning_tokens,omitempty"`
	CacheReadTokens  int64 `json:"cache_read_tokens,omitempty"`
	CacheWriteTokens int64 `json:"cache_write_tokens,omitempty"`
}

type UploadError added in v0.11.0

type UploadError struct {
	Code      string
	Retryable bool
	// contains filtered or unexported fields
}

func NewUploadError added in v0.11.0

func NewUploadError(code string, retryable bool, err error) *UploadError

func (*UploadError) Error added in v0.11.0

func (e *UploadError) Error() string

func (*UploadError) Unwrap added in v0.11.0

func (e *UploadError) Unwrap() error

type UploadOwner added in v0.11.0

type UploadOwner struct {
	EndpointID    string
	UserPublicID  string
	OwnerUserHash string
	ChannelID     string
}

func NewUploadOwner added in v0.11.0

func NewUploadOwner(endpointID string, userPublicID string, channelID string) (UploadOwner, error)

type UploadResponse

type UploadResponse struct {
	AttachmentID      string `json:"attachment_id"`
	URL               string `json:"url"`
	DownloadURL       string `json:"download_url"`
	LogicalLocator    string `json:"logical_locator"`
	Name              string `json:"name"`
	DisplayName       string `json:"display_name"`
	Size              int64  `json:"size"`
	SizeBytes         int64  `json:"size_bytes"`
	MimeType          string `json:"mime_type"`
	DetectedMediaType string `json:"detected_media_type"`
	ContentSHA256     string `json:"content_sha256"`
	UnicodeCodePoints *int64 `json:"unicode_code_points"`
	LogicalLineCount  *int64 `json:"logical_line_count"`
	Source            string `json:"source"`
}

type UploadStagingScopeResponse added in v0.11.0

type UploadStagingScopeResponse struct {
	StagingScopeID  string `json:"staging_scope_id"`
	TargetID        string `json:"target_id"`
	ExpiresAtUnixMs int64  `json:"expires_at_unix_ms"`
	Capability      string `json:"-"`
}

type WorkloadAdmission added in v0.11.0

type WorkloadAdmission func(runtimeservice.ManagedWorkload) (func(), error)

type XvfbTargetExecutor added in v0.13.0

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

XvfbTargetExecutor owns a private X11 display, its window manager, and input and capture commands. Its children outlive individual tool calls, but never the Runtime. BrowserTarget remains an independent, headless adapter.

func NewXvfbTargetExecutor added in v0.13.0

func NewXvfbTargetExecutor(stateDirectory string) *XvfbTargetExecutor

func (*XvfbTargetExecutor) CheckComputerSetup added in v0.13.0

func (e *XvfbTargetExecutor) CheckComputerSetup() error

CheckComputerSetup validates configured resources without starting a session.

func (*XvfbTargetExecutor) Close added in v0.13.0

func (e *XvfbTargetExecutor) Close() error

func (*XvfbTargetExecutor) EnsureTargetReady added in v0.13.0

func (e *XvfbTargetExecutor) EnsureTargetReady(ctx context.Context, _ string) error

func (*XvfbTargetExecutor) ExecuteComputerUserInput added in v0.13.0

func (e *XvfbTargetExecutor) ExecuteComputerUserInput(ctx context.Context, call TargetToolCall) ([]byte, error)

func (*XvfbTargetExecutor) ExecuteTargetTool added in v0.13.0

func (e *XvfbTargetExecutor) ExecuteTargetTool(ctx context.Context, call TargetToolCall) (TargetToolResult, error)

func (*XvfbTargetExecutor) ResolveTargetToolAttachment added in v0.13.0

func (e *XvfbTargetExecutor) ResolveTargetToolAttachment(ctx context.Context, ref string) ([]byte, error)

Source Files

Directories

Path Synopsis
context
Package pendinginputlegacy interprets the retired product queue format.
Package pendinginputlegacy interprets the retired product queue format.

Jump to

Keyboard shortcuts

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