@prismshadow/penguin-library-agent · library/agent/src/contract.ts:27

AgentConfig

interface

AgentConfig: the mechanism AgentConfigService implements.

API

@Interface()
export abstract class AgentConfig {
  abstract exists(projectId: string, agentId: string): Promise<boolean>;
  abstract requireExists(projectId: string, agentId: string): Promise<void>;
  abstract isSystemAgent(projectId: string, agentId: string): Promise<boolean>;
  abstract isBuiltinAgent(projectId: string, agentId: string): Promise<boolean>;
  abstract readCardMeta(
      projectId: string,
      agentId: string,
    ): Promise<{
      name?: string;
      description?: string;
      author: AgentAuthor;
      toolCount: number;
      /** Package owners from valid stored MCP entries, omitted if the config could not be read. */
      mcpPluginNames?: string[];
      version: number;
      kernelOutdated: boolean;
      system?: true;
    }>;
  abstract getConfig(projectId: string, agentId: string): Promise<AgentConfigView>;
  abstract updateConfig(
      projectId: string,
      agentId: string,
      req: AgentConfigUpdateRequest,
    ): Promise<void>;
  abstract stampMissingAuthor(
      projectId: string,
      agentId: string,
      author: AgentAuthor,
    ): Promise<boolean>;
  abstract resetConfig(projectId: string, agentId: string): Promise<void>;
  abstract kernelUpdate(projectId: string, agentId: string): Promise<AgentKernelUpdateResponse>;
  abstract insertTemplatePlaceholder(
      projectId: string,
      agentId: string,
      feature: "vault" | "skills" | "schedules",
    ): Promise<AgentConfigView>;
  abstract getVault(projectId: string, agentId: string): Promise<VaultResponse>;
  abstract updateVault(
      projectId: string,
      agentId: string,
      req: VaultUpdateRequest,
    ): Promise<VaultResponse>;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use

Members (13)

exists

exists(projectId: string, agentId: string): Promise<boolean>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<boolean>

requireExists

requireExists(projectId: string, agentId: string): Promise<void>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<void>

isSystemAgent

isSystemAgent(projectId: string, agentId: string): Promise<boolean>

Whether the Agent is the Project's system Agent (core state/system-agent.ts).

@paramprojectIdstring
@paramagentIdstring
@returnsPromise<boolean>

isBuiltinAgent

isBuiltinAgent(projectId: string, agentId: string): Promise<boolean>

Whether the Agent is built in, and so never deleted: the system Agent counts only as itself.

@paramprojectIdstring
@paramagentIdstring
@returnsPromise<boolean>

readCardMeta

readCardMeta(projectId: string, agentId: string): Promise<{ name?: string; description?: string; author: AgentAuthor; toolCount: number; mcpPluginNames?: string[]; version: number; kernelOutdated: boolean; system?: true; }>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<{ name?: string; description?: string; author: AgentAuthor; toolCount: number; mcpPluginNames?: string[]; version: number; kernelOutdated: boolean; system?: true; }>

getConfig

getConfig(projectId: string, agentId: string): Promise<AgentConfigView>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<AgentConfigView>

updateConfig

updateConfig(projectId: string, agentId: string, req: AgentConfigUpdateRequest): Promise<void>
@paramprojectIdstring
@paramagentIdstring
@paramreqAgentConfigUpdateRequest
@returnsPromise<void>

stampMissingAuthor

stampMissingAuthor(projectId: string, agentId: string, author: AgentAuthor): Promise<boolean>

Writes author only into a config that has none; false when it had one or there is no config.

@paramprojectIdstring
@paramagentIdstring
@paramauthorAgentAuthor
@returnsPromise<boolean>

resetConfig

resetConfig(projectId: string, agentId: string): Promise<void>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<void>

kernelUpdate

kernelUpdate(projectId: string, agentId: string): Promise<AgentKernelUpdateResponse>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<AgentKernelUpdateResponse>

insertTemplatePlaceholder

insertTemplatePlaceholder(projectId: string, agentId: string, feature: "vault" | "skills" | "schedules"): Promise<AgentConfigView>
@paramprojectIdstring
@paramagentIdstring
@paramfeature"vault" | "skills" | "schedules"
@returnsPromise<AgentConfigView>

getVault

getVault(projectId: string, agentId: string): Promise<VaultResponse>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<VaultResponse>

updateVault

updateVault(projectId: string, agentId: string, req: VaultUpdateRequest): Promise<VaultResponse>
@paramprojectIdstring
@paramagentIdstring
@paramreqVaultUpdateRequest
@returnsPromise<VaultResponse>