Documentation
¶
Overview ¶
Package api exposes a JSON HTTP API over an agencycli workspace for the web UI and integrations.
Index ¶
- Constants
- func ResolveAPIKey(flag string) string
- type DaemonStatusFunc
- type SchedulerManager
- type Server
- type UpdateChecker
- type UserStore
- func (s *UserStore) Authenticate(username, password string) *userRecord
- func (s *UserStore) ChangePassword(username, oldPass, newPass string) error
- func (s *UserStore) CreateUser(username, password, role, displayName, email, avatar, phone, bio string) error
- func (s *UserStore) DeleteUser(username string) error
- func (s *UserStore) GetUser(username string) *userRecord
- func (s *UserStore) HasProjectAccess(username, project string) (string, bool)
- func (s *UserStore) IssueToken(username string, dur time.Duration) string
- func (s *UserStore) ListUsers() []userRecord
- func (s *UserStore) Secret() string
- func (s *UserStore) UpdateUser(username string, role, displayName, email, avatar, phone, bio *string, ...) error
- func (s *UserStore) ValidateToken(token string) (string, bool)
Constants ¶
const ( RoleAdmin = "admin" RoleMember = "member" )
System roles.
const ( ProjectRoleViewer = "viewer" ProjectRoleOperator = "operator" ProjectRoleManager = "manager" )
Project-level roles (ascending privilege).
Variables ¶
This section is empty.
Functions ¶
func ResolveAPIKey ¶
ResolveAPIKey returns the API key from flag or AGENCYCLI_WEB_API_KEY.
Types ¶
type DaemonStatusFunc ¶
DaemonStatusFunc returns daemon status as a JSON-friendly map.
type SchedulerManager ¶
type SchedulerManager struct {
// contains filtered or unexported fields
}
func (*SchedulerManager) Cleanup ¶
func (m *SchedulerManager) Cleanup()
func (*SchedulerManager) Start ¶
func (m *SchedulerManager) Start(project, agent string) error
func (*SchedulerManager) Status ¶
func (m *SchedulerManager) Status() []schedStatus
func (*SchedulerManager) Stop ¶
func (m *SchedulerManager) Stop(project, agent string) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves JSON for one workspace root.
func NewServer ¶
NewServer builds an API server for the given workspace root. If apiKey is non-empty, requests must send Authorization: Bearer <apiKey>.
func (*Server) SetDaemonStatus ¶
func (s *Server) SetDaemonStatus(fn DaemonStatusFunc)
SetDaemonStatus sets the function used to get daemon status.
func (*Server) SetUpdateChecker ¶
func (s *Server) SetUpdateChecker(fn UpdateChecker)
SetUpdateChecker sets the function used to check for updates.
func (*Server) SetVersion ¶
SetVersion sets the build version string exposed via /api/v1/health.
type UpdateChecker ¶
UpdateChecker returns latest version info. Set by the caller.
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func (*UserStore) Authenticate ¶
func (*UserStore) ChangePassword ¶
func (*UserStore) CreateUser ¶
func (*UserStore) DeleteUser ¶
func (*UserStore) HasProjectAccess ¶
func (*UserStore) IssueToken ¶
func (*UserStore) UpdateUser ¶
Source Files
¶
- agent_chat_handlers.go
- assistant_handlers.go
- auth.go
- ccconnect.go
- cronparse.go
- docs_handlers.go
- envvar_handlers.go
- files.go
- goal_context.go
- goals.go
- identity.go
- manage_handlers.go
- proc_unix.go
- prompt_handlers.go
- provider_handlers.go
- schedule.go
- scheduler_manager.go
- server.go
- skill_handlers.go
- telemetry_handlers.go
- trigger.go
- workbench_handlers.go
- write.go