@mario.andreschak/mcp-bash 3.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ import { type ChildProcess } from 'node:child_process';
2
+ import { type IPty } from '@lydell/node-pty';
3
+ import type { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
4
+ export declare const BASH_TERMINAL_APP_URI = "ui://bash/terminal";
5
+ type EffectiveShell = 'pwsh' | 'powershell' | 'bash' | 'cmd' | 'sh';
6
+ export interface BashToolProgress {
7
+ progress: number;
8
+ message?: string;
9
+ }
10
+ export interface BashExecutionContext {
11
+ signal?: AbortSignal;
12
+ onProgress?: (progress: BashToolProgress) => void | Promise<void>;
13
+ }
14
+ /** Test-only: forget cached shell-executable lookups. */
15
+ export declare function _resetBashShellCacheForTests(): void;
16
+ interface BashSession {
17
+ id: string;
18
+ /** Host-derived caller/conversation scope; never selected by tool arguments. */
19
+ ownerScope: string;
20
+ command: string;
21
+ cwd: string;
22
+ child: ChildProcess;
23
+ output: string;
24
+ truncated: boolean;
25
+ running: boolean;
26
+ exitCode: number | null;
27
+ startedAt: number;
28
+ endedAt?: number;
29
+ cancelEscalation?: () => void;
30
+ reapTimer?: NodeJS.Timeout;
31
+ }
32
+ interface TerminalSession {
33
+ id: string;
34
+ ownerScope: string;
35
+ shell: EffectiveShell;
36
+ cwd: string;
37
+ pty: IPty;
38
+ output: string;
39
+ outputStart: number;
40
+ nextCursor: number;
41
+ running: boolean;
42
+ exitCode: number | null;
43
+ startedAt: number;
44
+ endedAt?: number;
45
+ reapTimer?: NodeJS.Timeout;
46
+ }
47
+ declare global {
48
+ var __flujo_bash_sessions: Map<string, BashSession> | undefined;
49
+ var __flujo_terminal_sessions: Map<string, TerminalSession> | undefined;
50
+ var __flujo_bash_foreground_children: Set<ChildProcess> | undefined;
51
+ var __flujo_bash_cleanup_registered: boolean | undefined;
52
+ }
53
+ /** Kill every live session's process tree — used on FLUJO process exit. */
54
+ export declare function shutdownBashSessions(): void;
55
+ export declare function bashToolDefinitions(): Tool[];
56
+ export declare function bashCallTool(toolName: string, args: Record<string, unknown>, callerNodeId?: string, ownerScope?: string, context?: BashExecutionContext): Promise<CallToolResult>;
57
+ /** Test-only: force-kill and clear all sessions. */
58
+ export declare function _resetBashSessionsForTests(): void;
59
+ export {};