Interface SelfImprovementToolDeps

Dependencies required to construct the four self-improvement tools.

Callers provide runtime hooks for personality access, skill management, tool execution, and optional memory storage. The engine uses these to wire each tool without hard-coupling to specific service implementations.

interface SelfImprovementToolDeps {
    getPersonality: ((context?) => Record<string, number>);
    setPersonality: ((trait, value, context?) => boolean | void);
    mutationStore?: PersonalityMutationStore;
    getActiveSkills: ((context?) => {
        skillId: string;
        name: string;
        category: string;
    }[]);
    getLockedSkills: (() => string[]);
    loadSkill: ((id, context?) => Promise<{
        skillId: string;
        name: string;
        category: string;
    }>);
    unloadSkill: ((id, context?) => void);
    searchSkills: ((query, context?) => {
        skillId: string;
        name: string;
        category: string;
        description: string;
    }[]);
    executeTool: ((name, args, context?, signal?, tool?) => Promise<unknown>);
    listTools: (() => string[]);
    storeMemory?: ((trace, context?) => Promise<void>);
    getSessionParam?: ((param, context) => unknown);
    setSessionParam?: ((param, value, context) => void);
}

Properties

getPersonality: ((context?) => Record<string, number>)

Returns the calling agent's HEXACO personality trait values as a trait→value map. The context identifies the agent instance and session that made the tool call.

Type declaration

    • (context?): Record<string, number>
    • Parameters

      Returns Record<string, number>

setPersonality: ((trait, value, context?) => boolean | void)

Sets a single HEXACO personality trait (already clamped) on the calling agent. Returns false when the caller cannot be resolved, in which case nothing was changed; returning nothing counts as applied.

Type declaration

    • (trait, value, context?): boolean | void
    • Parameters

      Returns boolean | void

mutationStore?: PersonalityMutationStore

Durable store for personality mutations (used by AdaptPersonalityTool for persistence).

getActiveSkills: ((context?) => {
    skillId: string;
    name: string;
    category: string;
}[])

Returns the agent's currently active skills.

Type declaration

    • (context?): {
          skillId: string;
          name: string;
          category: string;
      }[]
    • Parameters

      Returns {
          skillId: string;
          name: string;
          category: string;
      }[]

getLockedSkills: (() => string[])

Returns skill IDs that may not be disabled (core skills).

Type declaration

    • (): string[]
    • Returns string[]

loadSkill: ((id, context?) => Promise<{
    skillId: string;
    name: string;
    category: string;
}>)

Dynamically loads a skill by ID and returns its metadata.

Type declaration

    • (id, context?): Promise<{
          skillId: string;
          name: string;
          category: string;
      }>
    • Parameters

      Returns Promise<{
          skillId: string;
          name: string;
          category: string;
      }>

unloadSkill: ((id, context?) => void)

Unloads (disables) a previously loaded skill.

Type declaration

searchSkills: ((query, context?) => {
    skillId: string;
    name: string;
    category: string;
    description: string;
}[])

Searches the skill registry by query string, returning matching skill metadata.

Type declaration

    • (query, context?): {
          skillId: string;
          name: string;
          category: string;
          description: string;
      }[]
    • Parameters

      Returns {
          skillId: string;
          name: string;
          category: string;
          description: string;
      }[]

executeTool: ((name, args, context?, signal?, tool?) => Promise<unknown>)

Executes a registered tool by name with the given arguments.

Type declaration

    • (name, args, context?, signal?, tool?): Promise<unknown>
    • Parameters

      Returns Promise<unknown>

listTools: (() => string[])

Returns the names of all currently registered tools.

Type declaration

    • (): string[]
    • Returns string[]

storeMemory?: ((trace, context?) => Promise<void>)

Optional callback for persisting self-improvement trace memories. The context identifies the calling agent and session, so the host can store the trace in that agent's memory under that session's scope.

Type declaration

    • (trace, context?): Promise<void>
    • Parameters

      • trace: {
            type: string;
            scope: string;
            content: string;
            tags: string[];
        }
        • type: string
        • scope: string
        • content: string
        • tags: string[]
      • Optional context: ToolExecutionContext

      Returns Promise<void>

getSessionParam?: ((param, context) => unknown)

Optional host-level getter for session-scoped runtime params such as temperature.

Type declaration

setSessionParam?: ((param, value, context) => void)

Optional host-level setter for session-scoped runtime params such as temperature.

Type declaration

    • (param, value, context): void
    • Parameters

      Returns void