import { type SkillDiscoverySettings } from "../config/skill-settings-defaults"; import { type SkillActiveEntry, type SkillActiveState } from "../skill-state/active-state"; import { initialPhaseForSkill } from "../skill-state/initial-phase"; export { initialPhaseForSkill }; import { type GjcWorkflowSkill } from "./skill-keywords"; export declare const GJC_STATE_DIR = ".gjc"; export declare const SKILL_ACTIVE_STATE_FILE = "skill-active-state.json"; export interface EffectiveSkillConfigInput { skillsSettings?: SkillDiscoverySettings; disabledExtensions?: string[]; unavailableReason?: string; } export declare function buildSanitizedEffectiveSkillConfigContext(input: EffectiveSkillConfigInput | undefined): string; export interface SkillKeywordMatch { keyword: string; skill: GjcWorkflowSkill; priority: number; } export type { SkillActiveEntry, SkillActiveState } from "../skill-state/active-state"; export interface ModeState { active?: boolean; current_phase?: string; skill?: string; session_id?: string; thread_id?: string; cwd?: string; updated_at?: string; handoff_from?: string; handoff_to?: string; handoff_at?: string; [key: string]: unknown; } export interface RecordSkillActivationInput { cwd: string; text: string; sessionId?: string; threadId?: string; turnId?: string; nowIso?: string; stateDir?: string; } export interface StopHookInput { cwd: string; sessionId?: string; threadId?: string; stateDir?: string; sessionFile?: string; } export interface UserPromptSubmitStateInput { cwd: string; sessionId?: string; threadId?: string; stateDir?: string; prompt?: string; sessionFile?: string; } export declare function detectSkillKeywords(text: string): SkillKeywordMatch[]; export declare function detectPrimarySkillKeyword(text: string): SkillKeywordMatch | null; export declare function resolveGjcStateDir(cwd: string, stateDir?: string): string; export interface StateRecoveryDiagnostic { kind: "skill-active-state" | "mode-state"; statePath: string; reason: "missing" | "corrupt" | "unreadable"; skill?: GjcWorkflowSkill; } export declare function buildStateRecoveryDiagnosticsContext(diagnostics: readonly StateRecoveryDiagnostic[]): string | null; export declare function collectUserPromptStateRecoveryDiagnostics(input: UserPromptSubmitStateInput): Promise; export declare function readVisibleSkillActiveState(cwd: string, sessionId?: string, _stateDir?: string): Promise; export declare function recordSkillActivation(input: RecordSkillActivationInput): Promise; export interface EnsureWorkflowSkillActivationInput { cwd: string; skill: string; sessionId?: string; threadId?: string; turnId?: string; nowIso?: string; stateDir?: string; activeSubskills?: SkillActiveEntry["active_subskills"]; } export interface WorkflowSkillActivationSeed { state: SkillActiveState | null; seeded: boolean; rollback(): Promise; } /** * Idempotently seed `.gjc/state` for a workflow skill that was invoked directly * (e.g. via `/skill:`) rather than through keyword detection. This ensures * the mutation guard and Stop hook engage the moment a workflow skill becomes * active, instead of relying on the skill prompt to run its own state-init steps. * * The seed is non-destructive: if an active entry for this skill already exists * (for example after a `gjc state handoff` promotion that carries * `handoff_from`/`handoff_at` lineage), nothing is written so lineage is * preserved. Non-workflow skills are ignored. */ export declare function ensureWorkflowSkillActivationSeed(input: EnsureWorkflowSkillActivationInput): Promise; export declare function ensureWorkflowSkillActivationState(input: EnsureWorkflowSkillActivationInput): Promise; export declare function buildActiveUltragoalPromptContext(input: UserPromptSubmitStateInput): Promise; export declare function buildSkillStopOutput(input: StopHookInput): Promise | null>; export declare function buildSkillActivationAdditionalContext(state: SkillActiveState, effectiveSkillConfig?: EffectiveSkillConfigInput): string;