export interface StddCapabilities { subagents: boolean; crossCli: boolean; worktrees: boolean; } export interface StddConfig { forbiddenArtifacts: string[]; canonicalDocs: string[]; temporalPhrases: string[]; readiness: { required: Array<{ path: string; hint?: string }> }; contentRules: Array<{ name: string; files: string; forbid?: string; require?: string; message?: string; newFilesOnly?: boolean; }>; projectLog: { enabled: boolean }; capabilities: StddCapabilities; review: { via: "subagent" | "codex" | "claude"; maxRounds: number }; baseRef?: string; redPattern?: string | null; branchPattern?: string | null; } export type StddConfigInput = Partial> & { capabilities?: Partial; projectLog?: Partial; review?: Partial; }; export type DeepReadonly = T extends ReadonlyArray ? ReadonlyArray> : T extends object ? { readonly [Key in keyof T]: DeepReadonly } : T; export const STDD_VERSION: string; export const DEFAULT_CONFIG: DeepReadonly; export interface AgentAdapter { readonly id: string; readonly skillRoot: string; readonly instructionsFile: string; readonly snippetFile: string; readonly explicitPrefix: string; readonly hooksFile: string; readonly crossCliReviewVia?: "codex" | "claude" | null; } export const AGENT_ADAPTERS: DeepReadonly>; export function defineAgentAdapter(adapter: AgentAdapter): DeepReadonly; export function getAgentAdapter(id: string): AgentAdapter; export function renderAgentSkill(input: { adapter?: string | AgentAdapter; name: string; description: string; when?: string; body: string; stamp: string; }): string; export function renderAgentInstructions(input: { adapter: string | AgentAdapter; stamp: string; npmRunner: string; crossCli: boolean; projectLogEnabled?: boolean; }): string; export function assertSkillName(name: string, label?: string): string; export function isPrintableSingleLine(value: unknown): value is string; export function assertPrintableSingleLine(value: unknown, label?: string): string; export function resolveRepoPath(root: string, relative: string, label?: string): string; export function resolveWritableRepoPath(root: string, relative: string, label?: string): string; export function deriveLoopState( events: Array>, currentSnapshot: string, nonDocChanged?: boolean, ): { lastRedIdx: number; redEvent: Record | null; redLegacy: boolean; recordedVerify: Record | null; verifyEvent: Record | null; verifyStale: boolean; implementationObserved: boolean; loop: { red: Record & { done: boolean }; impl: { done: boolean }; verify: Record & { done: boolean; stale?: boolean }; }; }; export function deriveTaskState(events: unknown): | { state: "legacy"; task: null } | { state: "idle"; task: null; boundary: Record } | { state: "invalid"; task: null; boundary: unknown; reason: string; } | { state: "active"; task: { id: string; name: string; branch: string | undefined; startedAt: string | undefined; planBaseline: string | null; }; boundary: Record; }; export function scopeTaskEvents(events: unknown): { state: ReturnType; events: Array>; }; export function mergeConfig(config: StddConfigInput): StddConfig; export function extractDocPaths(content: string): string[]; export function parseLedger(text: string): Array>; export function parsePlan(text: string): { items: Array<{ line: number; checked: boolean; text: string; red: string | null; review: boolean; }>; deferred: string[]; mode: "inline" | "delegated" | null; }; export function sha256(content: string | Uint8Array): string;