/** * The opt-in surface of org sections spec 6.8 (Phase 2): typed brief fields, * notes and the session cap exist only for an org that sets a * `run_config.context` key. Tool definitions are part of the cached prompt * prefix, so an org that adopts nothing keeps its tool list and prompt byte * for byte; adopting is a configuration change that starts new prefixes. * * The typed brief fields extend the existing free-text `brief` rather than add * a second one: they are rendered with the free text into one brief, bounded * by the same MAX_TASK_BRIEF and delivered by the same dispatch line. */ import { z } from 'zod'; import type { OrgDef } from './types.js'; export interface ContextSurface { /** Any context key adopted: the Phase 2 tools, fields and injection exist. */ enabled: boolean; /** A task missing `objective` or `acceptance` is rejected, not warned about. */ requireBrief: boolean; notes: boolean; sessionCap?: { tasks?: number; tokens?: number; }; } export declare function contextSurface(def: Pick | undefined): ContextSurface; /** The longest `result` a delegated task may return (R20: a summary, never a transcript). */ export declare const MAX_TASK_RESULT = 1000; /** Appended to org_task_done's description for an org on the surface. */ export declare const TASK_RESULT_HELP: string; /** The rejection for an over-long result, or undefined. */ export declare function checkTaskResult(result: string | undefined): string | undefined; /** The typed brief fields, in the order they are rendered. */ export declare const BRIEF_FIELDS: readonly ['objective', 'output', 'tools', 'boundaries', 'acceptance']; export type BriefField = (typeof BRIEF_FIELDS)[number]; export type BriefFields = Partial>; /** Argument schemas for the typed fields, added to org_task and org_plan_graph * nodes only when the surface is enabled. */ export declare function briefFieldArgs(): Record; /** The guidance appended to org_task's description when the surface is on. */ export declare const BRIEF_FIELD_HELP = " Also give the typed brief fields: `objective` (what the task is for), `output` (what to hand back and in what format), `tools` (what to use and what to avoid), `boundaries` (what is out of scope) and `acceptance` (how it is judged done). They are rendered with `brief` into the one brief the assignee receives."; export interface BriefCheck { /** The rendered brief to store and dispatch; absent when the task is rejected. */ brief?: string; error?: string; warnings: string[]; } /** Render and check one task's brief. `label` names the task in messages. */ export declare function checkBrief(surface: ContextSurface, fields: BriefFields, free: string | undefined, label?: string): BriefCheck; /** Add `warnings` to a tool result that is JSON, or append them to plain text. */ export declare function withWarnings(result: string, warnings: string[]): string; //# sourceMappingURL=context-surface.d.ts.map