Theia API Documentation v1.77.0
    Preparing search index...

    Resolves the three ways of consuming AGENTS.md.

    A single-root workspace has an unambiguous project root, so its AGENTS.md is always in context, mirroring how other tools implementing the standard treat the root file. A workspace with several roots has no such file, so nothing is loaded and every discovered file is advertised instead, to be read on demand. AGENTS_MD_AUTO_LOADED_VARIABLE and AGENTS_MD_VARIABLE are therefore mutually exclusive by construction: at most one of them is ever non-empty.

    • AGENTS_MD_AUTO_LOADED_VARIABLE inlines the single root's file, or nothing.
    • AGENTS_MD_VARIABLE advertises files by path so a tool-calling agent can fetch them with getFileContent, or nothing.
    • AGENTS_MD_CONTENT_VARIABLE always inlines everything discovered, regardless of root count, for consumers such as code completion that have no tool-calling loop and therefore cannot fetch anything on demand.

    All three resolve to the empty string when the workspace has no AGENTS.md.

    Implements

    Index
    agentsMdService: AgentsMdService
    workspaceService: WorkspaceService
    • Keeps ~{...} in inlined content literal. Function references are matched on the resolved prompt text, so a ~{someTool} in a file anyone in the repository can edit would otherwise attach that tool to every agent using the fragment. A zero-width space between ~ and { breaks the match without changing what the model reads. {{...}} needs no such treatment, as variables are not resolved recursively.

      Parameters

      • content: string

      Returns string

    • Whether the workspace root's AGENTS.md is put into context rather than advertised. Keyed on the number of workspace roots, not the number of discovered files: a workspace with several roots has no single project root whose file could stand for the whole session, even when only one of those roots happens to carry an AGENTS.md.

      Returns boolean