/** * prompt-assembly.ts * * Utility for assembling multi-section system prompts. Joins non-empty * parts with the standard section separator (`\n\n---\n\n`) and wraps * registry-driven capability prompt fragments into the v2 `` * block. */ import type { CapabilityRegistry } from "./capability-registry.js"; /** * Join non-empty parts with the standard section separator (`\n\n---\n\n`). * * Returns `undefined` when all parts are empty or falsy, so callers can * use a nullish check instead of inspecting an empty string. * * @param parts - Array of prompt sections; may include `undefined`, `null`, * or empty strings — those are filtered out before joining. * @returns The assembled prompt string, or `undefined` if nothing to join. * @docLink packages/runner/capabilities#system-prompt-capabilities-block */ export declare function assembleSystemPrompt(parts: (string | undefined | null)[]): string | undefined; /** * Build the protocol-v2 `` system-prompt block from a * {@link CapabilityRegistry}. * * The block joins every capability's `promptFragment` in the order encoded by * `CapabilityRegistry.composePromptSection()`: framework first, then client * (platform.* and other client-side surfaces), then agent-side surfaces * (skill / flow / mcp / connector / mount). Capabilities without a * `promptFragment` are skipped. * * Replaces the AAP-era `` / `` injection. * Callers append the returned string to `additionalPromptSections` so the * fragment lands inside the standard `assembleSystemPrompt` pipeline. * * @returns The wrapped block, or `undefined` when the registry has no * prompt-bearing capabilities (so callers can use a nullish check before * forwarding to `additionalPromptSections`). * @docLink packages/runner/capabilities#system-prompt-capabilities-block */ export declare function buildCapabilitiesPromptSection(registry: Pick): string | undefined; /** * One linked peer session the current session's agent may consult via the * agent-to-agent capabilities. Supplied by the platform when starting or * waking a session — the platform resolves each `SessionLink` target's name * and `externalScope`. * * @category Capabilities * @since 3.3.0 */ export type LinkedPeer = { /** Target session id — passed to `platform.ask_session` / `platform.send_to_session`. */ sessionId: string; /** Human-readable session name, shown to the agent. */ name: string; /** The peer's `externalScope` — what its agent is about and can answer. */ scope: string; }; /** * Render the `` system-prompt block from a list of linked * peer sessions. * * The block tells the agent which peer sessions it may consult (via * `platform.ask_session` / `platform.send_to_session`) and on what topic, * so it can decide autonomously when to reach out. * * Returns `undefined` when there are no peers, so callers can use a nullish * check before forwarding the section to `additionalPromptSections`. * * The platform is responsible for building the {@link LinkedPeer} list (query * `SessionLink`, resolve names + scopes) and passing the rendered block as one * more entry in `AgentSessionConfig.additionalPromptSections`. On a hot-plug * (`runner.peers_changed`) the platform re-renders and re-pushes the section. * * @param peers - The current session's linked peers. * @returns The wrapped `` block, or `undefined` when empty. * @category Capabilities * @since 3.3.0 */ export declare function buildLinkedPeersPromptSection(peers: readonly LinkedPeer[]): string | undefined; //# sourceMappingURL=prompt-assembly.d.ts.map