/** Human shell gestures execute through Harness, never through a model tool. */ import type { Session } from '@deepseek-ai/dsh-session'; import type { ShellExecutor } from '@deepseek-ai/dsh-shell'; import type { SandboxPolicyService } from '@deepseek-ai/dsh-sandbox-policy'; import type { Composer } from '@dshline/renderer'; import type { ShellOutput } from './shell-output.ts'; /** * Detect a leading meaningful ! without trimming shell source or trailing spaces. * @param text - original composer buffer. * @returns source after only !, including blank source, or undefined for prose. */ export declare function parseShellCommand(text: string): string | undefined; /** * Whether a composer's CURRENT DRAFT is a human shell gesture. * * The same question {@link parseShellCommand} answers, asked of the live buffer * rather than of a submitted line, so the composer can SHOW the mode that * pressing enter is about to select. Routing and presentation cannot disagree * about what a `!` means, because both ask for the buffer's first non-whitespace * character and `trimStart()` is what strips that run: the answer here is * character-for-character what `parseShellCommand(composer.value)` would say * about the same buffer. * * It reads that one character instead of the whole draft, which is what keeps * the frame free on a keystroke: {@link Composer.leadingNonWhitespaceChar} stops * at the first character that is not whitespace, so a buffer holding a folded paste * of a hundred thousand characters costs the same as an empty one. * @param composer - the buffer being edited. * @returns whether submitting this draft would execute a local shell command. */ export declare function isShellDraft(composer: Composer): boolean; /** * Execute one foreground, non-PTY command under the attached Session's policy. * The caller echoes source, owns cancellation and Session lifetime, and finally * aborts its per-run signal to request cleanup of any retained managed range. * @param options - execution authority, original shell source and UI callbacks. * @returns terminal-safe status/error logical rows only, never collected output. */ export declare function runShellCommand(options: { command: string; shell: Pick | undefined; sandboxPolicy: Pick | undefined; session: Session; workdir: string; signal: AbortSignal; output: ShellOutput; changed: () => void; }): Promise; //# sourceMappingURL=shell-command.d.ts.map