/**
 * Crewly Agent Tool Registry
 *
 * Defines all AI SDK tools available to the Crewly Agent runtime.
 * Each tool maps to a Crewly REST API endpoint, replacing the bash
 * skill scripts used by PTY-based runtimes.
 *
 * @module services/agent/crewly-agent/tool-registry
 */
import type { CrewlyApiClient } from './api-client.js';
import type { ToolDefinition, ToolCallbacks, ToolSensitivity } from './types.js';
/**
 * Bash commands that require explicit approval before execution.
 * These are dangerous but not catastrophic — they modify remote state,
 * delete files, or interact with container/network infrastructure.
 *
 * Matched against the raw command string (case-insensitive, word-boundary).
 */
export declare const APPROVAL_REQUIRED_BASH_PATTERNS: Array<{
    pattern: RegExp;
    label: string;
}>;
/**
 * Validate a shell command against the blocklist.
 *
 * @param command - Raw shell command string
 * @returns Error message if blocked, or null if allowed
 */
export declare function validateBashCommand(command: string): string | null;
/**
 * Check if a bash command matches any approval-required pattern.
 *
 * @param command - Raw shell command string
 * @returns Matching label if approval is required, or null if safe to proceed
 */
export declare function checkBashApprovalRequired(command: string): string | null;
/**
 * Convert a glob pattern to a RegExp.
 *
 * Supports:
 * - `*` matches any characters except `/`
 * - `**` matches any characters including `/` (recursive)
 * - `?` matches a single character except `/`
 * - `{a,b}` matches either a or b
 * - Character classes `[abc]`
 *
 * @param pattern - Glob pattern string (e.g., "src/**\/*.ts")
 * @returns Compiled RegExp
 */
export declare function globToRegExp(pattern: string): RegExp;
/**
 * Recursively walk a directory tree, yielding file paths that match
 * the given glob pattern while respecting ignore patterns.
 *
 * Uses a stack-based iterative approach to avoid stack overflow on deep trees.
 * Respects DEFAULT_IGNORE_PATTERNS and user-supplied ignore patterns.
 *
 * @param rootDir - Root directory to start traversal
 * @param patternRegex - Compiled glob regex to test relative paths against
 * @param ignoreSet - Set of directory base names to skip
 * @param maxResults - Maximum number of results to return
 * @returns Array of matching absolute file paths
 */
export declare function walkAndMatch(rootDir: string, patternRegex: RegExp, ignoreSet: Set<string>, maxResults: number): Promise<string[]>;
/**
 * Search file contents for lines matching a regular expression.
 *
 * Reads the file once, splits into lines, and tests each against the pattern.
 * Returns matching lines with line numbers and optional context lines.
 *
 * @param filePath - Absolute path to the file to search
 * @param regex - Compiled RegExp to test each line
 * @param contextLines - Number of lines before and after each match to include
 * @returns Array of match objects with line number, content, and context
 */
export declare function searchFileContents(filePath: string, regex: RegExp, contextLines: number): Promise<Array<{
    line: number;
    content: string;
    context?: string[];
}>>;
/**
 * Strip [NOTIFY]...[/NOTIFY] markers from text.
 *
 * The crewly-agent model sometimes wraps tool arguments in NOTIFY markers
 * intended for the terminal gateway routing layer. When this leaks into
 * reply_slack or other outward-facing tools, the raw markers appear in
 * the Slack message. This function extracts the body content (after the
 * --- separator if present) or the full block content.
 *
 * @param text - Text that may contain NOTIFY markers
 * @returns Clean text with markers stripped and body content extracted
 */
export declare function stripNotifyMarkers(text: string): string;
/**
 * Convert GitHub-flavored Markdown to Slack mrkdwn format (#181).
 *
 * Transformations applied (in order):
 * 1. Escape &, <, > to HTML entities (Slack requirement)
 * 2. Convert fenced code blocks (```lang\n...\n```) to Slack code blocks
 * 3. Convert **bold** to *bold* (Slack uses single asterisks)
 * 4. Convert [text](url) links to <url|text> (Slack link format)
 *
 * @param text - Markdown-formatted text
 * @returns Text formatted for Slack mrkdwn
 */
export declare function convertMarkdownToSlackMrkdwn(text: string): string;
/**
 * Sensitivity classification for each tool.
 * Used by the audit trail to classify tool invocations.
 */
export declare const TOOL_SENSITIVITY: Record<string, ToolSensitivity>;
/**
 * Create the complete set of AI SDK tools for the Crewly Agent.
 *
 * Each tool's execute function calls the Crewly REST API directly
 * via the provided API client, bypassing the bash script layer.
 * Tools are wrapped with audit logging when callbacks are provided.
 *
 * @param client - API client instance for making REST calls
 * @param sessionName - Agent session name for identity context
 * @param projectPath - Optional project path for auto-injection
 * @param callbacks - Optional callbacks for compaction and audit logging
 * @returns Object of named tools ready to pass to generateText
 */
export declare function createTools(client: CrewlyApiClient, sessionName: string, projectPath?: string, callbacks?: ToolCallbacks, conversationId?: string, slackContext?: {
    channelId: string;
    threadTs?: string;
}, mcpTools?: Record<string, ToolDefinition>): Record<string, ToolDefinition>;
/**
 * Get the list of tool names available in the registry.
 *
 * @returns Array of tool name strings
 */
export declare function getToolNames(): string[];
//# sourceMappingURL=tool-registry.d.ts.map