/**
 * Core type definitions for agents-cli.
 *
 * Every data structure that flows between modules lives here: agent identity,
 * configuration schemas, resource tracking, registry types, and permission
 * formats for each supported agent.
 */
/**
 * Reserved `<agent>` keyword for `agents run auto` — full-auto dispatch:
 * host (14d launch affinity) → harness (best-account headroom, weighted) →
 * account (balanced). Lives in lib (not commands/) because both the run
 * command (exec.ts) and the host dispatch layer (hosts/dispatch.ts, which
 * arms the chain-hop guard for remote `run auto`) must agree on it.
 */
export const RUN_AUTO_KEYWORD = 'auto';
/**
 * Env var a host dispatcher exports into the remote SHELL when it dispatches
 * `agents run auto`: tells the remote CLI its host layer is already resolved,
 * so it must not re-run affinity and chain-hop to a third host. It rides the
 * shell-export prelude (hosts/dispatch.ts `remoteRunShellPrelude`) because
 * `--env` flags only reach the spawned AGENT's env — the remote CLI's own
 * process.env (which exec.ts `runAutoDefaultsToAffinity` reads) never sees them.
 */
export const RUN_AUTO_HOST_RESOLVED_ENV = 'AGENTS_RUN_AUTO_HOST_RESOLVED';
/**
 * Env var a host dispatcher exports into the remote SHELL when it opens an
 * INTERACTIVE `--device` run: tells the remote CLI that this agent's stdio is a
 * network link, so the run must be detached (tmux-wrapped) to outlive it.
 *
 * Rides the same shell-export prelude as {@link RUN_AUTO_HOST_RESOLVED_ENV},
 * and for the same reason — exec.ts `resolveTmuxWrap` reads the remote CLI's own
 * `process.env`, which `--env` flags (they reach only the spawned AGENT) never
 * touch.
 *
 * Set ONLY on the interactive path. A headless `--device` dispatch is already
 * detached with setsid by `launchDetached`, so it neither needs nor gets this.
 */
export const REMOTE_INTERACTIVE_ENV = 'AGENTS_REMOTE_INTERACTIVE';
/** Every canonical mode in declaration order. Useful for iteration / validation. */
export const ALL_MODES = ['plan', 'edit', 'auto', 'skip'];
/** Canonical system repo cloned into ~/.agents/.system/. */
export const DEFAULT_SYSTEM_REPO = 'gh:phnx-labs/.agents-system';
/** Strip the `gh:` prefix and `.git` suffix to get a GitHub `owner/repo` slug. */
export function systemRepoSlug(repo = DEFAULT_SYSTEM_REPO) {
    return repo.replace(/^gh:/, '').replace(/\.git$/, '');
}
/** Built-in registry endpoints shipped with agents-cli. */
export const DEFAULT_REGISTRIES = {
    mcp: {
        official: {
            url: 'https://registry.modelcontextprotocol.io/v0',
            enabled: true,
        },
    },
    skill: {},
};
/**
 * Third-party registries pre-seeded on first install for discoverability.
 *
 * These ship into new users' agents.yaml once, but are not "defaults" — after
 * seeding they behave like any user-added registry (listable, disable-able,
 * removable). Removed users can `agents registry remove <name>` to opt out;
 * once removed they don't come back.
 */
export const SEEDED_REGISTRIES = {
    mcp: {},
    skill: {
        // Hermes Agent (Nous Research) — flat JSON index of 1800+ skills aggregated
        // from official, github, lobehub, skills.sh, and claude-marketplace. No auth.
        hermes: {
            url: 'https://hermes-agent.nousresearch.com/docs/api/skills-index.json',
            enabled: true,
        },
    },
};
