feat(core): refactor shell execution to use node-pty (#6088)

This commit is contained in:
Gal Zahavi
2025-08-14 13:40:12 -07:00
committed by GitHub
parent 48af0456c1
commit 980091cbc2
16 changed files with 453 additions and 409 deletions

View File

@@ -62,6 +62,8 @@ export type TrackedToolCall =
| TrackedCompletedToolCall
| TrackedCancelledToolCall;
import { useTerminalSize } from './useTerminalSize.js';
export function useReactToolScheduler(
onComplete: (tools: CompletedToolCall[]) => Promise<void>,
config: Config,
@@ -71,6 +73,7 @@ export function useReactToolScheduler(
getPreferredEditor: () => EditorType | undefined,
onEditorClose: () => void,
): [TrackedToolCall[], ScheduleFn, MarkToolsAsSubmittedFn] {
const terminalSize = useTerminalSize();
const [toolCallsForDisplay, setToolCallsForDisplay] = useState<
TrackedToolCall[]
>([]);
@@ -140,6 +143,7 @@ export function useReactToolScheduler(
onToolCallsUpdate: toolCallsUpdateHandler,
getPreferredEditor,
config,
getTerminalSize: () => terminalSize,
onEditorClose,
}),
[
@@ -148,6 +152,7 @@ export function useReactToolScheduler(
allToolCallsCompleteHandler,
toolCallsUpdateHandler,
getPreferredEditor,
terminalSize,
onEditorClose,
],
);