import { type Skill } from "./core/skills.js"; import { type ContextLimits } from "./core/context-limits.js"; import type { LanguageId } from "./core/language-detector.js"; import type { Provider } from "@kenkaiiii/gg-ai"; /** Combined byte budget for all project instruction files (Codex default). */ export declare const PROJECT_CONTEXT_MAX_BYTES: number; /** * Deterministic hierarchical instruction resolver. * * Walks from cwd up to the filesystem root picking at most ONE instruction * file per directory (CONTEXT_FILES priority order, first match wins), skips * empty files, strips BOMs, and renders root-first (broad → narrow) so the * nearest file lands last — where LLM recency bias weights it most. A 32 KiB * combined budget is filled nearest-first (the nearest instructions are the * most binding); files dropped by the cap are reported in a one-line note. */ export declare function collectProjectContext(cwd: string, limits?: ContextLimits): Promise; /** Extra Environment-section facts that vary per session rather than per host. */ export interface SystemPromptEnvironment { /** Extra workspace roots added with `/add-dir`. */ additionalRoots?: readonly string[]; /** Hosts the network allowlist permits, when `networkMode` is `allowlist`. */ networkAllow?: readonly string[]; } /** * What every sub-agent owes its parent. * * Appended by `buildSubAgentSystemPrompt`, so user-authored agent files inherit * it without repeating it. The parent pays context for whatever comes back, and * it cannot see the child's transcript — so the reply has to be the answer, not * a narration of the search that produced it. */ export declare const SUBAGENT_RETURN_CONTRACT: string; /** * Build a sub-agent's system prompt: its own definition PLUS the scaffolding * that teaches correct tool use. * * An agent definition body replaces the parent's Identity/Talk/Work sections — * that is the point of a specialized agent. It must NOT also cost the child its * Tools section, project conventions, or Environment facts (cwd, platform, * shell, date), which is what a bare prompt override did: children ran blind to * their own toolset and re-derived basics every session. * * @param agentBody — the agent definition's markdown body (its identity + method). * @param opts.toolNames — exactly the tools this child can call, so the Tools * section never advertises something the allow-list strips. * @param opts.context — `"none"` skips project instruction files, for recon * agents where conventions are dead weight. */ export declare function buildSubAgentSystemPrompt(agentBody: string, opts: { cwd: string; toolNames?: readonly string[]; /** Tools available via `tool_search` but not carrying a schema this turn. */ deferredToolNames?: readonly string[]; context?: "project" | "none"; environment?: SystemPromptEnvironment; /** Byte budgets for skill catalog / project instructions / total ceiling. */ contextLimits?: ContextLimits; }): Promise; /** * Build the system prompt dynamically based on cwd and context. * * @param toolNames — if provided, the Tools section only lists these tools. * Pass `tools.map(t => t.name)` from the session so the prompt reflects * exactly what the model can call. Defaults to the full built-in set. * @param provider — the active LLM provider. Drives the product identity * (`anthropic` → "Claude Code", everything else → "GG Coder"). * @param environment — extra Environment-section facts (additional workspace * roots, network allowlist). This sits in the cached prefix, so changing it * costs exactly one cache-miss turn. * @param deferredToolNames — tools the model can call only after `tool_search` * promotes them. Listed as one-line hints so the capability stays discoverable * while its parameter schema stays out of the request. */ export declare function buildSystemPrompt(cwd: string, skills?: Skill[], planMode?: boolean, approvedPlanPath?: string, toolNames?: readonly string[], activeLanguages?: Set, provider?: Provider, environment?: SystemPromptEnvironment, deferredToolNames?: readonly string[], /** Byte budgets for skill catalog / project instructions / total ceiling. */ contextLimits?: ContextLimits): Promise; //# sourceMappingURL=system-prompt.d.ts.map