import type { ContextGovernanceTier, ContextManifestSourceRef, ContextSystemProvenance } from "../../shared/context-xray.js"; export declare const COMPACT_PROMPT_RESOURCE_MAX_CHARS = 6000; export interface PromptContextProviderContext { owner: string; compact: boolean; selfAppId?: string; orgId: string | null; } export interface PromptContextProviderContribution { content: string; label?: string; provenance?: ContextSystemProvenance; governance?: ContextGovernanceTier; sourceRef?: ContextManifestSourceRef; } export interface PromptContextProvider { id: string; load(context: PromptContextProviderContext): Promise | PromptContextProviderContribution | null | undefined; } /** Register a package-owned, request-scoped system-context contribution. */ export declare function registerPromptContextProvider(provider: PromptContextProvider): () => void; export declare function compactPromptLine(value: string, maxChars: number): string; export interface PromptResourceManifestSection { label: string; provenance: ContextSystemProvenance; governance: ContextGovernanceTier; content: string; sourceRef?: ContextManifestSourceRef; } /** * Extracts bounded-in-memory metadata from the already-composed resource * prompt. The caller turns these inputs into hashed/previews before anything * is persisted; this helper never writes or returns the full manifest. */ export declare function promptResourceManifestSections(prompt: string): PromptResourceManifestSection[]; /** * One assembled startup-context block plus the governance tier the context * manifest reports for it (`ContextGovernanceTier`). `required` is the tier * that already meant "not opt-out-able" in the manifest; the budget fitter * honours it as "reserve before anything else competes". */ export interface PromptSection { content: string; governance: ContextGovernanceTier; } export interface SkippedPromptSection { label: string; chars: number; } export interface PromptSectionBudgetResult { sections: string[]; skipped: SkippedPromptSection[]; /** Chars by which required sections alone exceeded `maxChars`, else 0. */ overflowChars: number; } /** * Fits assembled startup context into `maxChars`, reserving `required` * sections before discretionary ones compete for the remainder, and reporting * every omission so an over-budget request is never silent. * * Required sections are never truncated and never dropped: a half-rendered * list of workspace apps or governance rules reads to the model as a complete * one, which is worse than an explicit note that a section is missing. If they * alone exceed the budget, the budget is exceeded deliberately, every * discretionary section is dropped, and `overflowChars` reports by how much. */ export declare function selectPromptSectionsWithinBudget(sections: PromptSection[], maxChars: number): PromptSectionBudgetResult; export declare function resourceScopeForOwner(owner: string, currentOwner?: string): string; /** * Pre-load the agent's context: AGENTS.md (workspace/template/runtime * instructions), the skills index, shared LEARNINGS.md (team notes), a shared * resource index, and memory/MEMORY.md (personal structured memory index). * These all get appended to the system prompt so the agent has everything it * needs from the first turn. * * Six sources are layered: * * 1. `` — AGENTS.md from the enterprise workspace core. * 2. `