AgentLifecycle: the mechanism AgentService implements — the list, the creation, the delete and the plugin update surface.
API
@Interface("@prismshadow/penguin-server#AgentLifecycle")
export abstract class AgentLifecycle {
abstract listAgents(projectId: string): Promise<AgentListItem[]>;
abstract takenAgentIds(projectId: string): Promise<string[]>;
abstract deleteAgent(projectId: string, agentId: string): Promise<AgentDeletionInfo>;
abstract agentDeletion(projectId: string, deletionId: string): AgentDeletionInfo | null;
abstract resumeDeletions(): Promise<void>;
abstract createAgent(
projectId: string,
agentId: string,
creation?: AgentCreation,
): Promise<AgentListItem>;
abstract pluginVersion(
projectId: string,
agentId: string,
pluginName: string,
): Promise<{ installed: string | null; library: string | null }>;
abstract updatePlugin(projectId: string, agentId: string, pluginName: string): Promise<void>;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (8)
listAgents
listAgents(projectId: string): Promise<AgentListItem[]>@paramprojectId
string@returns
Promise<AgentListItem[]>takenAgentIds
takenAgentIds(projectId: string): Promise<string[]>Every id createAgent refuses as taken, as names only, including a folder that does not list.
@paramprojectId
string@returns
Promise<string[]>deleteAgent
deleteAgent(projectId: string, agentId: string): Promise<AgentDeletionInfo>Moves the Agent's folder out of the agents directory in one rename and drops its index row,
so it is gone from every list and route at once; its files are then removed in the background,
as the returned deletion reports. Refuses a built-in Agent, and a folder another program
holds open (409 agent_folder_busy, nothing deleted).
@paramprojectId
string@paramagentId
string@returns
Promise<AgentDeletionInfo>agentDeletion
agentDeletion(projectId: string, deletionId: string): AgentDeletionInfo | nullWhere one deletion stands; null once it is unknown here (finished long ago, or never was).
@paramprojectId
string@paramdeletionId
string@returns
AgentDeletionInfo | nullresumeDeletions
resumeDeletions(): Promise<void>Removes whatever deleted Agents left behind when the server last stopped mid-removal.
@returns
Promise<void>createAgent
createAgent(projectId: string, agentId: string, creation?: AgentCreation): Promise<AgentListItem>@paramprojectId
string@paramagentId
string@paramcreation?
AgentCreation@returns
Promise<AgentListItem>pluginVersion
pluginVersion(projectId: string, agentId: string, pluginName: string): Promise<{ installed: string | null; library: string | null }>@paramprojectId
string@paramagentId
string@parampluginName
string@returns
Promise<{ installed: string | null; library: string | null }>updatePlugin
updatePlugin(projectId: string, agentId: string, pluginName: string): Promise<void>@paramprojectId
string@paramagentId
string@parampluginName
string@returns
Promise<void>