@ai-devkit/agent-manager 0.3.0 → 0.5.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.
- package/dist/adapters/AgentAdapter.d.ts +2 -0
- package/dist/adapters/AgentAdapter.d.ts.map +1 -1
- package/dist/adapters/ClaudeCodeAdapter.d.ts +49 -38
- package/dist/adapters/ClaudeCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/ClaudeCodeAdapter.js +286 -293
- package/dist/adapters/ClaudeCodeAdapter.js.map +1 -1
- package/dist/adapters/CodexAdapter.d.ts +32 -30
- package/dist/adapters/CodexAdapter.d.ts.map +1 -1
- package/dist/adapters/CodexAdapter.js +148 -284
- package/dist/adapters/CodexAdapter.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +6 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +12 -11
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/matching.d.ts +39 -0
- package/dist/utils/matching.d.ts.map +1 -0
- package/dist/utils/matching.js +103 -0
- package/dist/utils/matching.js.map +1 -0
- package/dist/utils/process.d.ts +25 -40
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +151 -105
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/session.d.ts +30 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/session.js +101 -0
- package/dist/utils/session.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/AgentManager.test.ts +0 -25
- package/src/__tests__/adapters/ClaudeCodeAdapter.test.ts +921 -205
- package/src/__tests__/adapters/CodexAdapter.test.ts +468 -269
- package/src/__tests__/utils/matching.test.ts +191 -0
- package/src/__tests__/utils/process.test.ts +202 -0
- package/src/__tests__/utils/session.test.ts +117 -0
- package/src/adapters/AgentAdapter.ts +3 -0
- package/src/adapters/ClaudeCodeAdapter.ts +341 -418
- package/src/adapters/CodexAdapter.ts +155 -420
- package/src/index.ts +1 -3
- package/src/utils/index.ts +6 -3
- package/src/utils/matching.ts +92 -0
- package/src/utils/process.ts +133 -119
- package/src/utils/session.ts +92 -0
- package/dist/utils/file.d.ts +0 -52
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/file.js +0 -135
- package/dist/utils/file.js.map +0 -1
- package/src/utils/file.ts +0 -100
package/dist/utils/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateAgentName = exports.matchProcessesToSessions = exports.batchGetSessionFileBirthtimes = exports.getProcessTty = exports.enrichProcesses = exports.batchGetProcessStartTimes = exports.batchGetProcessCwds = exports.listAgentProcesses = void 0;
|
|
4
4
|
var process_1 = require("./process");
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
8
|
-
Object.defineProperty(exports, "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "listAgentProcesses", { enumerable: true, get: function () { return process_1.listAgentProcesses; } });
|
|
6
|
+
Object.defineProperty(exports, "batchGetProcessCwds", { enumerable: true, get: function () { return process_1.batchGetProcessCwds; } });
|
|
7
|
+
Object.defineProperty(exports, "batchGetProcessStartTimes", { enumerable: true, get: function () { return process_1.batchGetProcessStartTimes; } });
|
|
8
|
+
Object.defineProperty(exports, "enrichProcesses", { enumerable: true, get: function () { return process_1.enrichProcesses; } });
|
|
9
|
+
var process_2 = require("./process");
|
|
10
|
+
Object.defineProperty(exports, "getProcessTty", { enumerable: true, get: function () { return process_2.getProcessTty; } });
|
|
11
|
+
var session_1 = require("./session");
|
|
12
|
+
Object.defineProperty(exports, "batchGetSessionFileBirthtimes", { enumerable: true, get: function () { return session_1.batchGetSessionFileBirthtimes; } });
|
|
13
|
+
var matching_1 = require("./matching");
|
|
14
|
+
Object.defineProperty(exports, "matchProcessesToSessions", { enumerable: true, get: function () { return matching_1.matchProcessesToSessions; } });
|
|
15
|
+
Object.defineProperty(exports, "generateAgentName", { enumerable: true, get: function () { return matching_1.generateAgentName; } });
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgH;AAAvG,6GAAA,kBAAkB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAAE,oHAAA,yBAAyB,OAAA;AAAE,0GAAA,eAAe,OAAA;AAC5F,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,qCAA0D;AAAjD,wHAAA,6BAA6B,OAAA;AAEtC,uCAAyE;AAAhE,oHAAA,wBAAwB,OAAA;AAAE,6GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Matching Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared 1:1 greedy matching algorithm that pairs running processes with session files
|
|
5
|
+
* based on CWD and birth-time proximity to process start time.
|
|
6
|
+
*/
|
|
7
|
+
import type { ProcessInfo } from '../adapters/AgentAdapter';
|
|
8
|
+
import type { SessionFile } from './session';
|
|
9
|
+
/**
|
|
10
|
+
* Result of matching a process to a session file.
|
|
11
|
+
*/
|
|
12
|
+
export interface MatchResult {
|
|
13
|
+
/** The matched process */
|
|
14
|
+
process: ProcessInfo;
|
|
15
|
+
/** The matched session file */
|
|
16
|
+
session: SessionFile;
|
|
17
|
+
/** Absolute time delta in ms between process start and session birth time */
|
|
18
|
+
deltaMs: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Match processes to session files using 1:1 greedy assignment.
|
|
22
|
+
*
|
|
23
|
+
* Algorithm:
|
|
24
|
+
* 1. Exclude processes without startTime (they become process-only fallback).
|
|
25
|
+
* 2. Build candidate pairs where process.cwd === session.resolvedCwd
|
|
26
|
+
* and |process.startTime - session.birthtimeMs| <= 3 minutes.
|
|
27
|
+
* 3. Sort candidates by deltaMs ascending (best matches first).
|
|
28
|
+
* 4. Greedily assign: once a process or session is matched, skip it.
|
|
29
|
+
*
|
|
30
|
+
* Adapters must set session.resolvedCwd before calling this function.
|
|
31
|
+
*/
|
|
32
|
+
export declare function matchProcessesToSessions(processes: ProcessInfo[], sessions: SessionFile[]): MatchResult[];
|
|
33
|
+
/**
|
|
34
|
+
* Generate a deterministic agent name from CWD and PID.
|
|
35
|
+
*
|
|
36
|
+
* Format: "folderName (pid)"
|
|
37
|
+
*/
|
|
38
|
+
export declare function generateAgentName(cwd: string, pid: number): string;
|
|
39
|
+
//# sourceMappingURL=matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matching.d.ts","sourceRoot":"","sources":["../../src/utils/matching.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,0BAA0B;IAC1B,OAAO,EAAE,WAAW,CAAC;IAErB,+BAA+B;IAC/B,OAAO,EAAE,WAAW,CAAC;IAErB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,WAAW,EAAE,EACxB,QAAQ,EAAE,WAAW,EAAE,GACxB,WAAW,EAAE,CAsCf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGlE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Session Matching Utilities
|
|
4
|
+
*
|
|
5
|
+
* Shared 1:1 greedy matching algorithm that pairs running processes with session files
|
|
6
|
+
* based on CWD and birth-time proximity to process start time.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.matchProcessesToSessions = matchProcessesToSessions;
|
|
43
|
+
exports.generateAgentName = generateAgentName;
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
/** Maximum allowed delta between process start time and session file birth time. */
|
|
46
|
+
const TOLERANCE_MS = 3 * 60 * 1000; // 3 minutes
|
|
47
|
+
/**
|
|
48
|
+
* Match processes to session files using 1:1 greedy assignment.
|
|
49
|
+
*
|
|
50
|
+
* Algorithm:
|
|
51
|
+
* 1. Exclude processes without startTime (they become process-only fallback).
|
|
52
|
+
* 2. Build candidate pairs where process.cwd === session.resolvedCwd
|
|
53
|
+
* and |process.startTime - session.birthtimeMs| <= 3 minutes.
|
|
54
|
+
* 3. Sort candidates by deltaMs ascending (best matches first).
|
|
55
|
+
* 4. Greedily assign: once a process or session is matched, skip it.
|
|
56
|
+
*
|
|
57
|
+
* Adapters must set session.resolvedCwd before calling this function.
|
|
58
|
+
*/
|
|
59
|
+
function matchProcessesToSessions(processes, sessions) {
|
|
60
|
+
// Build all candidate pairs
|
|
61
|
+
const candidates = [];
|
|
62
|
+
for (const proc of processes) {
|
|
63
|
+
if (!proc.startTime || !proc.cwd)
|
|
64
|
+
continue;
|
|
65
|
+
const processStartMs = proc.startTime.getTime();
|
|
66
|
+
for (const session of sessions) {
|
|
67
|
+
if (!session.resolvedCwd)
|
|
68
|
+
continue;
|
|
69
|
+
if (proc.cwd !== session.resolvedCwd)
|
|
70
|
+
continue;
|
|
71
|
+
const deltaMs = Math.abs(processStartMs - session.birthtimeMs);
|
|
72
|
+
if (deltaMs > TOLERANCE_MS)
|
|
73
|
+
continue;
|
|
74
|
+
candidates.push({ process: proc, session, deltaMs });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Sort by smallest delta first
|
|
78
|
+
candidates.sort((a, b) => a.deltaMs - b.deltaMs);
|
|
79
|
+
// Greedy 1:1 assignment
|
|
80
|
+
const matchedPids = new Set();
|
|
81
|
+
const matchedSessionIds = new Set();
|
|
82
|
+
const results = [];
|
|
83
|
+
for (const candidate of candidates) {
|
|
84
|
+
if (matchedPids.has(candidate.process.pid))
|
|
85
|
+
continue;
|
|
86
|
+
if (matchedSessionIds.has(candidate.session.sessionId))
|
|
87
|
+
continue;
|
|
88
|
+
matchedPids.add(candidate.process.pid);
|
|
89
|
+
matchedSessionIds.add(candidate.session.sessionId);
|
|
90
|
+
results.push(candidate);
|
|
91
|
+
}
|
|
92
|
+
return results;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Generate a deterministic agent name from CWD and PID.
|
|
96
|
+
*
|
|
97
|
+
* Format: "folderName (pid)"
|
|
98
|
+
*/
|
|
99
|
+
function generateAgentName(cwd, pid) {
|
|
100
|
+
const folderName = path.basename(cwd) || 'unknown';
|
|
101
|
+
return `${folderName} (${pid})`;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=matching.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matching.js","sourceRoot":"","sources":["../../src/utils/matching.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCH,4DAyCC;AAOD,8CAGC;AApFD,2CAA6B;AAI7B,oFAAoF;AACpF,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAgBhD;;;;;;;;;;;GAWG;AACH,SAAgB,wBAAwB,CACpC,SAAwB,EACxB,QAAuB;IAEvB,4BAA4B;IAC5B,MAAM,UAAU,GAA2E,EAAE,CAAC;IAE9F,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI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AAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,GAAW,EAAE,GAAW;IACtD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IACnD,OAAO,GAAG,UAAU,KAAK,GAAG,GAAG,CAAC;AACpC,CAAC"}
|
package/dist/utils/process.d.ts
CHANGED
|
@@ -1,61 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Process Detection Utilities
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Shared shell command wrappers for detecting and inspecting running processes.
|
|
5
|
+
* All execSync calls for process data live here — adapters must not call execSync directly.
|
|
6
6
|
*/
|
|
7
7
|
import type { ProcessInfo } from '../adapters/AgentAdapter';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export interface ListProcessesOptions {
|
|
12
|
-
/** Filter processes by name pattern (case-insensitive) */
|
|
13
|
-
namePattern?: string;
|
|
14
|
-
/** Include only processes matching these PIDs */
|
|
15
|
-
pids?: number[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* List running processes on the system
|
|
9
|
+
* List running processes matching an agent executable name.
|
|
19
10
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
11
|
+
* Uses `ps aux | grep <pattern>` at shell level for performance, then post-filters
|
|
12
|
+
* by checking that the executable basename matches exactly (avoids matching
|
|
13
|
+
* `claude-helper`, `vscode-claude-extension`, or the grep process itself).
|
|
22
14
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* // List all Claude Code processes
|
|
26
|
-
* const processes = listProcesses({ namePattern: 'claude' });
|
|
27
|
-
*
|
|
28
|
-
* // Get specific process info
|
|
29
|
-
* const process = listProcesses({ pids: [12345] });
|
|
30
|
-
* ```
|
|
15
|
+
* Returned ProcessInfo has pid, command, tty populated.
|
|
16
|
+
* cwd and startTime are NOT populated — call enrichProcesses() to fill them.
|
|
31
17
|
*/
|
|
32
|
-
export declare function
|
|
18
|
+
export declare function listAgentProcesses(namePattern: string): ProcessInfo[];
|
|
33
19
|
/**
|
|
34
|
-
*
|
|
20
|
+
* Batch-get current working directories for multiple PIDs.
|
|
35
21
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
22
|
+
* Single `lsof -a -d cwd -Fn -p PID1,PID2,...` call.
|
|
23
|
+
* Returns partial results — if lsof fails for one PID, others still return.
|
|
38
24
|
*/
|
|
39
|
-
export declare function
|
|
25
|
+
export declare function batchGetProcessCwds(pids: number[]): Map<number, string>;
|
|
40
26
|
/**
|
|
41
|
-
*
|
|
27
|
+
* Batch-get process start times for multiple PIDs.
|
|
42
28
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
29
|
+
* Single `ps -o pid=,lstart= -p PID1,PID2,...` call.
|
|
30
|
+
* Uses lstart format which gives full timestamp (e.g., "Thu Feb 5 16:00:57 2026").
|
|
31
|
+
* Returns partial results.
|
|
45
32
|
*/
|
|
46
|
-
export declare function
|
|
33
|
+
export declare function batchGetProcessStartTimes(pids: number[]): Map<number, Date>;
|
|
47
34
|
/**
|
|
48
|
-
*
|
|
35
|
+
* Enrich ProcessInfo array with cwd and startTime.
|
|
49
36
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
37
|
+
* Calls batchGetProcessCwds and batchGetProcessStartTimes in batched shell calls,
|
|
38
|
+
* then populates each ProcessInfo in-place. Returns partial results —
|
|
39
|
+
* if a PID fails, that process keeps empty cwd / undefined startTime.
|
|
52
40
|
*/
|
|
53
|
-
export declare function
|
|
41
|
+
export declare function enrichProcesses(processes: ProcessInfo[]): ProcessInfo[];
|
|
54
42
|
/**
|
|
55
|
-
* Get
|
|
56
|
-
*
|
|
57
|
-
* @param pid Process ID
|
|
58
|
-
* @returns Process information, or null if process not found
|
|
43
|
+
* Get the TTY device for a specific process
|
|
59
44
|
*/
|
|
60
|
-
export declare function
|
|
45
|
+
export declare function getProcessTty(pid: number): string;
|
|
61
46
|
//# sourceMappingURL=process.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,EAAE,CAkDrE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAoCvE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAkC3E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAavE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWjD"}
|
package/dist/utils/process.js
CHANGED
|
@@ -2,165 +2,211 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Process Detection Utilities
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Shared shell command wrappers for detecting and inspecting running processes.
|
|
6
|
+
* All execSync calls for process data live here — adapters must not call execSync directly.
|
|
7
7
|
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
8
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
42
|
+
exports.listAgentProcesses = listAgentProcesses;
|
|
43
|
+
exports.batchGetProcessCwds = batchGetProcessCwds;
|
|
44
|
+
exports.batchGetProcessStartTimes = batchGetProcessStartTimes;
|
|
45
|
+
exports.enrichProcesses = enrichProcesses;
|
|
11
46
|
exports.getProcessTty = getProcessTty;
|
|
12
|
-
|
|
13
|
-
exports.getProcessInfo = getProcessInfo;
|
|
47
|
+
const path = __importStar(require("path"));
|
|
14
48
|
const child_process_1 = require("child_process");
|
|
15
49
|
/**
|
|
16
|
-
* List running processes
|
|
17
|
-
*
|
|
18
|
-
* @param options Filtering options
|
|
19
|
-
* @returns Array of process information
|
|
50
|
+
* List running processes matching an agent executable name.
|
|
20
51
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* const processes = listProcesses({ namePattern: 'claude' });
|
|
52
|
+
* Uses `ps aux | grep <pattern>` at shell level for performance, then post-filters
|
|
53
|
+
* by checking that the executable basename matches exactly (avoids matching
|
|
54
|
+
* `claude-helper`, `vscode-claude-extension`, or the grep process itself).
|
|
25
55
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* ```
|
|
56
|
+
* Returned ProcessInfo has pid, command, tty populated.
|
|
57
|
+
* cwd and startTime are NOT populated — call enrichProcesses() to fill them.
|
|
29
58
|
*/
|
|
30
|
-
function
|
|
59
|
+
function listAgentProcesses(namePattern) {
|
|
60
|
+
// Validate pattern contains only safe characters (alphanumeric, dash, underscore)
|
|
61
|
+
if (!namePattern || !/^[a-zA-Z0-9_-]+$/.test(namePattern)) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
31
64
|
try {
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const lines = psOutput.trim().split('\n');
|
|
36
|
-
// Skip header line
|
|
37
|
-
const processLines = lines.slice(1);
|
|
65
|
+
// Use [c]laude trick to avoid matching the grep process itself
|
|
66
|
+
const escapedPattern = `[${namePattern[0]}]${namePattern.slice(1)}`;
|
|
67
|
+
const output = (0, child_process_1.execSync)(`ps aux | grep -i '${escapedPattern}'`, { encoding: 'utf-8' });
|
|
38
68
|
const processes = [];
|
|
39
|
-
for (const line of
|
|
40
|
-
|
|
41
|
-
|
|
69
|
+
for (const line of output.trim().split('\n')) {
|
|
70
|
+
if (!line.trim())
|
|
71
|
+
continue;
|
|
42
72
|
const parts = line.trim().split(/\s+/);
|
|
43
73
|
if (parts.length < 11)
|
|
44
74
|
continue;
|
|
45
75
|
const pid = parseInt(parts[1], 10);
|
|
46
|
-
if (isNaN(pid))
|
|
76
|
+
if (Number.isNaN(pid))
|
|
47
77
|
continue;
|
|
48
78
|
const tty = parts[6];
|
|
49
79
|
const command = parts.slice(10).join(' ');
|
|
50
|
-
//
|
|
51
|
-
|
|
80
|
+
// Post-filter: check that the executable basename matches exactly
|
|
81
|
+
const executable = command.trim().split(/\s+/)[0] || '';
|
|
82
|
+
const base = path.basename(executable).toLowerCase();
|
|
83
|
+
if (base !== namePattern.toLowerCase() && base !== `${namePattern.toLowerCase()}.exe`) {
|
|
52
84
|
continue;
|
|
53
85
|
}
|
|
54
|
-
// Apply name pattern filter (case-insensitive)
|
|
55
|
-
if (options.namePattern) {
|
|
56
|
-
const pattern = options.namePattern.toLowerCase();
|
|
57
|
-
const commandLower = command.toLowerCase();
|
|
58
|
-
if (!commandLower.includes(pattern)) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Get working directory for this process
|
|
63
|
-
const cwd = getProcessCwd(pid);
|
|
64
|
-
// Get TTY in short format (remove /dev/ prefix if present)
|
|
65
86
|
const ttyShort = tty.startsWith('/dev/') ? tty.slice(5) : tty;
|
|
66
87
|
processes.push({
|
|
67
88
|
pid,
|
|
68
89
|
command,
|
|
69
|
-
cwd,
|
|
90
|
+
cwd: '',
|
|
70
91
|
tty: ttyShort,
|
|
71
92
|
});
|
|
72
93
|
}
|
|
73
94
|
return processes;
|
|
74
95
|
}
|
|
75
|
-
catch
|
|
76
|
-
// If ps command fails, return empty array
|
|
77
|
-
console.error('Failed to list processes:', error);
|
|
96
|
+
catch {
|
|
78
97
|
return [];
|
|
79
98
|
}
|
|
80
99
|
}
|
|
81
100
|
/**
|
|
82
|
-
*
|
|
101
|
+
* Batch-get current working directories for multiple PIDs.
|
|
83
102
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
103
|
+
* Single `lsof -a -d cwd -Fn -p PID1,PID2,...` call.
|
|
104
|
+
* Returns partial results — if lsof fails for one PID, others still return.
|
|
86
105
|
*/
|
|
87
|
-
function
|
|
106
|
+
function batchGetProcessCwds(pids) {
|
|
107
|
+
const result = new Map();
|
|
108
|
+
if (pids.length === 0)
|
|
109
|
+
return result;
|
|
88
110
|
try {
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return line.slice(1); // Remove 'n' prefix
|
|
111
|
+
const output = (0, child_process_1.execSync)(`lsof -a -d cwd -Fn -p ${pids.join(',')} 2>/dev/null`, { encoding: 'utf-8' });
|
|
112
|
+
// lsof output format: p{PID}\nn{path}\np{PID}\nn{path}...
|
|
113
|
+
let currentPid = null;
|
|
114
|
+
for (const line of output.trim().split('\n')) {
|
|
115
|
+
if (line.startsWith('p')) {
|
|
116
|
+
currentPid = parseInt(line.slice(1), 10);
|
|
117
|
+
}
|
|
118
|
+
else if (line.startsWith('n') && currentPid !== null) {
|
|
119
|
+
result.set(currentPid, line.slice(1));
|
|
120
|
+
currentPid = null;
|
|
100
121
|
}
|
|
101
122
|
}
|
|
102
|
-
return '';
|
|
103
123
|
}
|
|
104
|
-
catch
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
encoding: 'utf-8'
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
catch {
|
|
125
|
+
// Try per-PID fallback with pwdx (Linux)
|
|
126
|
+
for (const pid of pids) {
|
|
127
|
+
try {
|
|
128
|
+
const output = (0, child_process_1.execSync)(`pwdx ${pid} 2>/dev/null`, { encoding: 'utf-8' });
|
|
129
|
+
const match = output.match(/^\d+:\s*(.+)$/);
|
|
130
|
+
if (match) {
|
|
131
|
+
result.set(pid, match[1].trim());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// Skip this PID
|
|
136
|
+
}
|
|
117
137
|
}
|
|
118
138
|
}
|
|
139
|
+
return result;
|
|
119
140
|
}
|
|
120
141
|
/**
|
|
121
|
-
*
|
|
142
|
+
* Batch-get process start times for multiple PIDs.
|
|
122
143
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
144
|
+
* Single `ps -o pid=,lstart= -p PID1,PID2,...` call.
|
|
145
|
+
* Uses lstart format which gives full timestamp (e.g., "Thu Feb 5 16:00:57 2026").
|
|
146
|
+
* Returns partial results.
|
|
125
147
|
*/
|
|
126
|
-
function
|
|
148
|
+
function batchGetProcessStartTimes(pids) {
|
|
149
|
+
const result = new Map();
|
|
150
|
+
if (pids.length === 0)
|
|
151
|
+
return result;
|
|
127
152
|
try {
|
|
128
|
-
const output = (0, child_process_1.execSync)(`ps -p ${
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
153
|
+
const output = (0, child_process_1.execSync)(`ps -o pid=,lstart= -p ${pids.join(',')}`, { encoding: 'utf-8' });
|
|
154
|
+
for (const rawLine of output.split('\n')) {
|
|
155
|
+
const line = rawLine.trim();
|
|
156
|
+
if (!line)
|
|
157
|
+
continue;
|
|
158
|
+
// Format: " PID DAY MON DD HH:MM:SS YYYY"
|
|
159
|
+
// e.g., " 78070 Wed Mar 18 23:18:01 2026"
|
|
160
|
+
const match = line.match(/^\s*(\d+)\s+(.+)$/);
|
|
161
|
+
if (!match)
|
|
162
|
+
continue;
|
|
163
|
+
const pid = parseInt(match[1], 10);
|
|
164
|
+
const dateStr = match[2].trim();
|
|
165
|
+
if (!Number.isFinite(pid))
|
|
166
|
+
continue;
|
|
167
|
+
const date = new Date(dateStr);
|
|
168
|
+
if (!Number.isNaN(date.getTime())) {
|
|
169
|
+
result.set(pid, date);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
134
172
|
}
|
|
135
|
-
catch
|
|
136
|
-
|
|
173
|
+
catch {
|
|
174
|
+
// Return whatever we have
|
|
137
175
|
}
|
|
176
|
+
return result;
|
|
138
177
|
}
|
|
139
178
|
/**
|
|
140
|
-
*
|
|
179
|
+
* Enrich ProcessInfo array with cwd and startTime.
|
|
141
180
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
181
|
+
* Calls batchGetProcessCwds and batchGetProcessStartTimes in batched shell calls,
|
|
182
|
+
* then populates each ProcessInfo in-place. Returns partial results —
|
|
183
|
+
* if a PID fails, that process keeps empty cwd / undefined startTime.
|
|
144
184
|
*/
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
185
|
+
function enrichProcesses(processes) {
|
|
186
|
+
if (processes.length === 0)
|
|
187
|
+
return processes;
|
|
188
|
+
const pids = processes.map(p => p.pid);
|
|
189
|
+
const cwdMap = batchGetProcessCwds(pids);
|
|
190
|
+
const startTimeMap = batchGetProcessStartTimes(pids);
|
|
191
|
+
for (const proc of processes) {
|
|
192
|
+
proc.cwd = cwdMap.get(proc.pid) || '';
|
|
193
|
+
proc.startTime = startTimeMap.get(proc.pid);
|
|
154
194
|
}
|
|
195
|
+
return processes;
|
|
155
196
|
}
|
|
156
197
|
/**
|
|
157
|
-
* Get
|
|
158
|
-
*
|
|
159
|
-
* @param pid Process ID
|
|
160
|
-
* @returns Process information, or null if process not found
|
|
198
|
+
* Get the TTY device for a specific process
|
|
161
199
|
*/
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
|
|
200
|
+
function getProcessTty(pid) {
|
|
201
|
+
try {
|
|
202
|
+
const output = (0, child_process_1.execSync)(`ps -p ${pid} -o tty=`, {
|
|
203
|
+
encoding: 'utf-8',
|
|
204
|
+
});
|
|
205
|
+
const tty = output.trim();
|
|
206
|
+
return tty.startsWith('/dev/') ? tty.slice(5) : tty;
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return '?';
|
|
210
|
+
}
|
|
165
211
|
}
|
|
166
212
|
//# sourceMappingURL=process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,gDAkDC;AAQD,kDAoCC;AASD,8DAkCC;AASD,0CAaC;AAKD,sCAWC;AA7LD,2CAA6B;AAC7B,iDAAyC;AAGzC;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAAC,WAAmB;IAClD,kFAAkF;IAClF,IAAI,CAAC,WAAW,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACxD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACD,+DAA+D;QAC/D,MAAM,cAAc,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAEpE,MAAM,MAAM,GAAG,IAAA,wBAAQ,EACnB,qBAAqB,cAAc,GAAG,EACtC,EAAE,QAAQ,EAAE,OAAO,EAAE,CACxB,CAAC;QAEF,MAAM,SAAS,GAAkB,EAAE,CAAC;QAEpC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBAAE,SAAS;YAE3B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACvC,IA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