server

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: AGPL-3.0 Imports: 85 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFeishuRegistrationEndpointForTesting added in v0.48.0

func SetFeishuRegistrationEndpointForTesting(endpoint string) func()

func SetWeixinRegistrationEndpointForTesting added in v0.48.0

func SetWeixinRegistrationEndpointForTesting(endpoint string) func()

Types

type AuthInfo

type AuthInfo struct {
	UserID   string `json:"user_id"`
	Username string `json:"username"`
	Role     string `json:"role"`
	IsAdmin  bool   `json:"is_admin"`
	// OIDC principal fields; empty for legacy (password-based) sessions.
	Email     string `json:"email,omitempty"`
	Name      string `json:"name,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
	Scoped    *pkgauth.ScopedTokenClaims
}

AuthInfo carries authenticated user data through request context.

func UserFromContext

func UserFromContext(ctx context.Context) *AuthInfo

UserFromContext extracts the AuthInfo from a request context. Returns nil if the user is not authenticated.

type Server

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

Server provides HTTP handlers for the admin API and embedded web UI.

func New

func New(ctx context.Context, store config.Store, authStore auth.AuthStore, engine *auth.PolicyEngine, mem memory.Provider, db *pgxpool.Pool, linkCodes *auth.LinkCodeStore, poolManager *agent.PoolManager, pluginHost *pluginhost.Host) *Server

New creates an admin server with all API routes mounted. The linkCodes store is shared with channel bots so codes generated in the Web UI can be consumed by channel handlers.

func (*Server) AbandonGoal added in v0.49.4

func (s *Server) AbandonGoal(w http.ResponseWriter, r *http.Request, id string)

AbandonGoal is the human give-up on a budget-exhausted block.

func (*Server) ActivateGoal added in v0.38.0

func (s *Server) ActivateGoal(w http.ResponseWriter, r *http.Request, id string)

ActivateGoal runs the plan gate (draft → ready).

func (*Server) AddEdge added in v0.49.4

func (s *Server) AddEdge(w http.ResponseWriter, r *http.Request, id string)

AddEdge inserts an upstream dependency edge (cycle-checked).

func (*Server) AddGroupMember added in v0.43.0

func (s *Server) AddGroupMember(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) AddProfileConstraint added in v0.39.1

func (s *Server) AddProfileConstraint(w http.ResponseWriter, r *http.Request, agentID string)

AddProfileConstraint handles POST /api/users/me/memories/{agentID}/constraints.

func (*Server) ApprovePlan added in v0.50.0

func (s *Server) ApprovePlan(w http.ResponseWriter, r *http.Request, id string)

ApprovePlan approves a composite's proposed plan (blocked(needs_plan_approval)), materializing its children and resuming the tree.

func (*Server) AssignAgentUser

func (s *Server) AssignAgentUser(w http.ResponseWriter, r *http.Request, id string)

func (*Server) BeginFeishuRegistration added in v0.48.0

func (s *Server) BeginFeishuRegistration(w http.ResponseWriter, r *http.Request)

func (*Server) BeginWeixinRegistration added in v0.48.0

func (s *Server) BeginWeixinRegistration(w http.ResponseWriter, r *http.Request)

func (*Server) CancelGoal added in v0.38.0

func (s *Server) CancelGoal(w http.ResponseWriter, r *http.Request, id string)

CancelGoal cancels a goal, cascading over its non-terminal subtree.

func (*Server) ChangePassword

func (s *Server) ChangePassword(w http.ResponseWriter, r *http.Request)

ChangePassword handles PATCH /api/users/me/password.

func (*Server) CreateAgent

func (s *Server) CreateAgent(w http.ResponseWriter, r *http.Request)

func (*Server) CreateAgentSkill added in v0.38.0

func (s *Server) CreateAgentSkill(w http.ResponseWriter, r *http.Request, id string)

func (*Server) CreateChannel

func (s *Server) CreateChannel(w http.ResponseWriter, r *http.Request)

func (*Server) CreateFeed

func (s *Server) CreateFeed(w http.ResponseWriter, r *http.Request)

func (*Server) CreateFeedEntry added in v0.43.0

func (s *Server) CreateFeedEntry(w http.ResponseWriter, r *http.Request, feedId string)

func (*Server) CreateGoal added in v0.38.0

func (s *Server) CreateGoal(w http.ResponseWriter, r *http.Request)

CreateGoal mints a root goal (goal). With activate=true a leaf is activated immediately (direct run); the flag is ignored for a composite, which is decomposed and materialized by the dispatcher first.

func (*Server) CreateGroup added in v0.43.0

func (s *Server) CreateGroup(w http.ResponseWriter, r *http.Request)

func (*Server) CreateProject added in v0.34.0

func (s *Server) CreateProject(w http.ResponseWriter, r *http.Request, agentID string)

func (*Server) CreateProvider

func (s *Server) CreateProvider(w http.ResponseWriter, r *http.Request)

func (*Server) CreateSchedulerJob

func (s *Server) CreateSchedulerJob(w http.ResponseWriter, r *http.Request, agentID string)

func (*Server) CreateScopedSkill added in v0.48.0

func (s *Server) CreateScopedSkill(w http.ResponseWriter, r *http.Request)

CreateScopedSkill handles POST /api/skills.

func (*Server) CreateSession

func (s *Server) CreateSession(w http.ResponseWriter, r *http.Request, agentID string)

func (*Server) CreateShare added in v0.35.0

func (s *Server) CreateShare(w http.ResponseWriter, r *http.Request)

func (*Server) CreateWorkspaceFile

func (s *Server) CreateWorkspaceFile(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.CreateWorkspaceFileParams)

func (*Server) CredentialsService

func (s *Server) CredentialsService() *credentials.Service

CredentialsService returns the shared credentials service. Used by callers that need to wire in the runner invalidator or access the credentials tool from outside the admin package.

func (*Server) DeleteAgent

func (s *Server) DeleteAgent(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteAgentSkill

func (s *Server) DeleteAgentSkill(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.DeleteAgentSkillParams)

func (*Server) DeleteAgentSkillFile

func (s *Server) DeleteAgentSkillFile(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.DeleteAgentSkillFileParams)

func (*Server) DeleteArticle

func (s *Server) DeleteArticle(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteAuthSession added in v0.38.0

func (s *Server) DeleteAuthSession(w http.ResponseWriter, r *http.Request, id string)

DeleteAuthSession handles DELETE /api/auth/sessions/{id}.

func (*Server) DeleteAuthUserIdentity

func (s *Server) DeleteAuthUserIdentity(w http.ResponseWriter, r *http.Request, id string, identityId string)

DeleteAuthUserIdentity handles DELETE /api/users/{id}/identities/{identityId}.

func (*Server) DeleteChannel

func (s *Server) DeleteChannel(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteFeed

func (s *Server) DeleteFeed(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteGoal added in v0.49.4

func (s *Server) DeleteGoal(w http.ResponseWriter, r *http.Request, id string)

DeleteGoal archives a goal (audit-safe delete).

func (*Server) DeleteGroup added in v0.43.0

func (s *Server) DeleteGroup(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) DeleteOAuthProviderConfig

func (s *Server) DeleteOAuthProviderConfig(w http.ResponseWriter, r *http.Request, id string)

DeleteOAuthProviderConfig handles DELETE /api/admin/oauth-providers/{id}/config.

func (*Server) DeleteProfileConstraint added in v0.39.1

func (s *Server) DeleteProfileConstraint(w http.ResponseWriter, r *http.Request, agentID string, constraintID string)

DeleteProfileConstraint handles DELETE /api/users/me/memories/{agentID}/constraints/{constraintID}.

func (*Server) DeleteProfileMemory

func (s *Server) DeleteProfileMemory(w http.ResponseWriter, r *http.Request, agentID string)

DeleteProfileMemory handles DELETE /api/users/me/memories/{agentID}.

func (*Server) DeleteProject added in v0.34.0

func (s *Server) DeleteProject(w http.ResponseWriter, r *http.Request, agentID string, projectID string)

func (*Server) DeleteProvider

func (s *Server) DeleteProvider(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteSchedulerJob

func (s *Server) DeleteSchedulerJob(w http.ResponseWriter, r *http.Request, agentID string, jobID string)

func (*Server) DeleteScopedSkill added in v0.48.0

func (s *Server) DeleteScopedSkill(w http.ResponseWriter, r *http.Request, id string)

DeleteScopedSkill handles DELETE /api/skills/{id}.

func (*Server) DeleteScopedSkillFile added in v0.48.0

func (s *Server) DeleteScopedSkillFile(w http.ResponseWriter, r *http.Request, id string, params apiserver.DeleteScopedSkillFileParams)

DeleteScopedSkillFile handles DELETE /api/skills/{id}/file.

func (*Server) DeleteScopedVaultEntry added in v0.48.0

func (s *Server) DeleteScopedVaultEntry(w http.ResponseWriter, r *http.Request, name string, params apiserver.DeleteScopedVaultEntryParams)

DeleteScopedVaultEntry handles DELETE /api/vault/{name}.

func (*Server) DeleteSession added in v0.46.0

func (s *Server) DeleteSession(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) DeleteUserMemory

func (s *Server) DeleteUserMemory(w http.ResponseWriter, r *http.Request, id string, agentID string)

func (*Server) DeleteWorkspaceFile

func (s *Server) DeleteWorkspaceFile(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.DeleteWorkspaceFileParams)

func (*Server) DisconnectOAuth

func (s *Server) DisconnectOAuth(w http.ResponseWriter, r *http.Request, provider string)

DisconnectOAuth handles DELETE /api/users/me/oauth/{provider}.

func (*Server) FetchProviderModels

func (s *Server) FetchProviderModels(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GenerateLinkCode

func (s *Server) GenerateLinkCode(w http.ResponseWriter, r *http.Request)

GenerateLinkCode handles POST /api/users/me/link-code.

func (*Server) GetAgent

func (s *Server) GetAgent(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetAgentSkill

func (s *Server) GetAgentSkill(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.GetAgentSkillParams)

func (*Server) GetAgentSkillFile

func (s *Server) GetAgentSkillFile(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.GetAgentSkillFileParams)

func (*Server) GetArticle

func (s *Server) GetArticle(w http.ResponseWriter, r *http.Request, id string, params apiserver.GetArticleParams)

func (*Server) GetAttempt added in v0.49.4

func (s *Server) GetAttempt(w http.ResponseWriter, r *http.Request, id string, attemptId string)

GetAttempt returns one attempt, scoped to its goal.

func (*Server) GetAuthUser

func (s *Server) GetAuthUser(w http.ResponseWriter, r *http.Request, id string)

GetAuthUser handles GET /api/users/{id}.

func (*Server) GetBuiltinResource

func (s *Server) GetBuiltinResource(w http.ResponseWriter, r *http.Request, kindStr string, id string)

func (*Server) GetChannel

func (s *Server) GetChannel(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetClawhubSkill added in v0.47.0

func (s *Server) GetClawhubSkill(w http.ResponseWriter, r *http.Request, slug string)

GetClawhubSkill handles GET /api/clawhub/skills/{slug}, returning a single skill's metadata together with its README and file list (downloaded from ClawHub on demand).

func (*Server) GetCliToolLatest added in v0.45.0

func (s *Server) GetCliToolLatest(w http.ResponseWriter, r *http.Request, params apiserver.GetCliToolLatestParams)

GetCliToolLatest resolves the latest installable version for a mise tool key, letting the UI pin a tool to its current latest without the admin running mise.

func (*Server) GetDigest

func (s *Server) GetDigest(w http.ResponseWriter, r *http.Request)

func (*Server) GetEmailMessage added in v0.43.0

func (s *Server) GetEmailMessage(w http.ResponseWriter, r *http.Request, uid int, params apiserver.GetEmailMessageParams)

GetEmailMessage handles GET /api/email/messages/{uid}.

func (*Server) GetFeed

func (s *Server) GetFeed(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetGoal added in v0.38.0

func (s *Server) GetGoal(w http.ResponseWriter, r *http.Request, id string)

GetGoal returns one goal.

func (*Server) GetGoalReadiness added in v0.49.4

func (s *Server) GetGoalReadiness(w http.ResponseWriter, r *http.Request, id string)

GetGoalReadiness returns the computed dispatchability view.

func (*Server) GetGroup added in v0.43.0

func (s *Server) GetGroup(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) GetMe

func (s *Server) GetMe(w http.ResponseWriter, r *http.Request)

GetMe handles GET /api/auth/me.

func (*Server) GetOAuthConnected

func (s *Server) GetOAuthConnected(w http.ResponseWriter, r *http.Request, provider string)

GetOAuthConnected handles GET /api/users/me/oauth/{provider}/connected.

func (*Server) GetOAuthProviderConfig

func (s *Server) GetOAuthProviderConfig(w http.ResponseWriter, r *http.Request, id string)

GetOAuthProviderConfig handles GET /api/admin/oauth-providers/{id}/config.

func (*Server) GetPluginConfig

func (s *Server) GetPluginConfig(w http.ResponseWriter, r *http.Request, kind string, name string)

func (*Server) GetPluginConfigSchema

func (s *Server) GetPluginConfigSchema(w http.ResponseWriter, r *http.Request, kind string, name string)

func (*Server) GetPluginStatus

func (s *Server) GetPluginStatus(w http.ResponseWriter, r *http.Request, kind string, name string)

func (*Server) GetProfileMemory added in v0.39.1

func (s *Server) GetProfileMemory(w http.ResponseWriter, r *http.Request, agentID string)

GetProfileMemory handles GET /api/users/me/memories/{agentID}.

func (*Server) GetProject added in v0.34.0

func (s *Server) GetProject(w http.ResponseWriter, r *http.Request, agentID string, projectID string)

func (*Server) GetProvider

func (s *Server) GetProvider(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetSchedulerJob added in v0.36.0

func (s *Server) GetSchedulerJob(w http.ResponseWriter, r *http.Request, agentID string, jobID string)

func (*Server) GetScopedSkill added in v0.48.0

func (s *Server) GetScopedSkill(w http.ResponseWriter, r *http.Request, id string)

GetScopedSkill handles GET /api/skills/{id}.

func (*Server) GetScopedSkillFile added in v0.48.0

func (s *Server) GetScopedSkillFile(w http.ResponseWriter, r *http.Request, id string, params apiserver.GetScopedSkillFileParams)

GetScopedSkillFile handles GET /api/skills/{id}/file.

func (*Server) GetScopedVaultEntry added in v0.48.0

func (s *Server) GetScopedVaultEntry(w http.ResponseWriter, r *http.Request, name string, params apiserver.GetScopedVaultEntryParams)

GetScopedVaultEntry handles GET /api/vault/{name}.

func (*Server) GetSession

func (s *Server) GetSession(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) GetSessionContextItems added in v0.46.0

func (s *Server) GetSessionContextItems(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.GetSessionContextItemsParams)

func (*Server) GetSessionMessages

func (s *Server) GetSessionMessages(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.GetSessionMessagesParams)

func (*Server) GetSessionSummary added in v0.46.0

func (s *Server) GetSessionSummary(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, summaryID string)

func (*Server) GetSessionSystemPrompt

func (s *Server) GetSessionSystemPrompt(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) GetSessionWorkspace

func (s *Server) GetSessionWorkspace(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.GetSessionWorkspaceParams)

func (*Server) GetShareContent added in v0.35.0

func (s *Server) GetShareContent(w http.ResponseWriter, r *http.Request, token string)

func (*Server) GetStatus

func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request)

func (*Server) GetStoredDigest

func (s *Server) GetStoredDigest(w http.ResponseWriter, r *http.Request, date string)

func (*Server) GetWorkspaceFileContent

func (s *Server) GetWorkspaceFileContent(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.GetWorkspaceFileContentParams)

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler with OTel instrumentation wrapping the CORS, JSON, and auth middleware chain. The OTel wrap is unconditional: it is a no-op when tracing is disabled.

func (*Server) InitFeishuRegistration added in v0.48.0

func (s *Server) InitFeishuRegistration(w http.ResponseWriter, r *http.Request)

func (*Server) InstallAgentSkill

func (s *Server) InstallAgentSkill(w http.ResponseWriter, r *http.Request, id string)

func (*Server) InstallScopedSkill added in v0.48.0

func (s *Server) InstallScopedSkill(w http.ResponseWriter, r *http.Request)

InstallScopedSkill handles POST /api/skills/install.

func (*Server) LinkAuthUserLoginIdentity added in v0.38.0

func (s *Server) LinkAuthUserLoginIdentity(w http.ResponseWriter, r *http.Request, id string)

LinkAuthUserLoginIdentity handles POST /api/users/{id}/identities/login.

func (*Server) LinkCodes

func (s *Server) LinkCodes() *auth.LinkCodeStore

LinkCodes returns the link code store for use by channel handlers.

func (*Server) ListAcceptanceEvents added in v0.49.4

func (s *Server) ListAcceptanceEvents(w http.ResponseWriter, r *http.Request, id string)

ListAcceptanceEvents lists the acceptance ledger (audit trail, in fold order).

func (*Server) ListAgentSkills

func (s *Server) ListAgentSkills(w http.ResponseWriter, r *http.Request, id string, params apiserver.ListAgentSkillsParams)

func (*Server) ListAgentUsers

func (s *Server) ListAgentUsers(w http.ResponseWriter, r *http.Request, id string)

func (*Server) ListAgents

func (s *Server) ListAgents(w http.ResponseWriter, r *http.Request, params apiserver.ListAgentsParams)

func (*Server) ListArticles

func (s *Server) ListArticles(w http.ResponseWriter, r *http.Request, params apiserver.ListArticlesParams)

func (*Server) ListAttempts added in v0.49.4

func (s *Server) ListAttempts(w http.ResponseWriter, r *http.Request, id string)

ListAttempts lists a goal's attempts (newest first).

func (*Server) ListAuthProviders added in v0.38.0

func (s *Server) ListAuthProviders(w http.ResponseWriter, r *http.Request)

ListAuthProviders handles GET /api/auth/providers. Returns the list of configured OIDC providers so the frontend can build login buttons. Public endpoint — no authentication required.

func (*Server) ListAuthSessions added in v0.38.0

func (s *Server) ListAuthSessions(w http.ResponseWriter, r *http.Request)

ListAuthSessions handles GET /api/auth/sessions.

func (*Server) ListAuthUserAgents

func (s *Server) ListAuthUserAgents(w http.ResponseWriter, r *http.Request, id string)

ListAuthUserAgents handles GET /api/users/{id}/agents.

func (*Server) ListAuthUserChannelIdentities added in v0.38.0

func (s *Server) ListAuthUserChannelIdentities(w http.ResponseWriter, r *http.Request, id string)

ListAuthUserChannelIdentities handles GET /api/users/{id}/identities/channel.

func (*Server) ListAuthUserLoginIdentities added in v0.38.0

func (s *Server) ListAuthUserLoginIdentities(w http.ResponseWriter, r *http.Request, id string)

ListAuthUserLoginIdentities handles GET /api/users/{id}/identities/login.

func (*Server) ListAuthUsers

func (s *Server) ListAuthUsers(w http.ResponseWriter, r *http.Request, params apiserver.ListAuthUsersParams)

ListAuthUsers handles GET /api/users.

func (*Server) ListBuiltinResources

func (s *Server) ListBuiltinResources(w http.ResponseWriter, r *http.Request, kindStr string)

func (*Server) ListChannels

func (s *Server) ListChannels(w http.ResponseWriter, r *http.Request)

func (*Server) ListClawhubSkills added in v0.47.0

func (s *Server) ListClawhubSkills(w http.ResponseWriter, r *http.Request, params apiserver.ListClawhubSkillsParams)

ListClawhubSkills handles GET /api/clawhub/skills. When q is absent it browses popular skills (paginated); when q is set it searches.

func (*Server) ListEdges added in v0.49.4

func (s *Server) ListEdges(w http.ResponseWriter, r *http.Request, id string)

ListEdges lists a goal's upstream dependency edges.

func (*Server) ListEmailFolders added in v0.43.0

func (s *Server) ListEmailFolders(w http.ResponseWriter, r *http.Request, params apiserver.ListEmailFoldersParams)

ListEmailFolders handles GET /api/email/folders.

func (*Server) ListEmailMessages added in v0.43.0

func (s *Server) ListEmailMessages(w http.ResponseWriter, r *http.Request, params apiserver.ListEmailMessagesParams)

ListEmailMessages handles GET /api/email/messages.

func (*Server) ListFeedEntries

func (s *Server) ListFeedEntries(w http.ResponseWriter, r *http.Request, feedId string, params apiserver.ListFeedEntriesParams)

func (*Server) ListFeeds

func (s *Server) ListFeeds(w http.ResponseWriter, r *http.Request, params apiserver.ListFeedsParams)

func (*Server) ListGoalChildren added in v0.49.4

func (s *Server) ListGoalChildren(w http.ResponseWriter, r *http.Request, id string)

ListGoalChildren lists a composite's direct children.

func (*Server) ListGoals added in v0.38.0

func (s *Server) ListGoals(w http.ResponseWriter, r *http.Request, params apiserver.ListGoalsParams)

ListGoals lists root goals (goals) by default; `?parent={id}` lists a composite's children and `?root={id}` lists a whole tree.

func (*Server) ListGroupMembers added in v0.43.0

func (s *Server) ListGroupMembers(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) ListGroupMessages added in v0.43.0

func (s *Server) ListGroupMessages(w http.ResponseWriter, r *http.Request, groupId string, params apiserver.ListGroupMessagesParams)

func (*Server) ListGroups added in v0.43.0

func (s *Server) ListGroups(w http.ResponseWriter, r *http.Request, params apiserver.ListGroupsParams)

func (*Server) ListInbox added in v0.46.0

func (s *Server) ListInbox(w http.ResponseWriter, r *http.Request, params apiserver.ListInboxParams)

func (*Server) ListJobTemplates added in v0.46.0

func (s *Server) ListJobTemplates(w http.ResponseWriter, r *http.Request)

ListJobTemplates returns all registered job templates with subscription status resolved for the current user. Returns 503 when the scheduler service is not available.

func (*Server) ListManifestPlugins

func (s *Server) ListManifestPlugins(w http.ResponseWriter, r *http.Request)

func (*Server) ListModels

func (s *Server) ListModels(w http.ResponseWriter, r *http.Request)

ListModels returns enabled models from provider config + fetched cache, filtered to only include models whose provider instance is enabled. No provider API calls — reads only from the DB and ~/.stella/cache/models.json.

func (*Server) ListOAuthProviders

func (s *Server) ListOAuthProviders(w http.ResponseWriter, r *http.Request)

ListOAuthProviders handles GET /api/users/me/oauth/providers.

func (*Server) ListPlugins

func (s *Server) ListPlugins(w http.ResponseWriter, r *http.Request)

func (*Server) ListProfileChangelog added in v0.39.1

func (s *Server) ListProfileChangelog(w http.ResponseWriter, r *http.Request, agentID string, params apiserver.ListProfileChangelogParams)

ListProfileChangelog handles GET /api/users/me/memories/{agentID}/changelog.

func (*Server) ListProfileConstraints added in v0.39.1

func (s *Server) ListProfileConstraints(w http.ResponseWriter, r *http.Request, agentID string)

ListProfileConstraints handles GET /api/users/me/memories/{agentID}/constraints.

func (*Server) ListProfileIdentities

func (s *Server) ListProfileIdentities(w http.ResponseWriter, r *http.Request)

ListProfileIdentities handles GET /api/users/me/identities.

func (*Server) ListProfileMemories

func (s *Server) ListProfileMemories(w http.ResponseWriter, r *http.Request)

ListProfileMemories handles GET /api/users/me/memories.

func (*Server) ListProjects added in v0.34.0

func (s *Server) ListProjects(w http.ResponseWriter, r *http.Request, agentID string, params apiserver.ListProjectsParams)

func (*Server) ListProviderModels

func (s *Server) ListProviderModels(w http.ResponseWriter, r *http.Request, id string)

func (*Server) ListProviderTypes

func (s *Server) ListProviderTypes(w http.ResponseWriter, r *http.Request)

func (*Server) ListProviders

func (s *Server) ListProviders(w http.ResponseWriter, r *http.Request)

func (*Server) ListPublicChannels

func (s *Server) ListPublicChannels(w http.ResponseWriter, r *http.Request)

func (*Server) ListSchedulerJobRuns

func (s *Server) ListSchedulerJobRuns(w http.ResponseWriter, r *http.Request, agentID string, jobID string, params apiserver.ListSchedulerJobRunsParams)

func (*Server) ListSchedulerJobs

func (s *Server) ListSchedulerJobs(w http.ResponseWriter, r *http.Request, agentID string)

func (*Server) ListScopedSkills added in v0.48.0

func (s *Server) ListScopedSkills(w http.ResponseWriter, r *http.Request, params apiserver.ListScopedSkillsParams)

ListScopedSkills handles GET /api/skills.

func (*Server) ListScopedVaultEntries added in v0.48.0

func (s *Server) ListScopedVaultEntries(w http.ResponseWriter, r *http.Request, params apiserver.ListScopedVaultEntriesParams)

ListScopedVaultEntries handles GET /api/vault.

func (*Server) ListSessions

func (s *Server) ListSessions(w http.ResponseWriter, r *http.Request, agentID string, params apiserver.ListSessionsParams)

func (*Server) ListShares added in v0.35.0

func (s *Server) ListShares(w http.ResponseWriter, r *http.Request, params apiserver.ListSharesParams)

func (*Server) ListStoredDigests

func (s *Server) ListStoredDigests(w http.ResponseWriter, r *http.Request, params apiserver.ListStoredDigestsParams)

func (*Server) ListTools

func (s *Server) ListTools(w http.ResponseWriter, r *http.Request)

func (*Server) ListUserMemories

func (s *Server) ListUserMemories(w http.ResponseWriter, r *http.Request, id string)

func (*Server) LoginLocal added in v0.39.1

func (s *Server) LoginLocal(w http.ResponseWriter, r *http.Request)

func (*Server) Logout

func (s *Server) Logout(w http.ResponseWriter, r *http.Request)

Logout handles POST /api/auth/logout.

func (*Server) MarkEmailMessage added in v0.43.0

func (s *Server) MarkEmailMessage(w http.ResponseWriter, r *http.Request, uid int, params apiserver.MarkEmailMessageParams)

MarkEmailMessage handles POST /api/email/messages/{uid}/mark.

func (*Server) MoveWorkspaceFile

func (s *Server) MoveWorkspaceFile(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.MoveWorkspaceFileParams)

func (*Server) OauthCallback

func (s *Server) OauthCallback(w http.ResponseWriter, r *http.Request, provider string, params apiserver.OauthCallbackParams)

OauthCallback handles GET /api/auth/oauth/{provider}/callback. This is intentionally a pass-through to the unexported helper so the generated interface signature is satisfied.

func (*Server) OauthCallbackLegacy added in v0.38.0

func (s *Server) OauthCallbackLegacy(w http.ResponseWriter, r *http.Request, provider string, params apiserver.OauthCallbackLegacyParams)

OauthCallbackLegacy handles the deprecated /api/auth/profile/oauth/{provider}/callback alias.

func (*Server) PollFeed

func (s *Server) PollFeed(w http.ResponseWriter, r *http.Request, id string, params apiserver.PollFeedParams)

func (*Server) PollFeishuRegistration added in v0.48.0

func (s *Server) PollFeishuRegistration(w http.ResponseWriter, r *http.Request)

func (*Server) PollOAuthFlow

func (s *Server) PollOAuthFlow(w http.ResponseWriter, r *http.Request, provider string, flowID string)

PollOAuthFlow handles GET /api/users/me/oauth/{provider}/status/{flowID}.

func (*Server) PollWeixinQRStatus

func (s *Server) PollWeixinQRStatus(w http.ResponseWriter, r *http.Request, params apiserver.PollWeixinQRStatusParams)

PollWeixinQRStatus polls the QR code scan status. On confirmed, it links the current user's identity to the weixin account. Provisioning the singleton channel credentials is an admin-only concern (see BeginWeixinRegistration / PollWeixinRegistration), so the credential write only happens for admins; a non-admin linking their identity must not overwrite the global channel. GET /api/channels/weixin/qr/status?qrcode=...

func (*Server) PollWeixinRegistration added in v0.48.0

func (s *Server) PollWeixinRegistration(w http.ResponseWriter, r *http.Request)

func (*Server) ReattemptGoal added in v0.49.4

func (s *Server) ReattemptGoal(w http.ResponseWriter, r *http.Request, id string)

ReattemptGoal raises the budget on a blocked goal and resumes it.

func (*Server) RegisterLocal added in v0.39.1

func (s *Server) RegisterLocal(w http.ResponseWriter, r *http.Request)

func (*Server) RejectPlan added in v0.50.0

func (s *Server) RejectPlan(w http.ResponseWriter, r *http.Request, id string)

RejectPlan rejects a composite's proposed plan, returning it to draft so the dispatcher re-decomposes it.

func (*Server) RemoveAgentUser

func (s *Server) RemoveAgentUser(w http.ResponseWriter, r *http.Request, id string, userId string)

func (*Server) RemoveGroupMember added in v0.43.0

func (s *Server) RemoveGroupMember(w http.ResponseWriter, r *http.Request, groupId string, agentId string)

func (*Server) RevokeShare added in v0.35.0

func (s *Server) RevokeShare(w http.ResponseWriter, r *http.Request, id string)

func (*Server) SaveArticle

func (s *Server) SaveArticle(w http.ResponseWriter, r *http.Request)

func (*Server) SaveDigest

func (s *Server) SaveDigest(w http.ResponseWriter, r *http.Request)

func (*Server) SaveManifestPlugins

func (s *Server) SaveManifestPlugins(w http.ResponseWriter, r *http.Request)

func (*Server) SearchCliToolRegistry added in v0.45.0

func (s *Server) SearchCliToolRegistry(w http.ResponseWriter, r *http.Request, params apiserver.SearchCliToolRegistryParams)

SearchCliToolRegistry searches the mise tool registry so the UI can add a CLI tool by picking a name instead of hand-writing its mise backend key.

func (*Server) SearchSkills

func (s *Server) SearchSkills(w http.ResponseWriter, r *http.Request, params apiserver.SearchSkillsParams)

SearchSkills handles GET /api/skills/search?q=<query>&limit=<n>.

func (*Server) SendEmail added in v0.43.0

func (s *Server) SendEmail(w http.ResponseWriter, r *http.Request, params apiserver.SendEmailParams)

SendEmail handles POST /api/email/send.

func (*Server) SendGroupMessage added in v0.43.0

func (s *Server) SendGroupMessage(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) SendSessionMessage

func (s *Server) SendSessionMessage(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) SetArbiter added in v0.43.0

func (s *Server) SetArbiter(a *channel.Arbiter)

func (*Server) SetBaseURL added in v0.38.0

func (s *Server) SetBaseURL(url string)

SetBaseURL sets the public base URL and propagates it to the credentials service so OAuth redirect URIs use the externally reachable address.

func (*Server) SetCredentialStore added in v0.38.0

func (s *Server) SetCredentialStore(store auth.CredentialStore)

SetCredentialStore wires the credential store into the admin server.

func (*Server) SetEventLogStore added in v0.43.0

func (s *Server) SetEventLogStore(store *eventlog.Store)

func (*Server) SetGoalService added in v0.49.4

func (s *Server) SetGoalService(svc *goal.Service)

SetGoalService wires the goal system into the admin server. When unset, every /api/goals route returns 503.

func (*Server) SetGroupDispatcher added in v0.43.0

func (s *Server) SetGroupDispatcher(dispatcher *channel.GroupDispatcher)

func (*Server) SetLoginIdentityStore added in v0.38.0

func (s *Server) SetLoginIdentityStore(store auth.LoginIdentityStore)

SetLoginIdentityStore wires the OIDC login identity store so the admin API can list and link login identities. Call before serving requests.

func (*Server) SetOAuthProviderConfig

func (s *Server) SetOAuthProviderConfig(w http.ResponseWriter, r *http.Request, id string)

SetOAuthProviderConfig handles PUT /api/admin/oauth-providers/{id}/config.

func (*Server) SetOIDCAuth added in v0.38.0

func (s *Server) SetOIDCAuth(result *oidc.SetupResult)

SetOIDCAuth wires all OIDC authentication components into the server. Call before serving requests. If not set, OIDC login is disabled and ListAuthProviders returns an empty list.

func (*Server) SetProfileMemory

func (s *Server) SetProfileMemory(w http.ResponseWriter, r *http.Request, agentID string)

SetProfileMemory handles PATCH /api/users/me/memories/{agentID}.

func (*Server) SetProfileSoul

func (s *Server) SetProfileSoul(w http.ResponseWriter, r *http.Request, agentID string)

SetProfileSoul handles PATCH /api/users/me/soul/{agentID}.

func (*Server) SetSchedulerService

func (s *Server) SetSchedulerService(svc *scheduler.Service)

SetSchedulerService wires the live scheduler service into the admin server. When set, create and delete job handlers go through the service (live + DB). If not set, those handlers write DB-only.

func (*Server) SetScopedVaultEntry added in v0.48.0

func (s *Server) SetScopedVaultEntry(w http.ResponseWriter, r *http.Request, name string)

SetScopedVaultEntry handles PUT /api/vault/{name}.

func (*Server) SetSessionStore added in v0.38.0

func (s *Server) SetSessionStore(store auth.SessionStore)

SetSessionStore wires the session store into the admin server.

func (*Server) SetTokenService

func (s *Server) SetTokenService(svc *auth.TokenService)

SetTokenService wires bearer token authentication into the admin server.

func (*Server) SetUserMemory

func (s *Server) SetUserMemory(w http.ResponseWriter, r *http.Request, id string, agentID string)

func (*Server) SetUserStore added in v0.38.0

func (s *Server) SetUserStore(store interface {
	auth.UserStore
	auth.ChannelIdentityStore
},
)

SetUserStore wires the OIDC user+identity store into the admin server.

func (*Server) SetVaultRecipient

func (s *Server) SetVaultRecipient(r *age.X25519Recipient)

SetVaultRecipient sets the master age recipient so that new users created via web registration receive an age keypair. Call before serving requests. If not set (nil), vault key generation is skipped for new users.

func (*Server) SetVaultService

func (s *Server) SetVaultService(svc *vault.Service)

SetVaultService wires the vault service into the admin server. Call before serving requests. If not set (nil), vault API endpoints return 503 Service Unavailable.

func (*Server) StartOAuthFlow

func (s *Server) StartOAuthFlow(w http.ResponseWriter, r *http.Request, provider string)

StartOAuthFlow handles POST /api/users/me/oauth/{provider}/start.

func (*Server) StartWeixinQR

func (s *Server) StartWeixinQR(w http.ResponseWriter, r *http.Request)

StartWeixinQR initiates the WeChat QR login flow by requesting a QR code from the iLink API. Any authenticated user can call this. POST /api/channels/weixin/qr

func (*Server) StreamSessionEvents added in v0.49.3

func (s *Server) StreamSessionEvents(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

StreamSessionEvents subscribes to a session's in-flight turn and streams its events read-only, regardless of who initiated the turn. This lets the web UI watch server-driven turns (scheduler/task/delegate) or a turn started in another tab in real time, since those turns carry no HTTP request of their own.

func (*Server) SubmitVerdict added in v0.49.4

func (s *Server) SubmitVerdict(w http.ResponseWriter, r *http.Request, id string)

SubmitVerdict appends a human verdict against a contract item and re-folds.

func (*Server) SyncManifestPlugins

func (s *Server) SyncManifestPlugins(w http.ResponseWriter, r *http.Request)

func (*Server) TogglePlugin

func (s *Server) TogglePlugin(w http.ResponseWriter, r *http.Request, kind string, name string)

func (*Server) TriggerSchedulerJob

func (s *Server) TriggerSchedulerJob(w http.ResponseWriter, r *http.Request, agentID string, jobID string)

func (*Server) UnarchiveGoal added in v0.49.4

func (s *Server) UnarchiveGoal(w http.ResponseWriter, r *http.Request, id string)

UnarchiveGoal restores an archived goal to default lists.

func (*Server) UnlinkProfileIdentity

func (s *Server) UnlinkProfileIdentity(w http.ResponseWriter, r *http.Request, id string)

UnlinkProfileIdentity handles DELETE /api/users/me/identities/{id}.

func (*Server) UpdateAgent

func (s *Server) UpdateAgent(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateAgentSkill

func (s *Server) UpdateAgentSkill(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.UpdateAgentSkillParams)

func (*Server) UpdateArticle

func (s *Server) UpdateArticle(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateAuthUserActive

func (s *Server) UpdateAuthUserActive(w http.ResponseWriter, r *http.Request, id string)

UpdateAuthUserActive handles PATCH /api/users/{id}/active.

func (*Server) UpdateAuthUserAgents

func (s *Server) UpdateAuthUserAgents(w http.ResponseWriter, r *http.Request, id string)

UpdateAuthUserAgents handles PATCH /api/users/{id}/agents.

func (*Server) UpdateAuthUserRole

func (s *Server) UpdateAuthUserRole(w http.ResponseWriter, r *http.Request, id string)

UpdateAuthUserRole handles PATCH /api/users/{id}/role.

func (*Server) UpdateChannel

func (s *Server) UpdateChannel(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateFeed

func (s *Server) UpdateFeed(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateFeedEntry

func (s *Server) UpdateFeedEntry(w http.ResponseWriter, r *http.Request, feedId string, id string)

func (*Server) UpdateGoal added in v0.49.4

func (s *Server) UpdateGoal(w http.ResponseWriter, r *http.Request, id string)

UpdateGoal applies a partial metadata edit (PATCH).

func (*Server) UpdateGroup added in v0.43.0

func (s *Server) UpdateGroup(w http.ResponseWriter, r *http.Request, groupId string)

func (*Server) UpdatePluginConfig

func (s *Server) UpdatePluginConfig(w http.ResponseWriter, r *http.Request, kind string, name string)

func (*Server) UpdateProject added in v0.34.0

func (s *Server) UpdateProject(w http.ResponseWriter, r *http.Request, agentID string, projectID string)

func (*Server) UpdateProvider

func (s *Server) UpdateProvider(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateSchedulerJob

func (s *Server) UpdateSchedulerJob(w http.ResponseWriter, r *http.Request, agentID string, jobID string)

func (*Server) UpdateScopedSkill added in v0.48.0

func (s *Server) UpdateScopedSkill(w http.ResponseWriter, r *http.Request, id string)

UpdateScopedSkill handles PATCH /api/skills/{id}.

func (*Server) UpdateSession added in v0.46.0

func (s *Server) UpdateSession(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) UpdateUserDefaultAgent

func (s *Server) UpdateUserDefaultAgent(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateUserNotifyIdentity

func (s *Server) UpdateUserNotifyIdentity(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateWorkspaceFileContent

func (s *Server) UpdateWorkspaceFileContent(w http.ResponseWriter, r *http.Request, agentID string, sessionID string, params apiserver.UpdateWorkspaceFileContentParams)

func (*Server) UpgradeAgentSkill added in v0.49.0

func (s *Server) UpgradeAgentSkill(w http.ResponseWriter, r *http.Request, id string, skillId string, params apiserver.UpgradeAgentSkillParams)

UpgradeAgentSkill re-fetches a DB-backed skill from its recorded install source and updates it in place when the source has a newer version. It is the check-and-update behind the inspector's "check for updates" button.

func (*Server) UploadAgentSkill

func (s *Server) UploadAgentSkill(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UploadScopedSkill added in v0.48.0

func (s *Server) UploadScopedSkill(w http.ResponseWriter, r *http.Request)

UploadScopedSkill handles POST /api/skills/upload.

func (*Server) UploadWorkspaceFile

func (s *Server) UploadWorkspaceFile(w http.ResponseWriter, r *http.Request, agentID string, sessionID string)

func (*Server) WaiveEdge added in v0.49.4

func (s *Server) WaiveEdge(w http.ResponseWriter, r *http.Request, id string, upstreamId string)

WaiveEdge waives a hard edge so a blocked(dep) downstream can proceed.

Jump to

Keyboard shortcuts

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