Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:1ay1 Agentty Installed Library Value

From Leeroopedia
Knowledge Sources
Domains Configuration, Skills
Last Updated 2026-10-28 12:00 GMT

Overview

Value type holding what is installed on disk (skills, commands, hooks, project agents), read on a worker and held on the Model so the UI thread never walks the disk.

Description

The agentty::Library struct is what is installed on disk: skills, their approvals, slash commands, the hooks file, and project subagent types — as a value. Read on a worker (`cmd::load_library`) and held on the Model, so reducers and panels look things up here instead of walking the disk on the UI thread. Reloaded at startup and after each turn.

Usage

Import this when you need to: access installed skills/commands/hooks in the Model, check if a project agent exists, or look up a skill by name.

Code Reference

Source Location

Signature

namespace agentty {

struct Library {
    bool                                  loaded = false;
    std::vector<tools::skills::Skill>     skills;
    std::vector<tools::skills::Shadowed>  shadowed;
    scope::Approvals                      skill_approvals;
    std::vector<tools::commands::Command> commands;
    std::string                           hooks_file;      // "" when none
    bool                                  hooks_pending = false;
    std::vector<std::string>              project_agents;

    [[nodiscard]] bool is_project_agent(std::string_view name) const noexcept;
    [[nodiscard]] const tools::skills::Skill* skill(std::string_view name) const noexcept;
    [[nodiscard]] bool shadowed_within_scope(std::string_view name) const noexcept;
};

// Read everything from disk. Worker-side only.
[[nodiscard]] Library read_library(Io);
}

Import

#include "agentty/runtime/library.hpp"

I/O Contract

Inputs

Name Type Required Description
Io capability token Yes IO permission for disk reads

Outputs

Name Type Description
Library struct All installed skills, commands, hooks, project agents
skill() const Skill* Look up a skill by name, or null

Usage Examples

Access Library State

#include "agentty/runtime/library.hpp"

auto& lib = model.ui.library;
if (const auto* skill = lib.skill("my-skill")) {
    // skill->name, skill->instructions, skill->source
}
if (lib.is_project_agent("reviewer")) {
    // "reviewer" is defined in .agentty/agents/
}
if (lib.hooks_pending) {
    // Hooks file exists but not yet approved
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment