Versions in this module Expand all Collapse all v0 v0.6.1 Oct 4, 2026 v0.6.0 Oct 3, 2026 Changes in this version + const ScopeTools + var ErrAgentRequired = errors.New("--agent <agent_id> is required") + var ErrNotLoggedIn = errors.New("not logged in") + var ErrReloginRequired = errors.New("refresh token rejected; run `authio clearance login` again") + func AwaitCallback(ctx context.Context, ln net.Listener, state string) (string, error) + func ChallengeS256(verifier string) string + func Humanize(err error, agentID string) string + func LoopbackListener(port int) (net.Listener, string, error) + func NewCodeVerifier() (string, error) + func NewState() (string, error) + func Root() (string, error) + func SetIntent(s string) + type APIError struct + Code string + Message string + Status int + func (e *APIError) Error() string + type AgentCredential struct + AccessToken string + AgentID string + AuthCoreURL string + ClearanceURL string + ClientID string + ExpiresAt time.Time + ProjectID string + RefreshToken string + SavedAt time.Time + Scope string + type ExecArgs struct + Args []string + Command string + Cwd string + TimeoutMS int + func (a ExecArgs) CommandLine() string + type Hosted struct + AgentID string + BaseURL string + HTTP *http.Client + Tokens *TokenSource + func (h *Hosted) CallTool(ctx context.Context, name string, args json.RawMessage, meta map[string]any) (json.RawMessage, *rpcError, error) + func (h *Hosted) Evaluate(ctx context.Context, provider, tool string, args map[string]any, intent string) (*Verdict, error) + func (h *Hosted) Initialize(ctx context.Context, intent string) error + func (h *Hosted) ListTools(ctx context.Context) ([]Tool, error) + func (h *Hosted) Policy(ctx context.Context) (json.RawMessage, error) + func (h *Hosted) SessionID() string + type OAuthClient struct + AuthCoreURL string + ClientID string + HTTP *http.Client + ProjectID string + Resource string + func (o *OAuthClient) AuthorizeURL(redirectURI, state, challenge, scope string) string + func (o *OAuthClient) Exchange(ctx context.Context, code, redirectURI, verifier string) (*tokenResponse, error) + func (o *OAuthClient) Refresh(ctx context.Context, refreshToken string) (*tokenResponse, error) + type OAuthError struct + Code string + Description string + Status int + func (e *OAuthError) Error() string + type Server struct + Hosted *Hosted + Log io.Writer + Providers []StdioProvider + Root string + func (s *Server) Serve(ctx context.Context, in io.Reader, out io.Writer) error + type SidecarConfig struct + Providers []StdioProvider + func LoadSidecarConfig(path string) (*SidecarConfig, error) + type StdioProvider struct + Args []string + Command string + Env map[string]string + Name string + type TokenSource struct + Cred *AgentCredential + Now func() time.Time + OAuth *OAuthClient + Store *TokenStore + func (t *TokenSource) Token(ctx context.Context) (string, error) + type TokenStore struct + Dir string + func DefaultTokenStore() (*TokenStore, error) + func (s *TokenStore) Delete(agentID string) error + func (s *TokenStore) Load(agentID string) (*AgentCredential, error) + func (s *TokenStore) Save(c AgentCredential) error + type Tool struct + Description string + InputSchema map[string]any + Name string + Title string + type ToolContent struct + Text string + Type string + type ToolResult struct + Content []ToolContent + IsError bool + Meta map[string]any + StructuredContent any + func RunExec(ctx context.Context, root string, a ExecArgs) (*ToolResult, error) + type Verdict struct + ApprovalID string + ExpiresAt *time.Time + PolicyID string + ReasonCode string + Rule string + Verdict string + VerdictID string