{"kind": "string_enum", "name": "MacOSAppearance", "js_doc": "/**\n * System UI appearance reported by native macOS APIs (`detectMacOSAppearance`\n * and observer).\n */\n", "def": "/** Dark color scheme. */\nDark = 'dark',\n /** Light color scheme. */\nLight = 'light'", "original_name": "MacOSAppearance"}
{"kind": "fn", "name": "detectMacOSAppearance", "js_doc": "/**\n * Detect macOS system appearance via CoreFoundation.\n * Returns `\"dark\"` or `\"light\"` on macOS, `null` on other platforms.\n */\n", "def": "function detectMacOSAppearance(): MacOSAppearance | null"}
{"kind": "struct", "name": "MacAppearanceObserver", "js_doc": "/**\n * Long-lived macOS appearance observer.\n * \n * Subscribes to `AppleInterfaceThemeChangedNotification` via\n * `CFDistributedNotificationCenter` and calls the provided callback\n * with `\"dark\"` or `\"light\"` on each change (and once on start).\n * \n * A 2-second polling timer also runs as fallback \u2014 distributed\n * notifications may not reliably reach background threads on all\n * macOS versions.\n * \n * On non-macOS platforms, `start()` returns a no-op observer.\n */\n", "def": "", "original_name": "MacAppearanceObserver"}
{"kind": "impl", "name": "MacAppearanceObserver", "js_doc": "", "def": "static start(callback: (err: null | Error, appearance: MacOSAppearance) => void): MacAppearanceObserver\\n stop(): void"}
{"kind": "string_enum", "name": "AstMatchStrictness", "js_doc": "/** ast-grep pattern strictness (controls how patterns match syntax). */\n", "def": "/** Match at the concrete syntax tree level. */\nCst = 'cst',\n /** Balanced default suitable for most searches. */\nSmart = 'smart',\n /** Match at the AST level. */\nAst = 'ast',\n /** More permissive matching. */\nRelaxed = 'relaxed',\n /** Match structural signatures. */\nSignature = 'signature',\n /** Template-style pattern matching. */\nTemplate = 'template'", "original_name": "AstMatchStrictness"}
{"kind": "interface", "name": "AstFindOptions", "js_doc": "/** Options for `astGrep`: patterns, scan scope, and match limits. */\n", "def": "/** ast-grep patterns to search for (OR across patterns). */\npatterns?: Array<string>\\n/** Language override; otherwise inferred from file extension per candidate. */\nlang?: string\\n/** Single file or directory to scan (combined with `glob` when set). */\npath?: string\\n/** Optional glob filter relative to the search root. */\nglob?: string\\n/** Rule selector for multi-rule ast-grep configurations. */\nselector?: string\\n/** Pattern strictness; defaults to smart matching when omitted. */\nstrictness?: AstMatchStrictness\\n/** Maximum matches to return after `offset` (default applies when omitted). */\nlimit?: number\\n/** Number of leading matches to skip before applying `limit`. */\noffset?: number\\n/** When true, include meta-variable bindings per match. */\nincludeMeta?: boolean\\n/**\n * Reserved for contextual snippets; not used by the current native find\n * path.\n */\ncontext?: number\\n/** Optional cancellation handle (library-specific). */\nsignal?: unknown\\n/** Wall-clock timeout for the worker task in milliseconds. */\ntimeoutMs?: number", "original_name": "AstFindOptions"}
{"kind": "interface", "name": "AstFindMatch", "js_doc": "/** One ast-grep match with source range and optional meta-variables. */\n", "def": "/** Display path of the matching file. */\npath: string\\n/** Matched source text. */\ntext: string\\n/** Start byte offset in the file (UTF-8 byte index). */\nbyteStart: number\\n/** End byte offset in the file (exclusive UTF-8 byte index). */\nbyteEnd: number\\n/** 1-based start line. */\nstartLine: number\\n/** 1-based start column. */\nstartColumn: number\\n/** 1-based end line. */\nendLine: number\\n/** 1-based end column. */\nendColumn: number\\n/** Meta-variable name to captured text, when `includeMeta` was enabled. */\nmetaVariables?: Record<string, string>", "original_name": "AstFindMatch"}
{"kind": "interface", "name": "AstFindResult", "js_doc": "/** Aggregated search statistics and any parse or compile diagnostics. */\n", "def": "/** Page of matches after sort, offset, and limit. */\nmatches: Array<AstFindMatch>\\n/** Total matches found before paging (can exceed `matches.length`). */\ntotalMatches: number\\n/** Distinct files that contained at least one match. */\nfilesWithMatches: number\\n/** Files examined for the query. */\nfilesSearched: number\\n/** True when results were truncated by `limit`. */\nlimitReached: boolean\\n/** Non-fatal parse or pattern errors collected during the run. */\nparseErrors?: Array<string>", "original_name": "AstFindResult"}
{"kind": "interface", "name": "AstMatchOptions", "js_doc": "/**\n * Options for `astMatch`: run ast-grep patterns against an in-memory source\n * string instead of files on disk.\n */\n", "def": "/** Source code to match against (parsed in memory, never read from disk). */\nsource: string\\n/** Language of `source` (required; e.g. \"ts\", \"tsx\", \"rust\", \"python\"). */\nlang: string\\n/** ast-grep patterns to search for (OR across patterns). */\npatterns: Array<string>\\n/** Rule selector for multi-rule ast-grep configurations. */\nselector?: string\\n/** Pattern strictness; defaults to smart matching when omitted. */\nstrictness?: AstMatchStrictness\\n/** Maximum matches to return after `offset` (default applies when omitted). */\nlimit?: number\\n/** Number of leading matches to skip before applying `limit`. */\noffset?: number\\n/** When true, include meta-variable bindings per match. */\nincludeMeta?: boolean\\n/** Optional cancellation handle (library-specific). */\nsignal?: unknown\\n/** Wall-clock timeout for the worker task in milliseconds. */\ntimeoutMs?: number", "original_name": "AstMatchOptions"}
{"kind": "interface", "name": "AstMatchResult", "js_doc": "/** Result of an in-memory `astMatch` run. */\n", "def": "/** Page of matches after sort, offset, and limit. */\nmatches: Array<AstFindMatch>\\n/** Total matches found before paging (can exceed `matches.length`). */\ntotalMatches: number\\n/** True when results were truncated by `limit`. */\nlimitReached: boolean\\n/** Non-fatal parse or pattern-compile errors collected during the run. */\nparseErrors?: Array<string>", "original_name": "AstMatchResult"}
{"kind": "interface", "name": "AstReplaceOptions", "js_doc": "/**\n * Options for `astEdit`: rewrite rules, scan scope, safety limits, and\n * dry-run.\n */\n", "def": "/** Map of pattern string to replacement template. */\nrewrites?: Record<string, string>\\n/** Language override; otherwise inferred from discovered files. */\nlang?: string\\n/** Single file or directory to rewrite. */\npath?: string\\n/** Optional glob filter within the search root. */\nglob?: string\\n/** Rule selector for multi-rule configurations. */\nselector?: string\\n/** Pattern strictness for rewrites. */\nstrictness?: AstMatchStrictness\\n/** When true (default), compute changes without writing files. */\ndryRun?: boolean\\n/** Cap on replacement applications across all files. */\nmaxReplacements?: number\\n/** Cap on distinct files that may be modified. */\nmaxFiles?: number\\n/** Fail the operation when a file cannot be parsed for rewriting. */\nfailOnParseError?: boolean\\n/** Optional cancellation handle. */\nsignal?: unknown\\n/** Wall-clock timeout for the worker task in milliseconds. */\ntimeoutMs?: number", "original_name": "AstReplaceOptions"}
{"kind": "interface", "name": "AstReplaceChange", "js_doc": "/**\n * One textual replacement applied to a file (before/after slice and\n * coordinates).\n */\n", "def": "/** File path for this change. */\npath: string\\n/** Original matched text. */\nbefore: string\\n/** Replacement text. */\nafter: string\\n/** Start byte offset of the replaced span. */\nbyteStart: number\\n/** End byte offset of the replaced span (exclusive). */\nbyteEnd: number\\n/**\n * Length of deleted text in bytes (may differ from `byteEnd - byteStart`\n * for edge cases).\n */\ndeletedLength: number\\n/** 1-based start line of the match. */\nstartLine: number\\n/** 1-based start column. */\nstartColumn: number\\n/** 1-based end line. */\nendLine: number\\n/** 1-based end column. */\nendColumn: number", "original_name": "AstReplaceChange"}
{"kind": "interface", "name": "AstReplaceFileChange", "js_doc": "/** Per-file replacement count after an `astEdit` run. */\n", "def": "/** File that had replacements. */\npath: string\\n/** Number of replacements in that file. */\ncount: number", "original_name": "AstReplaceFileChange"}
{"kind": "interface", "name": "AstReplaceResult", "js_doc": "/** Summary of an ast-grep rewrite pass, including whether disk writes occurred. */\n", "def": "/** Individual replacement records (may be large). */\nchanges: Array<AstReplaceChange>\\n/** Replacement counts grouped by file. */\nfileChanges: Array<AstReplaceFileChange>\\n/** Total replacements applied or previewed. */\ntotalReplacements: number\\n/** Files that had at least one replacement. */\nfilesTouched: number\\n/** Files considered for rewriting. */\nfilesSearched: number\\n/** False when `dryRun` prevented writing. */\napplied: boolean\\n/** True when limits stopped further replacements. */\nlimitReached: boolean\\n/** Parse or pattern errors when not failing the whole operation. */\nparseErrors?: Array<string>", "original_name": "AstReplaceResult"}
{"kind": "fn", "name": "astGrep", "js_doc": "/**\n * Search source files with ast-grep patterns; returns a promise resolved on a\n * worker thread.\n */\n", "def": "function astGrep(options: AstFindOptions): Promise<AstFindResult>"}
{"kind": "fn", "name": "astMatch", "js_doc": "/**\n * Match ast-grep patterns against an in-memory source string; returns a\n * promise resolved on a worker thread.\n * \n * This is the file-free counterpart to [`ast_grep`]: callers that already hold\n * the source (streaming buffers, generated code, editor contents) avoid a\n * temp-file round trip. `lang` is required since there is no path to infer it\n * from.\n */\n", "def": "function astMatch(options: AstMatchOptions): Promise<AstMatchResult>"}
{"kind": "fn", "name": "astEdit", "js_doc": "/**\n * Apply ast-grep rewrite rules to matching files; honors `dryRun` and returns\n * a promise.\n */\n", "def": "function astEdit(options: AstReplaceOptions): Promise<AstReplaceResult>"}
{"kind": "interface", "name": "BlockRangeOptions", "js_doc": "", "def": "/** Source code to inspect. */\ncode: string\\n/** Language alias (e.g. \"rust\", \"typescript\") used before path inference. */\nlang?: string\\n/** File path used to infer language by extension when `lang` is omitted. */\npath?: string\\n/** 1-indexed source line the block must begin on. */\nline: number", "original_name": "BlockRangeOptions"}
{"kind": "interface", "name": "BlockRange", "js_doc": "", "def": "/** 1-indexed inclusive first line of the resolved block. */\nstartLine: number\\n/** 1-indexed inclusive last line of the resolved block. */\nendLine: number", "original_name": "BlockRange"}
{"kind": "fn", "name": "blockRangeAt", "js_doc": "/**\n * Find the outermost named tree-sitter node that begins on `options.line`.\n * \n * Returns its 1-indexed inclusive line span, or `null` when the language is\n * unrecognized, the line is out of range / blank, no node begins on that line,\n * or the resolved subtree contains a syntax error.\n */\n", "def": "function blockRangeAt(options: BlockRangeOptions): BlockRange | null"}
{"kind": "interface", "name": "LineRange", "js_doc": "", "def": "/** 1-indexed inclusive first visible line. */\nstartLine: number\\n/** 1-indexed inclusive last visible line. */\nendLine: number", "original_name": "LineRange"}
{"kind": "interface", "name": "EnclosingBoundaryOptions", "js_doc": "", "def": "/** Source code to inspect. */\ncode: string\\n/** Language alias (e.g. \"rust\", \"typescript\") used before path inference. */\nlang?: string\\n/** File path used to infer language by extension when `lang` is omitted. */\npath?: string\\n/** 1-indexed inclusive visible line ranges (the lines actually shown). */\nranges: Array<LineRange>", "original_name": "EnclosingBoundaryOptions"}
{"kind": "fn", "name": "enclosingBlockBoundaries", "js_doc": "/**\n * Matching-bracket context for an arbitrary tree-sitter language.\n * \n * For each multi-line named node whose span crosses the visible window, return\n * the boundary line sitting *outside* that window (the closer when the opener\n * is shown, the opener when the closer is shown). Covers brace and indentation\n * languages alike using real syntactic spans.\n * \n * Returns `null` when the language is unrecognized or the source fails to\n * parse / carries a syntax error (caller should fall back to a lexical scan);\n * a sorted, unique list of 1-indexed boundary lines otherwise.\n */\n", "def": "function enclosingBlockBoundaries(options: EnclosingBoundaryOptions): Array<number> | null"}
{"kind": "interface", "name": "ClipboardImage", "js_doc": "/** Clipboard image payload encoded as PNG bytes. */\n", "def": "/** PNG-encoded image bytes. */\ndata: Uint8Array\\n/** MIME type for the encoded image payload. */\nmimeType: string", "original_name": "ClipboardImage"}
{"kind": "fn", "name": "copyToClipboard", "js_doc": "/**\n * Copy plain text to the system clipboard.\n * \n * # Parameters\n * - `text`: UTF-8 text to place on the clipboard.\n * \n * # Errors\n * Returns an error if clipboard access fails.\n */\n", "def": "function copyToClipboard(text: string): void"}
{"kind": "fn", "name": "readImageFromClipboard", "js_doc": "/**\n * Read an image from the system clipboard.\n * \n * Returns `Ok(None)` when no image data is available.\n * \n * # Errors\n * Returns an error if clipboard access fails or image encoding fails.\n */\n", "def": "function readImageFromClipboard(): Promise<ClipboardImage | undefined | null>"}
{"kind": "interface", "name": "FuzzyFindOptions", "js_doc": "/** Options for fuzzy file path search. */\n", "def": "/** Fuzzy query to match against file paths (case-insensitive). */\nquery: string\\n/** Directory to search. */\npath: string\\n/** Include hidden files (default: false). */\nhidden?: boolean\\n/** Respect .gitignore (default: true). */\ngitignore?: boolean\\n/** Enable walker scan caching (default: false). */\ncache?: boolean\\n/** Maximum number of matches to return (default: 100). */\nmaxResults?: number\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown\\n/** Timeout in milliseconds for the operation. */\ntimeoutMs?: number", "original_name": "FuzzyFindOptions"}
{"kind": "interface", "name": "FuzzyFindMatch", "js_doc": "/** A single match in fuzzy find results. */\n", "def": "/** Relative path from the search root (uses `/` separators). */\npath: string\\n/** Whether this entry is a directory. */\nisDirectory: boolean\\n/** Match quality score (higher is better). */\nscore: number", "original_name": "FuzzyFindMatch"}
{"kind": "interface", "name": "FuzzyFindResult", "js_doc": "/** Result of fuzzy file path search. */\n", "def": "/** Matched entries (up to `maxResults`). */\nmatches: Array<FuzzyFindMatch>\\n/** Total number of matches found (may exceed `matches.len()`). */\ntotalMatches: number", "original_name": "FuzzyFindResult"}
{"kind": "fn", "name": "fuzzyFind", "js_doc": "/** Fuzzy file path search for autocomplete. */\n", "def": "function fuzzyFind(options: FuzzyFindOptions): Promise<FuzzyFindResult>"}
{"kind": "interface", "name": "GlobOptions", "js_doc": "/** Input options for `glob`, including traversal, filtering, and cancellation. */\n", "def": "/** Glob pattern to match (e.g., \"*.ts\"). */\npattern: string\\n/** Directory to search. */\npath: string\\n/**\n * Filter by file type: \"file\", \"dir\", or \"symlink\". Symlinks are\n * matched for file/dir filters based on their target type.\n */\nfileType?: FileType\\n/** Match simple patterns recursively by default (`*.ts` -> recursive). */\nrecursive?: boolean\\n/** Include hidden files (default: false). */\nhidden?: boolean\\n/** Maximum number of results to return. */\nmaxResults?: number\\n/** Respect .gitignore files (default: true). */\ngitignore?: boolean\\n/** Enable walker scan caching (default: false). */\ncache?: boolean\\n/** Sort results by mtime (most recent first) before applying limit. */\nsortByMtime?: boolean\\n/**\n * Include `node_modules` entries when the pattern does not explicitly\n * mention them.\n */\nincludeNodeModules?: boolean\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown\\n/** Timeout in milliseconds for the operation. */\ntimeoutMs?: number", "original_name": "GlobOptions"}
{"kind": "interface", "name": "GlobResult", "js_doc": "/** Result payload returned by a glob operation. */\n", "def": "/** Matched filesystem entries. */\nmatches: Array<GlobMatch>\\n/** Number of returned matches (`matches.len()`), clamped to `u32::MAX`. */\ntotalMatches: number", "original_name": "GlobResult"}
{"kind": "fn", "name": "glob", "js_doc": "/**\n * Find filesystem entries matching a glob pattern.\n * \n * Resolves the search root, scans entries, applies glob and optional file-type\n * filters, and optionally streams each accepted match through `on_match`.\n * \n * When `sortByMtime` is enabled, the walker ranks matches by mtime before the\n * native layer applies final symlink-aware file-type filtering and callback\n * emission.\n * \n * # Errors\n * Returns an error when the search path cannot be resolved, the path is not a\n * directory, the glob pattern is invalid, or cancellation/timeout is\n * triggered.\n */\n", "def": "function glob(options: GlobOptions, onMatch?: ((error: Error | null, match: GlobMatch) => void) | undefined | null): Promise<GlobResult>"}
{"kind": "string_enum", "name": "GrepOutputMode", "js_doc": "/** Output mode for [`search`] and [`grep`] (string values match JS callers). */\n", "def": "/** Emit matched lines (and optional context lines). */\nContent = 'content',\n /** Emit per-file or total counts instead of line content. */\nCount = 'count',\n /** Emit one row per file that matched, without line content. */\nFilesWithMatches = 'filesWithMatches'", "original_name": "GrepOutputMode"}
{"kind": "interface", "name": "SearchOptions", "js_doc": "/** Options for searching file content. */\n", "def": "/** Regex pattern to search for. */\npattern: string\\n/** Case-insensitive search. */\nignoreCase?: boolean\\n/** Enable multiline matching. */\nmultiline?: boolean\\n/** Maximum number of matches to return. */\nmaxCount?: number\\n/** Skip first N matches. */\noffset?: number\\n/** Lines of context before matches. */\ncontextBefore?: number\\n/** Lines of context after matches. */\ncontextAfter?: number\\n/** Lines of context before/after matches (legacy). */\ncontext?: number\\n/** Truncate lines longer than this (characters). */\nmaxColumns?: number\\n/** Output mode (content or count). */\nmode?: GrepOutputMode", "original_name": "SearchOptions"}
{"kind": "interface", "name": "GrepOptions", "js_doc": "/** Options for searching files on disk. */\n", "def": "/** Regex pattern to search for. */\npattern: string\\n/** Directory or file to search. */\npath: string\\n/** Glob filter for filenames (e.g., \"*.ts\"). */\nglob?: string\\n/** Filter by file type (e.g., \"js\", \"py\", \"rust\"). */\ntype?: string\\n/** Case-insensitive search. */\nignoreCase?: boolean\\n/** Enable multiline matching. */\nmultiline?: boolean\\n/** Include hidden files (default: true). */\nhidden?: boolean\\n/** Respect .gitignore files (default: true). */\ngitignore?: boolean\\n/** Maximum number of matches to return. */\nmaxCount?: number\\n/** Skip first N matches. */\noffset?: number\\n/** Lines of context before matches. */\ncontextBefore?: number\\n/** Lines of context after matches. */\ncontextAfter?: number\\n/** Lines of context before/after matches (legacy). */\ncontext?: number\\n/** Truncate lines longer than this (characters). */\nmaxColumns?: number\\n/** Output mode (content, filesWithMatches, or count). */\nmode?: GrepOutputMode\\n/**\n * Maximum matches collected per file (content mode). Keeps one hot file\n * from exhausting the global `max_count` budget before other files are\n * reached.\n */\nmaxCountPerFile?: number\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown\\n/** Timeout in milliseconds for the operation. */\ntimeoutMs?: number", "original_name": "GrepOptions"}
{"kind": "interface", "name": "ContextLine", "js_doc": "/** A context line (before or after a match). */\n", "def": "/** 1-indexed line number in the source file. */\nlineNumber: number\\n/** Raw line content (trimmed line ending). */\nline: string", "original_name": "ContextLine"}
{"kind": "interface", "name": "Match", "js_doc": "/** A single match in the content. */\n", "def": "/** 1-indexed line number. */\nlineNumber: number\\n/** The matched line content. */\nline: string\\n/** Context lines before the match. */\ncontextBefore?: Array<ContextLine>\\n/** Context lines after the match. */\ncontextAfter?: Array<ContextLine>\\n/** Whether the line was truncated. */\ntruncated?: boolean", "original_name": "Match"}
{"kind": "interface", "name": "SearchResult", "js_doc": "/** Result of searching content. */\n", "def": "/** All matches found. */\nmatches: Array<Match>\\n/** Total number of matches (may exceed `matches.len()` due to offset/limit). */\nmatchCount: number\\n/** Whether the limit was reached. */\nlimitReached: boolean\\n/** Error message, if any. */\nerror?: string", "original_name": "SearchResult"}
{"kind": "interface", "name": "GrepMatch", "js_doc": "/** A single match in a grep result. */\n", "def": "/** File path for the match (relative for directory searches). */\npath: string\\n/** 1-indexed line number (0 for count-only entries). */\nlineNumber: number\\n/** The matched line content (empty for count-only entries). */\nline: string\\n/** Context lines before the match. */\ncontextBefore?: Array<ContextLine>\\n/** Context lines after the match. */\ncontextAfter?: Array<ContextLine>\\n/** Whether the line was truncated. */\ntruncated?: boolean\\n/** Per-file match count (count mode only). */\nmatchCount?: number", "original_name": "GrepMatch"}
{"kind": "interface", "name": "GrepResult", "js_doc": "/** Result of searching files. */\n", "def": "/** Matches or per-file counts, depending on output mode. */\nmatches: Array<GrepMatch>\\n/**\n * Total matches across all files, or matched file count in filesWithMatches\n * mode.\n */\ntotalMatches: number\\n/** Number of files with at least one match. */\nfilesWithMatches: number\\n/** Number of files searched. */\nfilesSearched: number\\n/** Whether the limit/offset stopped the search early. */\nlimitReached?: boolean\\n/** Number of files skipped because they exceed the size limit. */\nskippedOversized?: number", "original_name": "GrepResult"}
{"kind": "fn", "name": "search", "js_doc": "/**\n * Search content for a pattern (one-shot, compiles pattern each time).\n * For repeated searches with the same pattern, use [`grep`] with file filters.\n * \n * # Arguments\n * - `content`: `Uint8Array`/`Buffer` (zero-copy) or `string` (UTF-8).\n * - `options`: Regex settings, context, and output mode.\n * \n * # Returns\n * Match list plus counts/limit status; errors are surfaced in `error`.\n */\n", "def": "function search(content: string | Uint8Array, options: SearchOptions): SearchResult"}
{"kind": "fn", "name": "hasMatch", "js_doc": "/**\n * Quick check if content matches a pattern.\n * \n * # Arguments\n * - `content`: `Uint8Array`/`Buffer` (zero-copy) or `string` (UTF-8).\n * - `pattern`: `Uint8Array`/`Buffer` (zero-copy) or `string` (UTF-8).\n * - `ignore_case`: Case-insensitive matching.\n * - `multiline`: Enable multiline regex mode.\n * \n * # Returns\n * True if any match exists; false on no match.\n */\n", "def": "function hasMatch(content: string | Uint8Array, pattern: string | Uint8Array, ignoreCase?: boolean | undefined | null, multiline?: boolean | undefined | null): boolean"}
{"kind": "fn", "name": "grep", "js_doc": "/**\n * Search files for a regex pattern.\n * \n * # Arguments\n * - `options`: Pattern, path, filters, and output mode.\n * - `on_match`: Optional callback invoked per match/result.\n * \n * # Returns\n * Aggregated results across matching files.\n */\n", "def": "function grep(options: GrepOptions, onMatch?: ((error: Error | null, match: GrepMatch) => void) | undefined | null): Promise<GrepResult>"}
{"kind": "interface", "name": "HighlightColors", "js_doc": "/**\n * Theme colors for syntax highlighting.\n * Each color is an ANSI escape sequence (e.g., \"\\x1b[38;2;255;0;0m\").\n */\n", "def": "/** ANSI color for comments. */\ncomment: string\\n/** ANSI color for keywords. */\nkeyword: string\\n/** ANSI color for function names. */\nfunction: string\\n/** ANSI color for variables and identifiers. */\nvariable: string\\n/** ANSI color for string literals. */\nstring: string\\n/** ANSI color for numeric literals. */\nnumber: string\\n/** ANSI color for type identifiers. */\ntype: string\\n/** ANSI color for operators. */\noperator: string\\n/** ANSI color for punctuation tokens. */\npunctuation: string\\n/** ANSI color for diff inserted lines. */\ninserted?: string\\n/** ANSI color for diff deleted lines. */\ndeleted?: string", "original_name": "HighlightColors"}
{"kind": "fn", "name": "highlightCode", "js_doc": "/**\n * Highlight code and return ANSI-colored lines.\n * \n * # Arguments\n * * `code` - The source code to highlight\n * * `lang` - Language identifier (e.g., \"rust\", \"typescript\", \"python\")\n * * `colors` - Theme colors as ANSI escape sequences\n * \n * # Returns\n * Highlighted code with ANSI color codes, or the original code if highlighting\n * fails.\n */\n", "def": "function highlightCode(code: string, lang: string | undefined | null, colors: HighlightColors): string"}
{"kind": "fn", "name": "supportsLanguage", "js_doc": "/**\n * Check if a language is supported for highlighting.\n * Returns true if the language has either direct support or a fallback\n * mapping.\n */\n", "def": "function supportsLanguage(lang: string): boolean"}
{"kind": "fn", "name": "getSupportedLanguages", "js_doc": "/** Get list of supported languages. */\n", "def": "function getSupportedLanguages(): Array<string>"}
{"kind": "interface", "name": "HtmlToMarkdownOptions", "js_doc": "/** Options for HTML to Markdown conversion. */\n", "def": "/** Remove navigation elements, forms, headers, footers. */\ncleanContent?: boolean\\n/** Skip images during conversion. */\nskipImages?: boolean", "original_name": "HtmlToMarkdownOptions"}
{"kind": "fn", "name": "htmlToMarkdown", "js_doc": "/**\n * Convert HTML source to Markdown with optional preprocessing.\n * \n * # Errors\n * Returns an error if the conversion fails or the worker task aborts.\n */\n", "def": "function htmlToMarkdown(html: string, options?: HtmlToMarkdownOptions | undefined | null): Promise<string>"}
{"kind": "enum", "name": "FileType", "js_doc": "/** Resolved filesystem entry kind for glob filters and match metadata. */\n", "def": "/** Regular file. */\nFile = 1,\n /** Directory. */\nDir = 2,\n /** Symbolic link. */\nSymlink = 3", "original_name": "FileType"}
{"kind": "interface", "name": "GlobMatch", "js_doc": "/** A single filesystem entry from a directory scan. */\n", "def": "/** Relative path from the search root, using forward slashes. */\npath: string\\n/** Resolved filesystem type for the match. */\nfileType: FileType\\n/** Modification time in milliseconds since Unix epoch. */\nmtime?: number\\n/** File size in bytes for regular files. */\nsize?: number", "original_name": "GlobMatch"}
{"kind": "fn", "name": "invalidateFsScanCache", "js_doc": "/**\n * Invalidate the walker scan cache.\n * \n * When called with a path, removes entries for roots containing that path.\n * When called without a path, clears the entire cache.\n * \n * Intended to be called after agent file mutations: write, edit, rename, or\n * delete.\n */\n", "def": "function invalidateFsScanCache(path?: string | undefined | null): void"}
{"kind": "enum", "name": "KeyEventType", "js_doc": "/** Event types from Kitty keyboard protocol (flag 2). */\n", "def": "/** Key press event. */\nPress = 1,\n /** Key repeat event. */\nRepeat = 2,\n /** Key release event. */\nRelease = 3", "original_name": "KeyEventType"}
{"kind": "interface", "name": "ParsedKittyResult", "js_doc": "/** Parsed Kitty keyboard protocol sequence result for a Kitty input sequence. */\n", "def": "/** Primary codepoint associated with the key. */\ncodepoint: number\\n/** Optional shifted key codepoint from the sequence. */\nshiftedKey?: number\\n/** Optional base layout key codepoint from the sequence. */\nbaseLayoutKey?: number\\n/** Modifier bitmask (shift/alt/ctrl), excluding lock bits. */\nmodifier: number\\n/** Optional event type (1 = press, 2 = repeat, 3 = release). */\neventType?: KeyEventType", "original_name": "ParsedKittyResult"}
{"kind": "fn", "name": "matchesKittySequence", "js_doc": "/**\n * Match Kitty protocol input against a codepoint and modifier mask.\n * \n * Returns true when the parsed sequence matches the expected codepoint (or\n * base layout key) and modifier bits.\n */\n", "def": "function matchesKittySequence(data: string, expectedCodepoint: number, expectedModifier: number): boolean"}
{"kind": "fn", "name": "parseKey", "js_doc": "/**\n * Parse terminal input and return a normalized key identifier.\n * \n * Returns a key id like \"escape\" or \"ctrl+c\", or None if unrecognized.\n */\n", "def": "function parseKey(data: string, kittyProtocolActive: boolean): string | null"}
{"kind": "fn", "name": "matchesLegacySequence", "js_doc": "/**\n * Check if input matches a legacy escape sequence for the given key name.\n * \n * Returns true only when the byte sequence maps to the exact key identifier.\n */\n", "def": "function matchesLegacySequence(data: string, keyName: string): boolean"}
{"kind": "fn", "name": "matchesKey", "js_doc": "/**\n * Match input data against a key identifier string.\n * \n * Returns true when the bytes represent the specified key with modifiers.\n */\n", "def": "function matchesKey(data: string, keyId: string, kittyProtocolActive: boolean): boolean"}
{"kind": "fn", "name": "parseKittySequence", "js_doc": "/**\n * Parse a Kitty keyboard protocol sequence.\n * \n * Returns a structured parse result when the input is a valid Kitty sequence.\n */\n", "def": "function parseKittySequence(data: string): ParsedKittyResult | null"}
{"kind": "fn", "name": "encodeSixel", "js_doc": "/**\n * Encode image bytes into a SIXEL escape sequence for terminal rendering.\n * \n * The input image is decoded and resized to the requested pixel dimensions\n * before encoding.\n * \n * # Errors\n * Returns an error if decoding, resizing, or SIXEL encoding fails.\n */\n", "def": "function encodeSixel(bytes: Uint8Array, targetWidthPx: number, targetHeightPx: number): string"}
{"kind": "interface", "name": "SnapcompactRenderOptions", "js_doc": "/** Shape options for one snapcompact frame. */\n", "def": "/**\n * Frame width in pixels; also bounds the grid rows\n * (`floor(size/cellHeight/lineRepeat)`). Output height hugs the rows the\n * text actually uses instead of padding to a square.\n */\nsize: number\\n/**\n * Bundled font: `\"5x8\"`, `\"6x12\"`, `\"8x13\"` (X.org BDF), `\"8x8\"`\n * (unscii-8), or `\"silver\"` (embedded TrueType). Default `\"5x8\"`.\n */\nfont?: string\\n/**\n * Target cell advance in pixels. Differing from the font's natural cell\n * triggers the Lanczos stretch path. Default: font natural width.\n */\ncellWidth?: number\\n/** Target cell pitch in pixels. Default: font natural height. */\ncellHeight?: number\\n/**\n * Ink variant: `\"sent\"` (six-hue sentence cycling) or `\"bw\"` (black).\n * Default `\"sent\"`.\n */\nvariant?: string\\n/**\n * Print each text line this many times; copies after the first sit on a\n * pale highlight band. Default 1.\n */\nlineRepeat?: number\\n/**\n * Stretch behavior. Unset: auto \u2014 Lanczos-stretch whenever the target\n * cell differs from the font's natural cell. `false`: never stretch \u2014\n * render indexed with glyphs at natural size on the requested cell box\n * (e.g. 8x13 glyphs on an 8x16 pitch, the \"8on16\" shapes). `true`: force\n * the stretch path (identical to auto; natural cells render indexed).\n */\nstretch?: boolean\\n/**\n * Layout columns: `1` (default) row-major grid; `2` two newspaper \"doc\"\n * columns of pre-wrapped newline-separated lines.\n */\ncolumns?: number", "original_name": "SnapcompactRenderOptions"}
{"kind": "fn", "name": "snapcompactSupportedChars", "js_doc": "/**\n * Return the subset of `chars` that the named snapcompact font can render.\n * \n * The TypeScript normalizer uses this to keep Unicode text intact only when\n * the selected native font has a glyph for it; renderer control codes are\n * considered renderable because they are interpreted outside font lookup.\n */\n", "def": "function snapcompactSupportedChars(font: string, chars: string): string"}
{"kind": "fn", "name": "renderSnapcompactPng", "js_doc": "/**\n * Render one snapcompact frame on a libuv worker: print pre-normalized text\n * onto a `size`-wide bitmap and encode it as PNG.\n * \n * The bitmap height hugs the rows the text actually occupies\n * (`usedRows * lineRepeat * cellHeight`), so a partially filled frame never\n * pays for blank padding rows. The glyph grid holds `floor(size/cellWidth) *\n * floor(size/cellHeight/lineRepeat)` characters; input beyond that is ignored.\n * Native-cell bitmap-font shapes encode as indexed PNG; stretched bitmap-font\n * shapes (target cell != font cell) encode as RGB. TrueType shapes encode RGB\n * directly from grayscale coverage.\n * `stretch: false` pins bitmap fonts to the indexed path, printing\n * natural-size glyphs on the requested cell box; `columns: 2` flows\n * pre-wrapped newline-separated lines down two newspaper columns.\n * `U+000E`/`U+000F` in `text` toggle dim-gray ink spans without occupying a\n * cell.\n * Returns a promise for the PNG encoded as base64, created as a one-byte\n * (Latin-1) JS string straight from native code \u2014 no `Uint8Array` hop or\n * JS-side re-encode.\n */\n", "def": "function renderSnapcompactPng(text: string, options: SnapcompactRenderOptions): Promise<string>"}
{"kind": "interface", "name": "MacOSPowerAssertionOptions", "js_doc": "/**\n * Options for starting a macOS power assertion.\n * \n * Each boolean maps to a `caffeinate(8)` flag and a corresponding `IOKit`\n * `IOPMAssertion` type. Multiple flags can be combined; when set, one\n * assertion is taken per flag and all are released together when the\n * handle is stopped or dropped.\n * \n * If every flag is unset (or omitted), the handle behaves as if `idle`\n * were `true` \u2014 preserving the historical default of `caffeinate -i`.\n */\n", "def": "/** Human-readable reason shown in macOS power diagnostics. */\nreason?: string\\n/** `caffeinate -i`: prevent the system from idle-sleeping. */\nidle?: boolean\\n/** `caffeinate -s`: prevent the system from sleeping (AC power only). */\nsystem?: boolean\\n/** `caffeinate -u`: declare the user is active (wakes the display). */\nuser?: boolean\\n/** `caffeinate -d`: prevent the display from idle-sleeping. */\ndisplay?: boolean", "original_name": "MacOSPowerAssertionOptions"}
{"kind": "struct", "name": "MacOSPowerAssertion", "js_doc": "/**\n * Long-lived macOS power assertion.\n * \n * On macOS this acquires one or more `IOKit` assertions that prevent the\n * requested sleep modes until the handle is stopped or dropped. On other\n * platforms it is a no-op handle so the caller can keep one cross-platform\n * code path.\n */\n", "def": "", "original_name": "MacOSPowerAssertion"}
{"kind": "impl", "name": "MacOSPowerAssertion", "js_doc": "", "def": "/**\n * Acquire a macOS power assertion. On non-macOS platforms returns a\n * no-op handle so callers can stay cross-platform.\n */\nstatic start(options?: MacOSPowerAssertionOptions | undefined | null): MacOSPowerAssertion\\n/**\n * Release every assertion held by this handle. Safe to call multiple\n * times; subsequent calls are a no-op.\n */\n stop(): void"}
{"kind": "enum", "name": "IsoBackendKind", "js_doc": "/**\n * Isolation backend identifier. Numeric so the JS side can `switch` on\n * the enum without string comparisons.\n */\n", "def": "Apfs = 0,\n Btrfs = 1,\n Zfs = 2,\n LinuxReflink = 3,\n Overlayfs = 4,\n WindowsBlockClone = 5,\n Projfs = 6,\n Rcopy = 7", "original_name": "IsoBackendKind"}
{"kind": "enum", "name": "IsoChangeKind", "js_doc": "/** How a single file changed between `lower` and `merged`. */\n", "def": "Added = 0,\n Modified = 1,\n Removed = 2", "original_name": "IsoChangeKind"}
{"kind": "interface", "name": "IsoProbeResult", "js_doc": "/** Probe result for a specific isolation backend. */\n", "def": "/** True when the backend's prerequisites are satisfied. */\navailable: boolean\\n/** Human-readable explanation when `available` is false. */\nreason?: string\\n/** Resolved backend kind. */\nkind: IsoBackendKind", "original_name": "IsoProbeResult"}
{"kind": "interface", "name": "IsoResolveResult", "js_doc": "/** Outcome of [`iso_resolve`]. */\n", "def": "/** Backend that will actually be tried first. */\nkind: IsoBackendKind\\n/** Host-available backends in retry order, starting with `kind`. */\ncandidates: Array<IsoBackendKind>\\n/**\n * True when the resolver fell back from `preferred` (or from the\n * first automatic candidate) to a different backend.\n */\nfellBack: boolean\\n/** Human-readable reason for the fallback, if any. */\nreason?: string", "original_name": "IsoResolveResult"}
{"kind": "interface", "name": "IsoFileChange", "js_doc": "/** One entry in an [`IsoDiff`]. */\n", "def": "/** Path relative to `merged`. */\npath: string\\nop: IsoChangeKind\\n/**\n * Unified-diff text. `None` (`null` in JS) means the file is binary;\n * read it directly from `merged` if you need the bytes.\n */\ndiff?: string", "original_name": "IsoFileChange"}
{"kind": "interface", "name": "IsoDiff", "js_doc": "", "def": "files: Array<IsoFileChange>", "original_name": "IsoDiff"}
{"kind": "fn", "name": "isoBackend", "js_doc": "/** Kind enum of the backend selected by default for this build target. */\n", "def": "function isoBackend(): IsoBackendKind"}
{"kind": "fn", "name": "isoProbe", "js_doc": "/**\n * Probe whether the requested backend can start on this host. Pass\n * `null`/omit `kind` to probe the platform-native backend.\n */\n", "def": "function isoProbe(kind?: IsoBackendKind | undefined | null): IsoProbeResult"}
{"kind": "fn", "name": "isoResolve", "js_doc": "/**\n * Pick the best backend available right now. `preferred` is treated as\n * a hint \u2014 see [`pi_iso::resolve`] for the exact priority rules.\n */\n", "def": "function isoResolve(preferred?: IsoBackendKind | undefined | null): IsoResolveResult"}
{"kind": "fn", "name": "isoStart", "js_doc": "/**\n * Materialise `merged` as a writable view of `lower` using the requested\n * backend. `kind` defaults to the native backend.\n */\n", "def": "function isoStart(kind: IsoBackendKind | undefined | null, lower: string, merged: string): Promise<void>"}
{"kind": "fn", "name": "isoStop", "js_doc": "/** Tear down a previously started backend at `merged`. */\n", "def": "function isoStop(kind: IsoBackendKind | undefined | null, merged: string): Promise<void>"}
{"kind": "fn", "name": "isoDiff", "js_doc": "/**\n * Capture the changes between `lower` and `merged`.\n * \n * Uses [`pi_iso::IsolationBackend::diff`]'s default implementation \u2014\n * `git diff` when `merged/.git` exists, otherwise a mtime-skipped tree\n * walk. The backend selection only affects the lifecycle methods; diff\n * behaviour is uniform.\n */\n", "def": "function isoDiff(lower: string, merged: string): Promise<IsoDiff>"}
{"kind": "fn", "name": "isoIsUnavailableError", "js_doc": "/**\n * True if `message` is an error message produced by [`IsoError::Unavailable`].\n * Use this to distinguish \"this backend isn't installed\" from a hard\n * failure when handling caught errors on the JS side.\n */\n", "def": "function isoIsUnavailableError(message: string): boolean"}
{"kind": "interface", "name": "WorkProfile", "js_doc": "/** Profiling results returned to JavaScript. */\n", "def": "/** Folded stack format for flamegraph tools. */\nfolded: string\\n/** Markdown summary of profiling results. */\nsummary: string\\n/** SVG flamegraph (if generation succeeded). */\nsvg?: string\\n/** Total profiled duration in milliseconds. */\ntotalMs: number\\n/** Number of samples collected. */\nsampleCount: number", "original_name": "WorkProfile"}
{"kind": "fn", "name": "getWorkProfile", "js_doc": "/**\n * Get work profile data from the last N seconds.\n * \n * Always-on profiling - no need to start/stop. Just call this to get\n * recent activity.\n */\n", "def": "function getWorkProfile(lastSeconds: number): WorkProfile"}
{"kind": "interface", "name": "ProcessTerminateOptions", "js_doc": "", "def": "/** Also signal the process group when supported by the platform. */\ngroup?: boolean\\n/**\n * Milliseconds to wait after polite termination before hard-killing.\n * Omit to use the default grace period. Pass a negative value to skip the\n * graceful phase and hard-kill immediately.\n */\ngracefulMs?: number\\n/** Milliseconds to wait after hard-kill for the process tree to exit. */\ntimeoutMs?: number\\n/** Abort signal for cancelling termination while waiting. */\nsignal?: unknown", "original_name": "ProcessTerminateOptions"}
{"kind": "interface", "name": "ProcessWaitOptions", "js_doc": "/** Options for waiting on a process exit. */\n", "def": "/** Milliseconds to wait before returning false. Omit to wait indefinitely. */\ntimeoutMs?: number\\n/** Abort signal for cancelling the wait. */\nsignal?: unknown", "original_name": "ProcessWaitOptions"}
{"kind": "string_enum", "name": "ProcessStatus", "js_doc": "/** Current state of a process reference. */\n", "def": "/** The referenced process is still running. */\nRunning = 'running',\n /** The referenced process has exited or is no longer observable. */\nExited = 'exited'", "original_name": "ProcessStatus"}
{"kind": "struct", "name": "Process", "js_doc": "/** Stable process reference. */\n", "def": "", "original_name": "Process"}
{"kind": "impl", "name": "Process", "js_doc": "", "def": "/** Open a stable process reference from a PID. */\nstatic fromPid(pid: number): Process | null\\n/** Open stable process references whose executable path matches exactly. */\nstatic fromPath(path: string): Array<Process>\\n/** Operating-system process identifier for this process reference. */\nget pid(): number\\n/** Parent process id for this process, when available. */\nget ppid(): number | null\\n/** Launch arguments for this process. */\n args(): Array<string>\\n/**\n * Send `signal` to this process and its descendants, children first.\n * \n * On Linux and macOS the signal is forwarded as-is. On Windows there is no\n * signal abstraction, so the `signal` argument is ignored and the entire\n * tree is hard-killed via `TerminateProcess`. Defaults to the POSIX\n * hard-kill signal.\n */\n killTree(signal?: number | undefined | null): number\\n/**\n * Gracefully terminate this process and its descendants.\n * \n * By default this waits 1000ms after polite termination before\n * hard-killing. Pass `graceful_ms < 0` to skip the graceful phase.\n */\n terminate(options?: ProcessTerminateOptions | undefined | null): Promise<boolean>\\n/**\n * Wait until this process exits.\n * \n * When `options.timeout_ms` is omitted, waits until the process exits.\n */\n waitForExit(options?: ProcessWaitOptions | undefined | null): Promise<boolean>\\n/** Process group id for this process, when supported by the platform. */\n groupId(): number | null\\n/** Direct children of this process as stable process references. */\n children(): Array<Process>\\n/** Current status of this process reference. */\n status(): ProcessStatus"}
{"kind": "interface", "name": "PtyStartOptions", "js_doc": "/** Options for running a command in a PTY session. */\n", "def": "/** Command string to execute. */\ncommand: string\\n/** Working directory for command execution. */\ncwd?: string\\n/** Environment variables for this command. */\nenv?: Record<string, string>\\n/** Timeout in milliseconds before cancelling. */\ntimeoutMs?: number\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown\\n/** PTY column count. */\ncols?: number\\n/** PTY row count. */\nrows?: number\\n/**\n * Shell binary to use (e.g. \"sh\", \"bash\", or an absolute path).\n * Defaults to \"sh\" if not provided.\n */\nshell?: string", "original_name": "PtyStartOptions"}
{"kind": "interface", "name": "PtyRunResult", "js_doc": "/** Result of a PTY command run. */\n", "def": "/** Exit code when the command completes. */\nexitCode?: number\\n/** Whether command was cancelled by signal/user kill. */\ncancelled: boolean\\n/** Whether command timed out. */\ntimedOut: boolean", "original_name": "PtyRunResult"}
{"kind": "struct", "name": "PtySession", "js_doc": "/** Stateful PTY session for interactive stdin/stdout passthrough. */\n", "def": "", "original_name": "PtySession"}
{"kind": "impl", "name": "PtySession", "js_doc": "", "def": " constructor()\\n/** Start a PTY command and stream output chunks via callback. */\n start(options: PtyStartOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<PtyRunResult>\\n/** Write raw input bytes to PTY stdin. */\n write(data: string): void\\n/** Resize the active PTY. */\n resize(cols: number, rows: number): void\\n/** Force-kill the active PTY command. */\n kill(): void"}
{"kind": "interface", "name": "MinimizerOptions", "js_doc": "/** N-API opt-in handle for the minimizer. */\n", "def": "/** Master switch. Absent / false = disabled. */\nenabled?: boolean\\n/**\n * Optional path to a TOML settings file whose values override\n * field-level defaults. `~` is expanded.\n */\nsettingsPath?: string\\n/**\n * Optional xxHash64 digest (hex) of the settings file contents. When\n * supplied, the engine refuses to honor a settings file whose hash does\n * not match \u2014 a lightweight trust gate for agent-controllable paths.\n */\nsettingsHash?: string\\n/**\n * Opt-in allowlist of program names (e.g. `\"git\"`). When empty or\n * absent, all built-in filters are active.\n */\nonly?: Array<string>\\n/** Program names explicitly excluded from minimization. */\nexcept?: Array<string>\\n/**\n * Maximum captured bytes per command before the engine falls back to\n * the raw, un-minimized output. Default 4 MiB.\n */\nmaxCaptureBytes?: number\\n/**\n * Source-outline level for `cat <source-file>` minimization. Accepts\n * `\"default\"` (current behavior) or `\"aggressive\"` (strip function bodies).\n */\nsourceOutlineLevel?: string\\n/**\n * Kill-switch to fall back to the pre-PR (legacy) filter behavior for\n * grep / find / pytest. When `Some(true)`, filters that opted into the\n * always-shrink Tier 1 / Tier 2 behavior skip the new code path. When\n * `None`, defers to the `OMP_MINIMIZER_LEGACY_FILTERS` env var.\n */\nlegacyFilters?: boolean", "original_name": "MinimizerOptions"}
{"kind": "interface", "name": "ShellOptions", "js_doc": "/** Options for configuring a persistent shell session. */\n", "def": "/** Environment variables to apply once per session. */\nsessionEnv?: Record<string, string>\\n/** Optional snapshot file to source on session creation. */\nsnapshotPath?: string\\n/** Optional per-command output minimizer configuration. */\nminimizer?: MinimizerOptions", "original_name": "ShellOptions"}
{"kind": "interface", "name": "ShellRunOptions", "js_doc": "/** Options for running a shell command. */\n", "def": "/** Command string to execute in the shell. */\ncommand: string\\n/** Working directory for the command. */\ncwd?: string\\n/** Environment variables to apply for this command only. */\nenv?: Record<string, string>\\n/** Timeout in milliseconds before cancelling the command. */\ntimeoutMs?: number\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown", "original_name": "ShellRunOptions"}
{"kind": "interface", "name": "ShellExecuteOptions", "js_doc": "/** Options for executing a shell command via brush-core. */\n", "def": "/** Command string to execute in the shell. */\ncommand: string\\n/** Working directory for the command. */\ncwd?: string\\n/** Environment variables to apply for this command only. */\nenv?: Record<string, string>\\n/** Environment variables to apply once per session. */\nsessionEnv?: Record<string, string>\\n/** Timeout in milliseconds before cancelling the command. */\ntimeoutMs?: number\\n/** Optional snapshot file to source on session creation. */\nsnapshotPath?: string\\n/** Optional per-command output minimizer configuration. */\nminimizer?: MinimizerOptions\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown", "original_name": "ShellExecuteOptions"}
{"kind": "interface", "name": "MinimizerResult", "js_doc": "/**\n * Telemetry for a single minimization.\n * \n * Surfaced when the minimizer actually rewrote the command's output. The\n * session layer is expected to persist `original_text` via its\n * `ArtifactManager`, splice the resulting `artifact://<id>` reference\n * into `text`, and replace any previously streamed raw output with the\n * minimized text.\n */\n", "def": "/**\n * Dispatch label produced by the minimizer (e.g. `\"git\"`,\n * `\"pipeline:gradle\"`, `\"pipeline+builtin\"`).\n */\nfilter: string\\n/**\n * The minimized replacement text. Callers that streamed raw chunks\n * during execution should clear and replace their accumulated output\n * with this text.\n */\ntext: string\\n/** The full original capture, before minimization. */\noriginalText: string\\n/** Captured byte length before minimization. */\ninputBytes: number\\n/** Byte length of the minimized text the consumer received. */\noutputBytes: number", "original_name": "MinimizerResult"}
{"kind": "interface", "name": "ShellRunResult", "js_doc": "/** Result of running a shell command. */\n", "def": "/** Exit code when the command completes normally. */\nexitCode?: number\\n/** Whether the command was cancelled via abort. */\ncancelled: boolean\\n/** Whether the command timed out before completion. */\ntimedOut: boolean\\n/**\n * When the minimizer rewrote the captured output, this carries the\n * original buffer + telemetry so the session layer can persist it as\n * an artifact and splice an `artifact://<id>` reference into the\n * minimized text shown to the agent. `None` when nothing was rewritten.\n */\nminimized?: MinimizerResult\\n/** Shell working directory after command completion. */\nworkingDir?: string", "original_name": "ShellRunResult"}
{"kind": "struct", "name": "Shell", "js_doc": "/** Persistent brush-core shell session. */\n", "def": "", "original_name": "Shell"}
{"kind": "impl", "name": "Shell", "js_doc": "", "def": "/**\n * Create a new shell session from optional configuration.\n * \n * The options set session-scoped environment variables and a snapshot path.\n */\n constructor(options?: ShellOptions | undefined | null)\\n/**\n * Run a shell command using the provided options.\n * \n * The `on_chunk` callback receives streamed stdout/stderr output. Returns\n * the exit code when the command completes, or flags when cancelled or\n * timed out.\n */\n run(options: ShellRunOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<ShellRunResult>\\n/**\n * Abort all running commands for this shell session.\n * \n * Returns `Ok(())` even when no commands are running.\n */\n abort(): Promise<void>\\n/**\n * Count live background jobs (`&`/`nohup` children still running) on this\n * session. Completed jobs are reaped first. The host uses this to retain a\n * per-call shell whose background processes are still running instead of\n * dropping it (which would SIGKILL them via kill-on-drop).\n */\n liveBackgroundJobCount(): Promise<number>"}
{"kind": "fn", "name": "executeShell", "js_doc": "/**\n * Execute a brush shell command.\n * \n * Creates a fresh session for each call. The `on_chunk` callback receives\n * streamed stdout/stderr output. Returns the exit code when the command\n * completes, or flags when cancelled or timed out.\n */\n", "def": "function executeShell(options: ShellExecuteOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<ShellRunResult>"}
{"kind": "interface", "name": "BashFixupResult", "js_doc": "/**\n * Result of [`apply_bash_fixups`]: a possibly-rewritten command plus the\n * substrings that were removed (in source order).\n */\n", "def": "/** Possibly-rewritten command. Equal to the input when no fixup fired. */\ncommand: string\\n/** Substrings removed, in source order \u2014 suitable for a user-facing notice. */\nstripped: Array<string>", "original_name": "BashFixupResult"}
{"kind": "fn", "name": "applyBashFixups", "js_doc": "/**\n * Apply conservative pre-execution rewrites to a bash command.\n * \n * Strips trailing `| head|tail [safe-args]` and redundant trailing `2>&1`\n * from each top-level pipeline. The full rules and bail conditions live in\n * `pi_shell::fixup`. Synchronous and cheap (one parse pass over the input).\n */\n", "def": "function applyBashFixups(command: string): BashFixupResult"}
{"kind": "interface", "name": "SummaryOptions", "js_doc": "", "def": "/** Source code to summarize. */\ncode: string\\n/** Language alias (e.g. \"rust\", \"typescript\") used before path inference. */\nlang?: string\\n/** File path used to infer language by extension when `lang` is omitted. */\npath?: string\\n/** Minimum total node lines before eliding a body/literal node. */\nminBodyLines?: number\\n/** Minimum total comment lines before eliding a multiline block comment. */\nminCommentLines?: number\\n/**\n * Target visible-line count for BFS unfold. `None` or `0` keeps only\n * the outermost elisions (no progressive unfolding).\n */\nunfoldUntilLines?: number\\n/**\n * Hard ceiling for BFS unfold. Defaults to `unfold_until_lines * 2`\n * when omitted.\n */\nunfoldLimitLines?: number", "original_name": "SummaryOptions"}
{"kind": "interface", "name": "SummarySegment", "js_doc": "", "def": "/** \"kept\" or \"elided\". */\nkind: string\\n/** 1-based inclusive start line. */\nstartLine: number\\n/** 1-based inclusive end line. */\nendLine: number\\n/** Verbatim text for kept segments; absent for elided segments. */\ntext?: string", "original_name": "SummarySegment"}
{"kind": "interface", "name": "SummaryResult", "js_doc": "", "def": "/** Canonical language name when parsing succeeded. */\nlanguage?: string\\n/** True when tree-sitter parsed the source without syntax errors. */\nparsed: boolean\\n/** True when at least one elision span was emitted. */\nelided: boolean\\n/** Total source lines. */\ntotalLines: number\\n/** Kept/elided segments in source order. */\nsegments: Array<SummarySegment>", "original_name": "SummaryResult"}
{"kind": "fn", "name": "summarizeCode", "js_doc": "", "def": "function summarizeCode(options: SummaryOptions): SummaryResult"}
{"kind": "enum", "name": "Ellipsis", "js_doc": "/** Ellipsis strategy for [`truncate_to_width`]. */\n", "def": "/** Use a single Unicode ellipsis character (\"\u2026\"). */\nUnicode = 0,\n /** Use three ASCII dots (\"...\"). */\nAscii = 1,\n /** Omit ellipsis entirely. */\nOmit = 2", "original_name": "Ellipsis"}
{"kind": "interface", "name": "SliceResult", "js_doc": "/**\n * Visible slice of a line after ANSI-aware column selection\n * (`sliceWithWidth`).\n */\n", "def": "/** UTF-16 slice containing the selected text. */\ntext: string\\n/** Visible width of the slice in terminal cells. */\nwidth: number", "original_name": "SliceResult"}
{"kind": "interface", "name": "ExtractSegmentsResult", "js_doc": "/** Before/after UTF-16 segments around an overlay region, with measured widths. */\n", "def": "/** UTF-16 content before the overlay region. */\nbefore: string\\n/** Visible width of the `before` segment. */\nbeforeWidth: number\\n/** UTF-16 content after the overlay region. */\nafter: string\\n/** Visible width of the `after` segment. */\nafterWidth: number", "original_name": "ExtractSegmentsResult"}
{"kind": "fn", "name": "setHangulCompatJamoWidthOverride", "js_doc": "", "def": "function setHangulCompatJamoWidthOverride(value: number): void"}
{"kind": "fn", "name": "wrapTextWithAnsi", "js_doc": "/**\n * Wrap text to a visible width, preserving ANSI escape codes across line\n * breaks.\n * \n * Returns UTF-16 lines with active SGR codes carried across line boundaries.\n */\n", "def": "function wrapTextWithAnsi(text: string, width: number, tabWidth: number): Array<string>"}
{"kind": "fn", "name": "truncateToWidth", "js_doc": "/**\n * Truncate text to a visible width, preserving ANSI codes.\n * \n * Pads with spaces when requested.\n */\n", "def": "function truncateToWidth(text: string, maxWidth: number, ellipsisKind: Ellipsis | undefined | null, pad: boolean | undefined | null, tabWidth: number): string"}
{"kind": "fn", "name": "sliceWithWidth", "js_doc": "/**\n * Slice a range of visible columns from a line.\n * \n * Counts terminal cells, skipping ANSI escapes, and optionally enforces strict\n * width.\n */\n", "def": "function sliceWithWidth(line: string, startCol: number, length: number, strict: boolean | undefined | null, tabWidth: number): SliceResult"}
{"kind": "fn", "name": "extractSegments", "js_doc": "/**\n * Extract the before/after slices around an overlay region.\n * \n * Preserves ANSI state so the `after` segment renders correctly after\n * truncation.\n */\n", "def": "function extractSegments(line: string, beforeEnd: number, afterStart: number, afterLen: number, strictAfter: boolean, tabWidth: number): ExtractSegmentsResult"}
{"kind": "fn", "name": "visibleWidth", "js_doc": "/**\n * Calculate visible width of text, excluding ANSI escape sequences.\n * \n * Tabs count as a fixed-width cell.\n */\n", "def": "function visibleWidth(text: string, tabWidth: number): number"}
{"kind": "string_enum", "name": "Encoding", "js_doc": "/** Tokenizer encoding to use. */\n", "def": "/** GPT-4o / o1 / GPT-5 (default). */\nO200kBase = 'O200kBase',\n /** GPT-3.5 / GPT-4 / older. */\nCl100kBase = 'Cl100kBase'", "original_name": "Encoding"}
{"kind": "fn", "name": "countTokens", "js_doc": "/**\n * Count tokens in `input`.\n * \n * `input` may be a single string or an array of strings; an array returns\n * the sum across all elements (encoded in parallel via rayon when the global\n * pool is available). Always returns a single token total \u2014 use this for any\n * aggregate budget question without paying a per-element napi crossing.\n * \n * Uses ordinary encoding (no special-token handling), which is the right\n * choice for measuring user/model content rather than wire-protocol tokens.\n * Defaults to `o200k_base`; pass `Cl100kBase` for older `OpenAI` models.\n */\n", "def": "function countTokens(input: string | Array<string>, encoding?: Encoding | undefined | null): number"}
{"kind": "interface", "name": "ListWorkspaceOptions", "js_doc": "/** Input options for `listWorkspace`, the single-pass workspace startup scan. */\n", "def": "/** Directory to scan. */\npath: string\\n/** Maximum depth for returned tree entries. Root children are depth 1. */\nmaxDepth: number\\n/** Include hidden files and directories. Default: false. */\nhidden?: boolean\\n/** Respect .gitignore files. Default: true. */\ngitignore?: boolean\\n/**\n * Also surface AGENTS.md files in directories at depth 1..=4, even when\n * gitignore would otherwise hide the file. Walks deeper than `maxDepth`\n * to find them. Default: false.\n */\ncollectAgentsMd?: boolean\\n/** Timeout in milliseconds for the operation. */\ntimeoutMs?: number\\n/** Abort signal for cancelling the operation. */\nsignal?: unknown", "original_name": "ListWorkspaceOptions"}
{"kind": "interface", "name": "ListWorkspaceResult", "js_doc": "/** Result payload returned by a workspace scan. */\n", "def": "/** Entries within `maxDepth`, with mtime and regular-file size metadata. */\nentries: Array<GlobMatch>\\n/**\n * Directory-scoped AGENTS.md files within depth 1..=4 (capped at 200).\n * Always empty when `collectAgentsMd` is false.\n */\nagentsMdFiles: Array<string>\\n/** True when any output cap was hit. */\ntruncated: boolean", "original_name": "ListWorkspaceResult"}
{"kind": "fn", "name": "listWorkspace", "js_doc": "/**\n * Walk the workspace once and return tree entries plus AGENTS.md candidates.\n * \n * File-level ignore rules for AGENTS.md are bypassed by checking each\n * traversed directory directly when `collectAgentsMd` is enabled, but ignored\n * directories are still pruned by the walker and are not searched.\n */\n", "def": "function listWorkspace(options: ListWorkspaceOptions): Promise<ListWorkspaceResult>"}
{"kind": "fn", "name": "__piNativesV16_3_15", "js_doc": "/**\n * Version sentinel \u2014 exists solely so the JS loader can prove at load time\n * that the `.node` file on disk is from the same package release as the\n * `index.js` ESM wrapper invoking it.\n * \n * The `js_name` is bumped by `scripts/release.ts` to match the new\n * `Cargo.toml` / `package.json` version on every release. The JS loader\n * computes the expected name from `package.json#version` and refuses to use\n * a `.node` that doesn't expose it, turning the silent\n * `<sym> is not a function` crash from a locked-file update (the canonical\n * Windows `bun install -g` failure mode) into a clear load-time error.\n * \n * Bump policy: `__piNativesV{major}_{minor}_{patch}` \u2014 non-alphanumerics in\n * the version string are mapped to `_` to keep it a valid JS identifier.\n * MUST stay in sync with `VERSION_SENTINEL_EXPORT` in\n * `packages/natives/native/index.js` (which derives the name from\n * `package.json#version`).\n */\n", "def": "function __piNativesV16_3_15(): void"}
{"kind": "fn", "name": "__ompInstallTokioRuntime", "js_doc": "/**\n * Install the bounded Tokio runtime napi-rs adopts for async exports and the\n * bounded Rayon global pool used by native parallel iterators.\n * \n * The JS loader calls this exactly once, synchronously, right *after* `dlopen`\n * returns and *before* any async native or parallel iterator runs \u2014 never from\n * `#[module_init]`. Building a multi-thread runtime eagerly spawns worker\n * threads, and doing that during module init (while the dynamic-loader lock is\n * held) deadlocks on some hosts: a fresh worker blocks acquiring the loader\n * lock that the init thread still owns. napi-rs only materializes its runtime\n * on the first async call (`RT` is a `LazyLock`) and\n * `create_custom_tokio_runtime` merely records the runtime in a `OnceLock`, so\n * installing it post-load is still honored.\n * \n * Without the Tokio override napi builds its own default (one worker per CPU,\n * spawned eagerly), which aborts the process (`os error 1455`) on a\n * memory-constrained Windows host before any JS error can surface;\n * [`create_windows_napi_tokio_runtime`] pre-flights the spawn instead. Rayon\n * has the same one-thread-per-core lazy default, so [`configure_rayon_pool`]\n * installs a probed global pool before `count_tokens` or vendored `sort` can\n * trigger it across a N-API nounwind boundary. If no worker thread is\n * spawnable, patched Rayon callsites stay sequential rather than registering a\n * current-thread-only global pool that cannot steal work from later native\n * calls. Idempotent.\n */\n", "def": "function __ompInstallTokioRuntime(): void"}
