@nuvin/agent-core 0.3.0-rc.3 → 0.3.0-rc.5

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.
@@ -1,116 +0,0 @@
1
- import type { ChildProcess } from "node:child_process";
2
- import { StringDecoder } from "node:string_decoder";
3
- import { type ProcessTreeSignalAdapter } from "./process-tree-termination.ts";
4
- import { type TerminalOutputNormalizer } from "./terminal-output-normalizer.ts";
5
- export type BackgroundProcessStatus = "running" | "terminating" | "exited" | "killed" | "error";
6
- export interface BackgroundProcessReservation {
7
- readonly id: string;
8
- }
9
- export interface BackgroundProcessTerminationResult {
10
- shellId: string;
11
- outcome: "killed" | "already-terminal" | "failed";
12
- status: BackgroundProcessStatus;
13
- exitCode: number | null;
14
- signal: NodeJS.Signals | null;
15
- error: string | null;
16
- gracefulRequested: boolean;
17
- forceRequested: boolean;
18
- }
19
- export interface BackgroundProcessEntry {
20
- shellId: string;
21
- command: string;
22
- cwd: string;
23
- pid: number | undefined;
24
- processGroupId: number | undefined;
25
- status: BackgroundProcessStatus;
26
- exitCode: number | null;
27
- signal: NodeJS.Signals | null;
28
- startedAt: number;
29
- error: string | null;
30
- gracefulRequested: boolean;
31
- forceRequested: boolean;
32
- child: ChildProcess | null;
33
- buffer: string[];
34
- bufferChars: number;
35
- totalProduced: number;
36
- totalDropped: number;
37
- readCursor: number;
38
- stdoutDecoder: StringDecoder;
39
- stderrDecoder: StringDecoder;
40
- stdoutNormalizer: TerminalOutputNormalizer;
41
- stderrNormalizer: TerminalOutputNormalizer;
42
- stripAnsi: boolean;
43
- killRequested: boolean;
44
- processExited: boolean;
45
- streamsFlushed: boolean;
46
- terminalSettled: boolean;
47
- terminalPromise: Promise<void>;
48
- resolveTerminal: () => void;
49
- terminationPromise?: Promise<BackgroundProcessTerminationResult>;
50
- terminationSettled: boolean;
51
- }
52
- export interface BackgroundProcessReadResult {
53
- output: string;
54
- status: BackgroundProcessStatus;
55
- exitCode: number | null;
56
- signal: NodeJS.Signals | null;
57
- error: string | null;
58
- truncated: boolean;
59
- }
60
- export interface BackgroundProcessRegistryOptions {
61
- maxConcurrent?: number;
62
- maxEntries?: number;
63
- capChars?: number;
64
- platform?: NodeJS.Platform;
65
- signalAdapter?: ProcessTreeSignalAdapter;
66
- }
67
- export declare class BackgroundProcessCleanupError extends Error {
68
- readonly results: BackgroundProcessTerminationResult[];
69
- constructor(results: BackgroundProcessTerminationResult[]);
70
- }
71
- export declare function isTerminalStatus(status: BackgroundProcessStatus): boolean;
72
- export declare class BackgroundProcessRegistry {
73
- private readonly entries;
74
- private readonly reservations;
75
- private readonly maxConcurrent;
76
- private readonly maxEntries;
77
- private readonly capChars;
78
- private readonly platform;
79
- private readonly signalAdapter;
80
- private counter;
81
- constructor(opts?: BackgroundProcessRegistryOptions);
82
- reserve(): BackgroundProcessReservation;
83
- release(reservation: BackgroundProcessReservation): void;
84
- attach(reservation: BackgroundProcessReservation, opts: {
85
- child: ChildProcess;
86
- command: string;
87
- cwd: string;
88
- stripAnsi: boolean;
89
- processGroupId?: number;
90
- }): BackgroundProcessEntry;
91
- /** Compatibility adapter for callers being migrated to reserve/attach. */
92
- spawn(opts: {
93
- child: ChildProcess;
94
- command: string;
95
- cwd: string;
96
- stripAnsi: boolean;
97
- }): BackgroundProcessEntry;
98
- read(shellId: string, opts?: {
99
- regex?: string;
100
- }): BackgroundProcessReadResult;
101
- list(): BackgroundProcessEntry[];
102
- kill(shellId: string): Promise<BackgroundProcessTerminationResult>;
103
- closeAll(): Promise<BackgroundProcessTerminationResult[]>;
104
- reset(): Promise<BackgroundProcessTerminationResult[]>;
105
- private terminate;
106
- private confirmed;
107
- private failed;
108
- private result;
109
- private waitForTerminal;
110
- private appendDecoded;
111
- private settleTerminal;
112
- private flushStreams;
113
- private append;
114
- private evictIfNeeded;
115
- }
116
- //# sourceMappingURL=background-process-registry.d.ts.map