@love-moon/ai-sdk 0.2.16

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,26 @@
1
+ export function resumeProviderForBackend(backend: any): "codex" | "claude" | "copilot" | null;
2
+ export function findSessionPath(provider: any, sessionId: any, options?: {}): Promise<any>;
3
+ export function findCodexSessionPath(sessionId: any, options?: {}): Promise<string | null>;
4
+ export function findClaudeSessionPath(sessionId: any, options?: {}): Promise<any>;
5
+ export function findCopilotSessionPath(sessionId: any, options?: {}): Promise<string | null>;
6
+ export function resolveSessionRunDirectory(sessionPath: any): Promise<string>;
7
+ export function inspectResumeTarget(backend: any, sessionId: any, options?: {}): Promise<{
8
+ provider: string;
9
+ sessionId: string;
10
+ sessionPath: any;
11
+ cwd: string;
12
+ debugMetadata: {
13
+ cwdSource: string;
14
+ sessionPath: any;
15
+ };
16
+ }>;
17
+ export function resolveResumeContext(backend: any, sessionId: any, options?: {}): Promise<{
18
+ provider: string;
19
+ sessionId: string;
20
+ sessionPath: any;
21
+ cwd: string;
22
+ debugMetadata: {
23
+ cwdSource: string;
24
+ sessionPath: any;
25
+ };
26
+ }>;
package/dist/resume.js ADDED
@@ -0,0 +1,380 @@
1
+ import fs from "node:fs";
2
+ import { promises as fsp } from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import readline from "node:readline";
6
+ import yaml from "js-yaml";
7
+ function normalizeBackend(backend) {
8
+ return String(backend || "").trim().toLowerCase();
9
+ }
10
+ function resolveHomeDir(options) {
11
+ if (options?.homeDir) {
12
+ return options.homeDir;
13
+ }
14
+ return os.homedir();
15
+ }
16
+ function normalizeSessionId(sessionId) {
17
+ return typeof sessionId === "string" ? sessionId.trim() : "";
18
+ }
19
+ export function resumeProviderForBackend(backend) {
20
+ const normalizedBackend = normalizeBackend(backend);
21
+ if (normalizedBackend === "codex" || normalizedBackend === "code") {
22
+ return "codex";
23
+ }
24
+ if (normalizedBackend === "claude" || normalizedBackend === "claude-code") {
25
+ return "claude";
26
+ }
27
+ if (normalizedBackend === "copilot") {
28
+ return "copilot";
29
+ }
30
+ return null;
31
+ }
32
+ export async function findSessionPath(provider, sessionId, options = {}) {
33
+ const normalizedProvider = String(provider || "").trim().toLowerCase();
34
+ if (normalizedProvider === "codex") {
35
+ return findCodexSessionPath(sessionId, options);
36
+ }
37
+ if (normalizedProvider === "claude") {
38
+ return findClaudeSessionPath(sessionId, options);
39
+ }
40
+ if (normalizedProvider === "copilot") {
41
+ return findCopilotSessionPath(sessionId, options);
42
+ }
43
+ throw new Error(`Unsupported provider: ${provider}`);
44
+ }
45
+ export async function findCodexSessionPath(sessionId, options = {}) {
46
+ const normalizedSessionId = normalizeSessionId(sessionId);
47
+ if (!normalizedSessionId) {
48
+ return null;
49
+ }
50
+ const homeDir = resolveHomeDir(options);
51
+ const sessionsDir = options.codexSessionsDir || path.join(homeDir, ".codex", "sessions");
52
+ return findCodexSessionFile(sessionsDir, normalizedSessionId);
53
+ }
54
+ export async function findClaudeSessionPath(sessionId, options = {}) {
55
+ const normalizedSessionId = normalizeSessionId(sessionId);
56
+ if (!normalizedSessionId) {
57
+ return null;
58
+ }
59
+ const homeDir = resolveHomeDir(options);
60
+ const projectsDir = options.claudeProjectsDir || path.join(homeDir, ".claude", "projects");
61
+ const sessionEntries = await findClaudeSessionEntries(projectsDir, normalizedSessionId);
62
+ if (sessionEntries.length > 0) {
63
+ return sessionEntries[0]?.source || null;
64
+ }
65
+ const tasksDir = options.claudeTasksDir || path.join(homeDir, ".claude", "tasks");
66
+ const directTaskDir = path.join(tasksDir, normalizedSessionId);
67
+ if (await pathExists(directTaskDir, "directory")) {
68
+ return directTaskDir;
69
+ }
70
+ return null;
71
+ }
72
+ export async function findCopilotSessionPath(sessionId, options = {}) {
73
+ const normalizedSessionId = normalizeSessionId(sessionId);
74
+ if (!normalizedSessionId) {
75
+ return null;
76
+ }
77
+ const homeDir = resolveHomeDir(options);
78
+ const sessionStateDir = options.copilotSessionStateDir || path.join(homeDir, ".copilot", "session-state");
79
+ const directJsonlPath = path.join(sessionStateDir, `${normalizedSessionId}.jsonl`);
80
+ if (await pathExists(directJsonlPath, "file")) {
81
+ return directJsonlPath;
82
+ }
83
+ const directSessionDir = path.join(sessionStateDir, normalizedSessionId);
84
+ if (await pathExists(directSessionDir, "directory")) {
85
+ return directSessionDir;
86
+ }
87
+ return findPathByName(sessionStateDir, normalizedSessionId);
88
+ }
89
+ export async function resolveSessionRunDirectory(sessionPath) {
90
+ const normalizedPath = typeof sessionPath === "string" ? sessionPath.trim() : "";
91
+ if (!normalizedPath) {
92
+ throw new Error("Invalid session path");
93
+ }
94
+ let stats;
95
+ try {
96
+ stats = await fsp.stat(normalizedPath);
97
+ }
98
+ catch {
99
+ throw new Error(`Session path does not exist: ${normalizedPath}`);
100
+ }
101
+ return stats.isDirectory() ? normalizedPath : path.dirname(normalizedPath);
102
+ }
103
+ export async function inspectResumeTarget(backend, sessionId, options = {}) {
104
+ return resolveResumeContext(backend, sessionId, options);
105
+ }
106
+ export async function resolveResumeContext(backend, sessionId, options = {}) {
107
+ const normalizedSessionId = normalizeSessionId(sessionId);
108
+ if (!normalizedSessionId) {
109
+ throw new Error("--resume requires a session id");
110
+ }
111
+ const provider = resumeProviderForBackend(backend);
112
+ if (!provider) {
113
+ throw new Error(`--resume is not supported for backend "${backend}"`);
114
+ }
115
+ const sessionPath = await findSessionPath(provider, normalizedSessionId, options);
116
+ if (!sessionPath) {
117
+ throw new Error(`Invalid --resume session id for ${provider}: ${normalizedSessionId}`);
118
+ }
119
+ const cwdFromSession = await extractResumeCwdFromSession(provider, sessionPath, normalizedSessionId);
120
+ const fallbackCwd = await resolveSessionRunDirectory(sessionPath);
121
+ const cwd = cwdFromSession || fallbackCwd;
122
+ if (!(await isExistingDirectory(cwd))) {
123
+ throw new Error(`Resume workspace path does not exist: ${cwd}`);
124
+ }
125
+ return {
126
+ provider,
127
+ sessionId: normalizedSessionId,
128
+ sessionPath,
129
+ cwd,
130
+ debugMetadata: {
131
+ cwdSource: cwdFromSession ? "session" : "session_path",
132
+ sessionPath,
133
+ },
134
+ };
135
+ }
136
+ async function isExistingDirectory(targetPath) {
137
+ const normalizedPath = typeof targetPath === "string" ? targetPath.trim() : "";
138
+ if (!normalizedPath) {
139
+ return false;
140
+ }
141
+ try {
142
+ const stats = await fsp.stat(normalizedPath);
143
+ return stats.isDirectory();
144
+ }
145
+ catch {
146
+ return false;
147
+ }
148
+ }
149
+ async function extractCodexResumeCwd(sessionPath) {
150
+ if (!sessionPath.endsWith(".jsonl")) {
151
+ return null;
152
+ }
153
+ const rl = readline.createInterface({
154
+ input: fs.createReadStream(sessionPath),
155
+ crlfDelay: Infinity,
156
+ });
157
+ for await (const line of rl) {
158
+ const trimmed = line.trim();
159
+ if (!trimmed) {
160
+ continue;
161
+ }
162
+ let entry;
163
+ try {
164
+ entry = JSON.parse(trimmed);
165
+ }
166
+ catch {
167
+ continue;
168
+ }
169
+ const maybeCwd = entry?.type === "session_meta" ? entry?.payload?.cwd : null;
170
+ if (typeof maybeCwd === "string" && maybeCwd.trim()) {
171
+ return maybeCwd.trim();
172
+ }
173
+ }
174
+ return null;
175
+ }
176
+ async function extractClaudeResumeCwd(sessionPath, sessionId) {
177
+ if (!sessionPath.endsWith(".jsonl")) {
178
+ return null;
179
+ }
180
+ const rl = readline.createInterface({
181
+ input: fs.createReadStream(sessionPath),
182
+ crlfDelay: Infinity,
183
+ });
184
+ for await (const line of rl) {
185
+ const trimmed = line.trim();
186
+ if (!trimmed) {
187
+ continue;
188
+ }
189
+ let entry;
190
+ try {
191
+ entry = JSON.parse(trimmed);
192
+ }
193
+ catch {
194
+ continue;
195
+ }
196
+ const idMatches = String(entry?.sessionId || "").trim() === sessionId;
197
+ const maybeCwd = entry?.cwd;
198
+ if (idMatches && typeof maybeCwd === "string" && maybeCwd.trim()) {
199
+ return maybeCwd.trim();
200
+ }
201
+ }
202
+ return null;
203
+ }
204
+ async function extractCopilotResumeCwd(sessionPath) {
205
+ let stats;
206
+ try {
207
+ stats = await fsp.stat(sessionPath);
208
+ }
209
+ catch {
210
+ return null;
211
+ }
212
+ if (stats.isDirectory()) {
213
+ const workspaceYamlPath = path.join(sessionPath, "workspace.yaml");
214
+ try {
215
+ const yamlContent = await fsp.readFile(workspaceYamlPath, "utf8");
216
+ const parsed = yaml.load(yamlContent);
217
+ const maybeCwd = parsed && typeof parsed === "object" ? parsed.cwd : null;
218
+ if (typeof maybeCwd === "string" && maybeCwd.trim()) {
219
+ return maybeCwd.trim();
220
+ }
221
+ }
222
+ catch {
223
+ return null;
224
+ }
225
+ return null;
226
+ }
227
+ if (!sessionPath.endsWith(".jsonl")) {
228
+ return null;
229
+ }
230
+ const rl = readline.createInterface({
231
+ input: fs.createReadStream(sessionPath),
232
+ crlfDelay: Infinity,
233
+ });
234
+ for await (const line of rl) {
235
+ const trimmed = line.trim();
236
+ if (!trimmed) {
237
+ continue;
238
+ }
239
+ let entry;
240
+ try {
241
+ entry = JSON.parse(trimmed);
242
+ }
243
+ catch {
244
+ continue;
245
+ }
246
+ const maybeCwd = entry?.data?.context?.cwd || entry?.data?.cwd;
247
+ if (typeof maybeCwd === "string" && maybeCwd.trim()) {
248
+ return maybeCwd.trim();
249
+ }
250
+ }
251
+ return null;
252
+ }
253
+ async function extractResumeCwdFromSession(provider, sessionPath, sessionId) {
254
+ if (provider === "codex") {
255
+ return extractCodexResumeCwd(sessionPath);
256
+ }
257
+ if (provider === "claude") {
258
+ return extractClaudeResumeCwd(sessionPath, sessionId);
259
+ }
260
+ if (provider === "copilot") {
261
+ return extractCopilotResumeCwd(sessionPath);
262
+ }
263
+ return null;
264
+ }
265
+ async function findCodexSessionFile(rootDir, sessionId) {
266
+ const queue = [rootDir];
267
+ while (queue.length) {
268
+ const current = queue.pop();
269
+ let entries = [];
270
+ try {
271
+ entries = await fsp.readdir(current, { withFileTypes: true });
272
+ }
273
+ catch {
274
+ continue;
275
+ }
276
+ for (const entry of entries) {
277
+ const fullPath = path.join(current, entry.name);
278
+ if (entry.isDirectory()) {
279
+ queue.push(fullPath);
280
+ }
281
+ else if (entry.isFile() &&
282
+ entry.name.includes(sessionId) &&
283
+ entry.name.endsWith(".jsonl")) {
284
+ return fullPath;
285
+ }
286
+ }
287
+ }
288
+ return null;
289
+ }
290
+ async function findClaudeSessionEntries(projectsDir, sessionId) {
291
+ const entries = [];
292
+ let projectDirs = [];
293
+ try {
294
+ projectDirs = await fsp.readdir(projectsDir, { withFileTypes: true });
295
+ }
296
+ catch {
297
+ return entries;
298
+ }
299
+ for (const projectDir of projectDirs) {
300
+ if (!projectDir.isDirectory()) {
301
+ continue;
302
+ }
303
+ const projectPath = path.join(projectsDir, projectDir.name);
304
+ let files = [];
305
+ try {
306
+ files = await fsp.readdir(projectPath, { withFileTypes: true });
307
+ }
308
+ catch {
309
+ continue;
310
+ }
311
+ for (const file of files) {
312
+ if (!file.isFile()) {
313
+ continue;
314
+ }
315
+ if (!file.name.endsWith(".jsonl") || file.name.startsWith("agent-")) {
316
+ continue;
317
+ }
318
+ const filePath = path.join(projectPath, file.name);
319
+ const rl = readline.createInterface({
320
+ input: fs.createReadStream(filePath),
321
+ crlfDelay: Infinity,
322
+ });
323
+ for await (const line of rl) {
324
+ const trimmed = line.trim();
325
+ if (!trimmed) {
326
+ continue;
327
+ }
328
+ let entry;
329
+ try {
330
+ entry = JSON.parse(trimmed);
331
+ }
332
+ catch {
333
+ continue;
334
+ }
335
+ if (entry.sessionId === sessionId) {
336
+ entries.push({ ...entry, source: filePath });
337
+ }
338
+ }
339
+ }
340
+ }
341
+ return entries;
342
+ }
343
+ async function findPathByName(rootDir, sessionId) {
344
+ const queue = [rootDir];
345
+ while (queue.length) {
346
+ const current = queue.pop();
347
+ let entries = [];
348
+ try {
349
+ entries = await fsp.readdir(current, { withFileTypes: true });
350
+ }
351
+ catch {
352
+ continue;
353
+ }
354
+ for (const entry of entries) {
355
+ const fullPath = path.join(current, entry.name);
356
+ if (entry.name.includes(sessionId)) {
357
+ return fullPath;
358
+ }
359
+ if (entry.isDirectory()) {
360
+ queue.push(fullPath);
361
+ }
362
+ }
363
+ }
364
+ return null;
365
+ }
366
+ async function pathExists(targetPath, expectedType) {
367
+ try {
368
+ const stats = await fsp.stat(targetPath);
369
+ if (expectedType === "file") {
370
+ return stats.isFile();
371
+ }
372
+ if (expectedType === "directory") {
373
+ return stats.isDirectory();
374
+ }
375
+ return true;
376
+ }
377
+ catch {
378
+ return false;
379
+ }
380
+ }
@@ -0,0 +1,7 @@
1
+ export function normalizeBackend(backend: any): string;
2
+ export function isSupportedBackend(backend: any): boolean;
3
+ export function assertSupportedBackend(backend: any): string;
4
+ export function createLocalAiSession(backend: any, options?: {}): CodexAppServerSession;
5
+ export const DEFAULT_PROVIDER_VARIANT: "codex-app-server";
6
+ export { CodexAppServerSession };
7
+ import { CodexAppServerSession } from "./providers/codex-app-server-session.js";
@@ -0,0 +1,23 @@
1
+ import { CodexAppServerSession } from "./providers/codex-app-server-session.js";
2
+ export const DEFAULT_PROVIDER_VARIANT = "codex-app-server";
3
+ export function normalizeBackend(backend) {
4
+ const normalized = String(backend || "").trim().toLowerCase();
5
+ if (normalized === "code") {
6
+ return "codex";
7
+ }
8
+ return normalized;
9
+ }
10
+ export function isSupportedBackend(backend) {
11
+ return normalizeBackend(backend) === "codex";
12
+ }
13
+ export function assertSupportedBackend(backend) {
14
+ const normalized = normalizeBackend(backend);
15
+ if (normalized === "codex") {
16
+ return normalized;
17
+ }
18
+ throw new Error(`Unsupported AI SDK backend "${backend}". Only codex app-server is supported.`);
19
+ }
20
+ export function createLocalAiSession(backend, options = {}) {
21
+ return new CodexAppServerSession(assertSupportedBackend(backend), options);
22
+ }
23
+ export { CodexAppServerSession };
@@ -0,0 +1,17 @@
1
+ export function normalizeLogger(logger: any): any;
2
+ export function emitLog(logger: any, message: any): void;
3
+ export function truncateText(value: any, maxLen?: number): string;
4
+ export function sanitizeForLog(value: any, maxLen?: number): string;
5
+ export function isTruthyEnv(value: any): boolean;
6
+ export function getBoundedEnvInt(envName: any, fallback: any, min: any, max: any): any;
7
+ export function parseCommandParts(commandLine: any): {
8
+ command: string;
9
+ args: string[];
10
+ };
11
+ export function resolveConductorConfigPath(configFilePath: any): any;
12
+ export function loadYamlConfig(configFilePath: any): any;
13
+ export function loadAllowCliList(configFilePath: any): any;
14
+ export function loadEnvConfig(configFilePath: any): any;
15
+ export function proxyToEnv(envConfig: any): {};
16
+ export function serializeError(error: any): any;
17
+ export function reviveError(payload: any): Error;
package/dist/shared.js ADDED
@@ -0,0 +1,155 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import yaml from "js-yaml";
5
+ export function normalizeLogger(logger) {
6
+ if (typeof logger === "function") {
7
+ return { log: logger };
8
+ }
9
+ if (logger && typeof logger === "object") {
10
+ return logger;
11
+ }
12
+ return {};
13
+ }
14
+ export function emitLog(logger, message) {
15
+ if (typeof logger?.log !== "function") {
16
+ return;
17
+ }
18
+ try {
19
+ logger.log(message);
20
+ }
21
+ catch {
22
+ // best effort
23
+ }
24
+ }
25
+ export function truncateText(value, maxLen = 240) {
26
+ if (!value)
27
+ return "";
28
+ const text = String(value).trim();
29
+ if (text.length <= maxLen)
30
+ return text;
31
+ return `${text.slice(0, maxLen)}...`;
32
+ }
33
+ export function sanitizeForLog(value, maxLen = 180) {
34
+ if (!value)
35
+ return "";
36
+ return truncateText(String(value).replace(/\s+/g, " ").trim(), maxLen);
37
+ }
38
+ export function isTruthyEnv(value) {
39
+ if (value === undefined || value === null)
40
+ return false;
41
+ const normalized = String(value).trim().toLowerCase();
42
+ return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
43
+ }
44
+ export function getBoundedEnvInt(envName, fallback, min, max) {
45
+ const fallbackNumber = Number(fallback);
46
+ const normalizedFallback = Number.isFinite(fallbackNumber)
47
+ ? Math.min(Math.max(Math.round(fallbackNumber), min), max)
48
+ : min;
49
+ const raw = process.env[envName];
50
+ const parsed = Number.parseInt(String(raw ?? ""), 10);
51
+ if (!Number.isFinite(parsed)) {
52
+ return normalizedFallback;
53
+ }
54
+ return Math.min(Math.max(parsed, min), max);
55
+ }
56
+ export function parseCommandParts(commandLine) {
57
+ const normalized = String(commandLine || "").trim();
58
+ if (!normalized) {
59
+ return { command: "", args: [] };
60
+ }
61
+ const parts = normalized.split(/\s+/);
62
+ return {
63
+ command: parts[0],
64
+ args: parts.slice(1),
65
+ };
66
+ }
67
+ export function resolveConductorConfigPath(configFilePath) {
68
+ const home = os.homedir();
69
+ return configFilePath || process.env.CONDUCTOR_CONFIG || path.join(home, ".conductor", "config.yaml");
70
+ }
71
+ export function loadYamlConfig(configFilePath) {
72
+ try {
73
+ const configPath = resolveConductorConfigPath(configFilePath);
74
+ if (!fs.existsSync(configPath)) {
75
+ return null;
76
+ }
77
+ const content = fs.readFileSync(configPath, "utf8");
78
+ const parsed = yaml.load(content);
79
+ return parsed && typeof parsed === "object" ? parsed : null;
80
+ }
81
+ catch {
82
+ return null;
83
+ }
84
+ }
85
+ export function loadAllowCliList(configFilePath) {
86
+ const parsed = loadYamlConfig(configFilePath);
87
+ if (parsed && parsed.allow_cli_list && typeof parsed.allow_cli_list === "object") {
88
+ return parsed.allow_cli_list;
89
+ }
90
+ return {};
91
+ }
92
+ export function loadEnvConfig(configFilePath) {
93
+ const parsed = loadYamlConfig(configFilePath);
94
+ if (parsed && parsed.envs && typeof parsed.envs === "object") {
95
+ return parsed.envs;
96
+ }
97
+ return null;
98
+ }
99
+ export function proxyToEnv(envConfig) {
100
+ if (!envConfig || typeof envConfig !== "object") {
101
+ return {};
102
+ }
103
+ const env = {};
104
+ const mappings = {
105
+ http_proxy: ["HTTP_PROXY", "http_proxy"],
106
+ https_proxy: ["HTTPS_PROXY", "https_proxy"],
107
+ all_proxy: ["ALL_PROXY", "all_proxy"],
108
+ no_proxy: ["NO_PROXY", "no_proxy"],
109
+ };
110
+ for (const [key, envKeys] of Object.entries(mappings)) {
111
+ const value = envConfig[key] || envConfig[key.toUpperCase()];
112
+ if (!value) {
113
+ continue;
114
+ }
115
+ for (const envKey of envKeys) {
116
+ env[envKey] = value;
117
+ }
118
+ }
119
+ return env;
120
+ }
121
+ export function serializeError(error) {
122
+ if (error instanceof Error) {
123
+ const payload = {
124
+ name: error.name,
125
+ message: error.message,
126
+ stack: error.stack,
127
+ };
128
+ for (const key of Object.keys(error)) {
129
+ payload[key] = error[key];
130
+ }
131
+ return payload;
132
+ }
133
+ if (error && typeof error === "object") {
134
+ return { ...error, message: String(error.message || "Unknown error") };
135
+ }
136
+ return { message: String(error || "Unknown error") };
137
+ }
138
+ export function reviveError(payload) {
139
+ const error = new Error(String(payload?.message || "Unknown error"));
140
+ if (payload && typeof payload === "object") {
141
+ if (payload.name) {
142
+ error.name = String(payload.name);
143
+ }
144
+ if (payload.stack) {
145
+ error.stack = String(payload.stack);
146
+ }
147
+ for (const [key, value] of Object.entries(payload)) {
148
+ if (key === "name" || key === "message" || key === "stack") {
149
+ continue;
150
+ }
151
+ error[key] = value;
152
+ }
153
+ }
154
+ return error;
155
+ }
@@ -0,0 +1,36 @@
1
+ export class CodexAppServerTransport extends EventEmitter<[never]> {
2
+ constructor(options?: {});
3
+ options: {};
4
+ logger: any;
5
+ cwd: any;
6
+ command: string;
7
+ args: string[];
8
+ env: any;
9
+ child: import("child_process").ChildProcessWithoutNullStreams | null;
10
+ stdoutReader: readline.Interface | null;
11
+ stderrReader: readline.Interface | null;
12
+ pending: Map<any, any>;
13
+ nextRequestId: number;
14
+ bootPromise: Promise<void> | null;
15
+ booted: boolean;
16
+ closeRequested: boolean;
17
+ closed: boolean;
18
+ stderrTail: any[];
19
+ stderrTailMax: number;
20
+ protocolTrace: boolean;
21
+ log(message: any): void;
22
+ boot(): Promise<void>;
23
+ bootInternal(): Promise<void>;
24
+ spawnChild(): void;
25
+ handleStdoutLine(line: any): void;
26
+ handleStderrLine(line: any): void;
27
+ failPendingRequests(error: any): void;
28
+ request(method: any, params?: {}): Promise<any>;
29
+ requestRaw(method: any, params?: {}): Promise<any>;
30
+ sendNotification(method: any, params?: {}): void;
31
+ get pid(): number | null;
32
+ getRecentStderr(): any[];
33
+ close(): Promise<void>;
34
+ }
35
+ import { EventEmitter } from "node:events";
36
+ import readline from "node:readline";