import type { JsonValue } from './json.js'; export type ContextRole = 'system' | 'user' | 'assistant' | 'tool'; export interface MarkdownContextBlock { readonly kind: 'markdown'; readonly content: string; readonly source?: string; } export interface JsonContextBlock { readonly kind: 'json'; readonly value: JsonValue; readonly source?: string; } export type ContextBlockInput = string | MarkdownContextBlock | JsonContextBlock; export interface HistoryMessage { readonly role: ContextRole; readonly content: string; readonly name?: string; readonly timestamp?: string; /** Host run that committed this message, used for continuation snapshots. */ readonly runId?: string; /** Host-only identity for idempotent history-only delivery commits. */ readonly idempotencyKey?: string; } export interface SkillIndexEntry { readonly name: string; readonly description: string; readonly mainFile: string; } /** * A skill index entry without its on-disk location. * * What crosses into runtime options — and therefore into a subagent request — * is only what is needed to *render* an index. `mainFile` is an absolute host * path, so dropping it here is what keeps host paths out of run options and out * of any prompt built from them. */ export type SkillIndexSummary = Pick; export interface BuildContextInput { readonly identity: ContextBlockInput; readonly userMessage: string; readonly core?: ContextBlockInput; /** * Live runtime facts about the current turn: whether it is a deliverable push * conversation, an interactive console conversation, or a request-driven one, * which surface it is on, and the per-message budget there. Never the route; * the one id disclosed is a console thread's own conversation id — see * `sessionContextBlock`. */ readonly session?: ContextBlockInput; readonly memory?: ContextBlockInput | readonly ContextBlockInput[]; readonly history?: readonly HistoryMessage[]; readonly skills?: readonly SkillIndexEntry[]; /** Emits ReadSkill usage guidance when skill bodies are disclosed on demand. */ readonly skillDisclosure?: 'index' | 'full'; /** * True only on a confirmed warm provider session, where earlier turns — * including any skill body already loaded — are still in the live transcript. * A cold reseed replays history as text and must not claim otherwise. */ readonly warmSession?: boolean; readonly skillInstructions?: ContextBlockInput | readonly ContextBlockInput[]; } export type ContextSectionId = 'core' | 'identity' | 'session' | 'memory' | 'history' | 'skills' | 'skill-instructions' | 'user-message'; export interface ContextSection { readonly id: ContextSectionId; readonly title: string; readonly content: string; readonly source?: string; } export interface BuiltAgentContext { /** Complete inspection representation, not the provider system prompt. */ readonly prompt: string; /** Stable provider instructions selected by typed section ids. */ readonly systemPrompt: string; /** Host facts to prefix to the current user message at dispatch only. */ readonly turnContext: string; readonly sections: readonly ContextSection[]; readonly metadata: { readonly usedDefaultCore: boolean; readonly skillCount: number; readonly historyCount: number; readonly sources: readonly string[]; }; } export interface FileContextInput { readonly identityPath: string; readonly userMessage: string; readonly soulPath?: string; readonly session?: ContextBlockInput; readonly memory?: ContextBlockInput | readonly ContextBlockInput[]; readonly history?: readonly HistoryMessage[]; readonly skills?: readonly SkillIndexEntry[]; readonly skillsRoot?: string; /** Emits ReadSkill usage guidance when skill bodies are disclosed on demand. */ readonly skillDisclosure?: 'index' | 'full'; /** * True only on a confirmed warm provider session, where earlier turns — * including any skill body already loaded — are still in the live transcript. * A cold reseed replays history as text and must not claim otherwise. */ readonly warmSession?: boolean; readonly skillInstructions?: ContextBlockInput | readonly ContextBlockInput[]; } //# sourceMappingURL=types.d.ts.map