/** * composition/bootstrap.ts * * Wires the composition resolver into the agent session lifecycle. * * This module provides: * - `resolveAgentComposition()` — called by session-builder.ts to produce * inline blocks (→ system prompt) and discoverable entries (→ capability * registry) * - `registerCompositionCapabilities()` — called by serve.ts to register * discoverable entries as Protocol v2 capabilities * * Phase 1 limitation: the content loader uses `resolveMixin()` which only * resolves local-path refs (./file.md, /abs/path). Scoped catalog refs * (@publisher/name) require a populated RepoMap from workspace config, which * Phase 2 / Library integration will provide. Unresolvable refs produce * warnings but do not block session start. */ import type { AgentManifest } from "@skaile/workspaces/core"; import type { Logger } from "@skaile/workspaces/types"; import type { CapabilityRegistry } from "../capability-registry.js"; import { type RepoMap } from "../mixin-resolver.js"; import type { DiscoverableEntry, ResolvedComposition } from "./types.js"; export type { ResolvedComposition }; /** * Options for {@link resolveAgentComposition}. * * @docLink packages/runner/capabilities#resolve-agent-composition */ export interface ResolveAgentCompositionOpts { /** Path to the agent definition directory (where agent.yaml lives) */ agentDir: string; /** Parsed agent manifest (must have `composes` field) */ manifest: AgentManifest; /** * Project root — reserved for Phase 2 workspace config resolution. * In Phase 1 this is unused but accepted so the call site doesn't * need updating when Library integration lands. */ projectDir: string; /** Pre-built repo map for catalog resolution. Empty in Phase 1. */ repos?: RepoMap; /** Logger for composition resolution warnings */ log?: Logger; } /** * Resolve an agent's `composes:` items into inline blocks and discoverable * entries. Called by session-builder.ts during the session creation pipeline. * * Returns null when the manifest has no `composes:` items. * * @param opts - Resolution options including agentDir, manifest, and optional repos/log. * @returns A {@link ResolvedComposition} or `null` when there are no composition items. * @docLink packages/runner/capabilities#resolve-agent-composition */ export declare function resolveAgentComposition(opts: ResolveAgentCompositionOpts): Promise; /** * Register discoverable composition entries as Protocol v2 capabilities. * * Each discoverable entry becomes a tool the LLM can invoke to "activate" * that asset. When invoked, the handler returns the asset's full content * (e.g. a SKILL.md body for skills, connection instructions for connectors). * * The LLM sees a lean tool list (name + description only) and loads full * content on demand — this keeps the context window efficient for agents * that compose many assets. * * @param registry - The session capability registry to register capabilities onto. * @param entries - Discoverable entries from a prior {@link resolveAgentComposition} call. * @docLink packages/runner/capabilities#register-composition-capabilities */ export declare function registerCompositionCapabilities(registry: CapabilityRegistry, entries: DiscoverableEntry[]): void; //# sourceMappingURL=bootstrap.d.ts.map