/** * System prompt construction and project context loading */ import type { AgentTool } from "@gajae-code/agent-core"; import type { SkillsSettings } from "./config/settings"; import type { Skill } from "./extensibility/skills"; import { type WorkspaceTree } from "./workspace-tree"; interface AlwaysApplyRule { name: string; content: string; path: string; } /** Resolve input as file path or literal string */ export declare function resolvePromptInput(input: string | undefined, description: string): Promise; export interface LoadContextFilesOptions { /** Working directory to start walking up from. Default: getProjectDir() */ cwd?: string; } export interface ProjectContextFilesResult { contextFiles: Array<{ path: string; content: string; depth?: number; }>; warnings: string[]; } /** * Load all context files using the capability API. * Returns {path, content, depth} entries for all discovered context files. * Native user-global files (`~/.gjc/agent/AGENTS.md`) come first, then project * files sorted by depth (descending) so files closer to cwd appear last/more * prominent. User-home files from foreign providers (`~/.claude/CLAUDE.md`, * `~/.codex/AGENTS.md`, …) stay excluded — only gjc's own user config applies. */ export declare function loadProjectContextFilesResult(options?: LoadContextFilesOptions): Promise; /** Load project context files without exposing discovery diagnostics. */ export declare function loadProjectContextFiles(options?: LoadContextFilesOptions): Promise>; /** * Load the effective system prompt customization from SYSTEM.md. * Project-level SYSTEM.md overrides user-level SYSTEM.md. */ export declare function loadSystemPromptFiles(options?: LoadContextFilesOptions): Promise; export interface SystemPromptToolMetadata { label: string; description: string; /** Tool name the model sees on the provider wire. Defaults to the internal tool name. */ wireName?: string; } export declare function buildSystemPromptToolMetadata(tools: Map, overrides?: Partial>>): Map; export interface BuildSystemPromptOptions { /** Custom system prompt (replaces default). */ customPrompt?: string; /** Tools to include in prompt. */ tools?: Map; /** Tool names to include in prompt. */ toolNames?: string[]; /** Text to append to system prompt. */ appendSystemPrompt?: string; /** Rendered GJC plugin system-appendix blocks (lower-authority, appended last). */ pluginAppendices?: string; /** Repeat full tool descriptions in system prompt. Default: false */ repeatToolDescriptions?: boolean; /** Skills settings for discovery. */ skillsSettings?: SkillsSettings; /** Working directory. Default: getProjectDir() */ cwd?: string; /** Pre-loaded context files (skips discovery if provided). */ contextFiles?: Array<{ path: string; content: string; depth?: number; }>; /** Skills provided directly to system prompt construction. */ skills?: Skill[]; /** Pre-loaded rulebook rules (descriptions, excluding TTSR and always-apply). */ rules?: Array<{ name: string; description?: string; path: string; globs?: string[]; }>; /** Intent field name injected into every tool schema. If set, explains the field in the prompt. */ intentField?: string; /** Whether built-in tool discovery is active; enables the tool-discovery prompt block. */ toolDiscoveryActive?: boolean; /** Encourage the agent to delegate via tasks unless changes are trivial. */ eagerTasks?: boolean; /** Rules with alwaysApply=true — their full content is injected into the prompt. */ alwaysApplyRules?: AlwaysApplyRule[]; /** Whether secret obfuscation is active. When true, explains the redaction format in the prompt. */ secretsEnabled?: boolean; /** Pre-loaded workspace tree (skips discovery if provided). May be a Promise to allow early kick-off. */ workspaceTree?: WorkspaceTree | Promise; /** * Render a trimmed role-agent base prompt for subagent sessions: omits the * workflow-surface/routing/self-awareness (``) and `` blocks * that only apply to the top-level interactive/print agent. Tool safety, repo * safety, and the completion contract are retained. Default: false. */ subagent?: boolean; } export interface BuildSystemPromptResult { /** Ordered system prompt blocks. Providers should preserve entries as distinct messages/blocks. */ systemPrompt: string[]; /** Context-file discovery warnings visible to SDK and session callers. */ warnings: string[]; } /** Host wall-clock facts injected with every turn. */ export interface LocalTimeContext { /** Local calendar date with weekday, e.g. `2026-08-19 (Wed)`. */ date: string; /** Local clock time with UTC offset and IANA zone, e.g. `21:04 UTC+09:00 (Asia/Seoul)`. */ time: string; } /** * Render the host's local date and clock time for the volatile turn context. * * Every field is derived from a single `Intl.DateTimeFormat` pass over one * resolved zone, so the date, clock, offset, and zone name can never disagree * with each other the way `Date`'s local getters can. Falls back to UTC only * when the runtime has no usable ICU zone. * * @param timeZone IANA zone override. Default: the host zone. */ export declare function getLocalTimeContext(now?: Date, timeZone?: string): LocalTimeContext; export interface BuildVolatileProjectContextOptions { cwd?: string; /** Clock source for the rendered local date/time. Default: `new Date()`. */ now?: Date; /** Trusted/test-only override in the derived `YYYY-MM-DD (Www)` or `YYYY-MM-DD` format. */ date?: string; /** Trusted/test-only override in the derived `HH:MM UTC±HH:MM (IANA/Zone)` format. */ localTime?: string; workspaceTree?: WorkspaceTree; } export declare function buildVolatileProjectContext(options?: BuildVolatileProjectContextOptions): string; /** Build the system prompt with tools, guidelines, and context */ export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): Promise; export {};