import type { CliId } from '../adapters/cli/types.js'; import type { Locale } from '../i18n/index.js'; export type SkillInjectionMode = 'global' | 'prompt' | 'off'; /** Machine default when neither the bot nor config.json pins a value. */ export declare const DEFAULT_BUILTIN_SKILL_INJECTION: SkillInjectionMode; export declare function isSkillInjectionMode(v: unknown): v is SkillInjectionMode; /** Machine-wide default (`skills.builtinInjection`, fallback `prompt`). */ export declare function globalBuiltinSkillInjectionDefault(): SkillInjectionMode; /** Per-bot override (bots.json `skillInjection`) → machine default. */ export declare function resolveSkillInjectionMode(botOverride?: string): SkillInjectionMode; /** Prompt-side resolution: the daemon knows the bot only by its larkAppId. */ export declare function resolveSkillInjectionModeForApp(larkAppId?: string): SkillInjectionMode; /** * Install-side decision for a shared global skills dir: return true iff SOME * configured bot whose adapter writes to `skillsDir` resolves to `global`. Keyed * by the resolved dir (not cliId) because several CLIs share one dir, so a * `global` traex bot must keep the files a `prompt` coco bot would otherwise * sweep from the same ~/.trae/skills. Union semantics → deterministic across the * per-bot daemons that each independently call this. */ export declare function shouldInstallGlobalSkills(skillsDir: string): boolean; /** * How a CLI delivers botmux skills, for the dashboard control (and any other * consumer that must branch on skill-delivery capability): * - 'dynamic': per-session `--plugin-dir` injection — the claude-family * (claude-code / seed / relay), which set `pluginDir`. Not configurable: they * always inject dynamically, no global leak. The mode knobs don't apply. * - 'global': a shared global skills dir (`skillsDir`) — codex/gemini/opencode/ * cursor/coco/traex/pi/oh-my-pi/mtr/kiro-cli/genius/grok — where * global|prompt|off applies. * - 'none': neither — the CLI has no skill mechanism (antigravity/aiden/hermes/ * mir/mira/codex-app), so there's nothing to configure. * Capability-based (not a hardcoded id list) so claude-family forks like relay * are classified correctly without per-fork upkeep. */ export type SkillInjectionSupport = 'dynamic' | 'global' | 'none'; export declare function resolveSkillInjectionSupport(cliId: CliId, cliPathOverride?: string): SkillInjectionSupport; export interface BuiltinSkillEntry { name: string; description: string; content: string; } /** First `description:` value from a SKILL.md YAML frontmatter (single line). */ export declare function frontmatterDescription(content: string): string; /** * The built-in skills the model should be told about in `prompt` mode. Mirrors * exactly what `global` mode would install: the unconditional BUILTIN_SKILLS, * plus the ask fallback when the CLI has no hook takeover, plus the whiteboard * skill when the feature is on. */ export declare function builtinSkillEntries(opts: { asksViaHook?: boolean; whiteboardEnabled?: boolean; /** Drop comms skills fully covered by `` (history/quoted/bots). * Send remains as an on-demand complex-delivery skill. Set for the prompt-mode * catalog; leave off for `botmux skill list`, which surfaces everything. */ excludeRoutingCovered?: boolean; /** Machine-wide v3 Workflow switch. Defaults to the live accessor * (`isWorkflowFeatureEnabled`); when off, the botmux-workflow family is not * advertised. Explicit for tests. */ workflowEnabled?: boolean; }): BuiltinSkillEntry[]; /** Full SKILL.md body for a built-in skill name — backs `botmux skill show` * on-demand reads in `prompt` mode (independent of the per-CLI toggles above, * so a name that made it into the catalog always resolves). The v3 Workflow * family resolves only while the feature is enabled, so a disabled host can't * pull a skill it never advertised. Honors a user override body; returns * undefined for a user-disabled skill. */ export declare function builtinSkillContent(name: string): string | undefined; /** * The `` prompt block for `prompt` mode: a one-line-per-skill * catalog (name + trigger description) plus the instruction to read the full * body on demand. Deliberately compact (descriptions only) — full instructions * are pulled via `botmux skill show `, mirroring native progressive * disclosure without the per-session token cost of inlining every SKILL.md. * * Contract: only the outer wrapper is structural. The intro and catalog lines * are prose (including dynamic skill descriptions), so escape them here. */ export declare function buildBuiltinSkillCatalogBlock(entries: BuiltinSkillEntry[], locale?: Locale, opts?: { hasRoutingBlock?: boolean; }): string; /** `off` mode nudge: no catalog, just point the model at the CLI's own help. * Returned as an XML block (same `` tag as the catalog) * so it's consistently wrapped rather than a bare line in the prompt. Its * inner help line follows the same text-only contract as the catalog body. */ export declare function builtinSkillHelpPointer(locale?: Locale, opts?: { hasRoutingBlock?: boolean; workflowEnabled?: boolean; }): string; /** * Skill catalog / help block for `injectsSessionContext` CLIs that only have a * global `skillsDir` (genius / grok). Session-manager omits the per-message * skill envelope for these CLIs, so the catalog must ride on the system-prompt * append flag (`--append-system-prompt` / `--rules`). Claude-family uses * `--plugin-dir` instead and does not call this. * * Resolves per-bot / machine `skillInjection` mode: * - `prompt` → compact catalog (on-demand `botmux skill show`) * - `off` → help pointer only * - `global` → empty (files already on disk via ensureCliSkills) * * `hasRoutingBlock` (default true) states whether the caller ALSO emits a * `` block. genius/grok do, via buildBotmuxSystemPromptText. * mojo does not — it is `injectsSessionContext` yet builds its own prompt with no * routing at all — and passing `false` matters twice: * - history/quoted/bots must stay IN the catalog. They are filtered out only * because routing is assumed to teach them; with no routing they would be * documented nowhere. * - the prose must not reference a `` block that isn't there. */ export declare function builtinSkillBlockForInjectsSessionContext(larkAppId: string | undefined, locale: Locale | undefined, opts?: { asksViaHook?: boolean; whiteboardEnabled?: boolean; hasRoutingBlock?: boolean; }): string; //# sourceMappingURL=injection-mode.d.ts.map