import { type JevCandidate } from "../../agent/jev-tool-prefetch.js"; import { type FrameworkToolGroup } from "../../framework-tools.js"; import type { ContextStatus } from "../../shared/context-status.js"; import type { ContextGovernanceTier, ContextManifestSourceRef, ContextSystemProvenance } from "../../shared/context-xray.js"; import { type OrgDirectoryStatus } from "../agent-discovery.js"; import type { BuilderGatewayAuth } from "../credential-provider.js"; export declare const COMPACT_PROMPT_RESOURCE_MAX_CHARS = 6000; export declare const COMPACT_PROMPT_RESOURCES_TOTAL_MAX_CHARS = 48000; 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; failOnError?: boolean; load(context: PromptContextProviderContext): Promise | PromptContextProviderContribution | null | undefined; } export declare function registerPromptContextProvider(provider: PromptContextProvider): () => void; export declare function compactPromptLine(value: string, maxChars: number): string; export interface JevPromptContextCandidate extends JevCandidate { kind?: string; name: string; scope: string; path?: string; content: string; } export interface PromptResourceManifestSection { label: string; provenance: ContextSystemProvenance; governance: ContextGovernanceTier; content: string; sourceRef?: ContextManifestSourceRef; } export declare function promptResourceManifestSections(prompt: string): PromptResourceManifestSection[]; /** The compact prompt's skills index. `skillReadTool` is the tool the request * registry actually has for reading a skill; with none, the index is dropped * because it would send the model to a tool it cannot call. */ export declare function buildCompactSkillsSummary(skills: ReadonlyArray<{ meta: { name: string; description?: string; }; }>, skillReadTool: string | null): string | null; /** @internal exported for unit tests only */ export declare function promptResourceBlock(input: { name: string; scope: string; content: string; path?: string; maxChars?: number; readHint?: string | null; }): string | null; export interface PromptSection { content: string; governance: ContextGovernanceTier; } export interface SkippedPromptSection { label: string; chars: number; } export interface PromptSectionBudgetResult { sections: string[]; skipped: SkippedPromptSection[]; overflowChars: number; } export declare function selectPromptSectionsWithinBudget(sections: PromptSection[], maxChars: number, runtimeToolHints?: boolean): PromptSectionBudgetResult; export declare function resourceScopeForOwner(owner: string, currentOwner?: string): string; export interface JevPreloadResult { context: string; status: ContextStatus; relevantAppsContext?: string; appSelection?: AppDiscoverySelectionDiagnostic; } export interface AppDiscoverySelectionDiagnostic { status: "selected" | "no-match" | "unavailable" | "failed" | "timed_out"; directoryStatus: OrgDirectoryStatus["status"]; selectedIds: string[]; latencyMs: number; } export declare function preloadJevContextForPrompt(options: Parameters[0]): Promise; export declare function preloadJevContextWithStatus(options: { request: string; appRequest?: string; appId?: string; selfAppId?: string; workspaceAppsEnabled?: boolean; appDiscoveryOnly?: boolean; owner?: string; orgId?: string | null; apiKey?: string; personalApiKey?: string; directApiKey?: string; builderAuth?: BuilderGatewayAuth | null; candidates?: readonly JevPromptContextCandidate[]; fallbackCandidateIds?: readonly string[]; compact?: boolean; maxChars?: number; contextPrefetchDeadlineAt?: number; dispatchToBackground?: boolean; internalContinuation?: boolean; }): Promise; /** * 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. `