codecane 1.0.334 → 1.0.336

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,47 @@
1
+ import { ChildProcessWithoutNullStreams } from 'child_process';
2
+ import type { IPty } from '@homebridge/node-pty-prebuilt-multiarch';
3
+ type PersistentProcess = {
4
+ type: 'pty';
5
+ shell: 'pty';
6
+ pty: IPty;
7
+ timerId: NodeJS.Timeout | null;
8
+ globalOutputBuffer: string;
9
+ globalOutputLastReadLength: number;
10
+ } | {
11
+ type: 'process';
12
+ shell: 'bash' | 'cmd.exe' | 'powershell.exe';
13
+ childProcess: ChildProcessWithoutNullStreams | null;
14
+ timerId: NodeJS.Timeout | null;
15
+ globalOutputBuffer: string;
16
+ globalOutputLastReadLength: number;
17
+ };
18
+ declare const createPersistantProcess: (dir: string, forceChildProcess?: boolean) => PersistentProcess;
19
+ export declare let persistentProcess: ReturnType<typeof createPersistantProcess> | null;
20
+ export declare const isCommandRunning: () => boolean;
21
+ export declare const recreateShell: (cwd: string, forceChildProcess?: boolean) => void;
22
+ export declare const resetShell: (cwd: string) => void;
23
+ export declare const runTerminalCommand: (toolCallId: string, command: string, mode: "user" | "assistant" | "manager", processType: "SYNC" | "BACKGROUND", timeoutSeconds: number, cwd?: string, stdoutFile?: string, stderrFile?: string) => Promise<{
24
+ result: string;
25
+ stdout: string;
26
+ exitCode: number | null;
27
+ }>;
28
+ export declare const runCommandPty: (persistentProcess: PersistentProcess & {
29
+ type: "pty";
30
+ }, command: string, mode: "user" | "assistant" | "manager", cwd: string, maybeTimeoutSeconds: number | null, resolve: (value: {
31
+ result: string;
32
+ stdout: string;
33
+ exitCode: number | null;
34
+ }) => void) => void;
35
+ export declare function killAndResetPersistentProcess(): void;
36
+ export declare function clearScreen(): void;
37
+ export declare const runCommandPtyManager: (persistentProcess: PersistentProcess & {
38
+ type: "pty";
39
+ }, command: string, cwd: string, maybeTimeoutSeconds: number | null, resolve: (value: {
40
+ result: string;
41
+ stdout: string;
42
+ exitCode: number | null;
43
+ }) => void) => void;
44
+ export declare const readNewTerminalOutput: (options?: {
45
+ maxLength: number;
46
+ }) => string;
47
+ export {};