import { ITextEditorSelection } from "@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation"; import { type IParsedHookCommand } from "../../../../../platform/agentPlugins/common/pluginParsers.js"; import { HookType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookTypes"; import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service"; import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform"; /** * Finds the selection range for a hook command field value in JSON content. * Supports both simple format and nested matcher format: * - Simple: { hooks: { hookType: [{ command: "..." }] } } * - Nested: { hooks: { hookType: [{ matcher: "", hooks: [{ command: "..." }] }] } } * * The index is a flattened index across all commands in the hook type, regardless of nesting. * * @param content The JSON file content * @param hookType The hook type (e.g., "sessionStart") * @param index The flattened index of the hook command within the hook type * @param fieldName The field name to find ('command', 'bash', or 'powershell') * @returns The selection range for the field value, or undefined if not found */ export declare function findHookCommandSelection(content: string, hookType: string, index: number, fieldName: string): ITextEditorSelection | undefined; /** * Finds the selection range for a hook command string in a YAML/Markdown file * (e.g., an agent `.md` file with YAML frontmatter). * * Searches for the command text within command field lines and selects the value. * Supports all hook command field keys: command, windows, linux, osx, bash, powershell. * * @param content The full file content * @param commandText The command string to locate * @returns The selection range, or undefined if not found */ export declare function findHookCommandInYaml(content: string, commandText: string): ITextEditorSelection | undefined; /** * Parsed hook information. */ export interface IParsedHook { hookType: HookType; hookTypeLabel: string; command: IParsedHookCommand; commandLabel: string; fileUri: URI; filePath: string; index: number; /** The original hook type ID as it appears in the JSON file */ originalHookTypeId: string; /** If true, this hook is disabled via `disableAllHooks: true` in its file */ disabled?: boolean; /** If set, this hook came from a custom agent's frontmatter */ agentName?: string; } export interface IParseAllHookFilesOptions { /** Additional file URIs to parse (e.g., files skipped due to disableAllHooks) */ additionalDisabledFileUris?: readonly URI[]; /** If true, also collect hooks from custom agent frontmatter */ includeAgentHooks?: boolean; } /** * Parses all hook files and extracts individual hooks. * This is a shared helper used by both the configure action and diagnostics. */ export declare function parseAllHookFiles(promptsService: IPromptsService, fileService: IFileService, labelService: ILabelService, workspaceRootUri: URI | undefined, userHome: string, os: OperatingSystem, token: CancellationToken, options?: IParseAllHookFilesOptions): Promise;