mecord-connect 2.0.0 → 2.0.1
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/package.json
CHANGED
|
@@ -287,7 +287,7 @@ export class ProcessProvider {
|
|
|
287
287
|
const limit = boundedInteger(action.input.limit, 200, 1, MAX_PROCESS_INSPECT_RESULTS);
|
|
288
288
|
const nameFilter = typeof action.input.name === 'string' ? action.input.name.trim().toLowerCase() : '';
|
|
289
289
|
const pidFilter = action.input.pid === undefined ? undefined : boundedInteger(action.input.pid, 0, 1, 0x7fff_ffff);
|
|
290
|
-
const rows = await runTasklist(signal);
|
|
290
|
+
const rows = await runTasklist(signal, pidFilter);
|
|
291
291
|
const processes = rows
|
|
292
292
|
.filter((row) => (pidFilter === undefined || row.pid === pidFilter) && (!nameFilter || row.imageName.toLowerCase().includes(nameFilter)))
|
|
293
293
|
.slice(0, limit);
|
|
@@ -311,14 +311,14 @@ export class ProcessProvider {
|
|
|
311
311
|
if (!/^[0-9a-f]{64}$/.test(expectedFingerprint)) return failure(action, this.name, started, 'PROCESS_PRECONDITION_REQUIRED', 'process.manage terminate requires expectedFingerprint from a fresh process.inspect.');
|
|
312
312
|
if (pid === process.pid || pid <= 4) return failure(action, this.name, started, 'PROCESS_TERMINATE_DENIED', 'Refusing to terminate the Operator process or reserved system PIDs.');
|
|
313
313
|
try {
|
|
314
|
-
const processes = await runTasklist(signal);
|
|
314
|
+
const processes = await runTasklist(signal, pid);
|
|
315
315
|
const target = processes.find((entry) => entry.pid === pid);
|
|
316
316
|
if (!target) return failure(action, this.name, started, 'PROCESS_NOT_FOUND', 'Process no longer exists.');
|
|
317
317
|
if (target.fingerprint !== expectedFingerprint) return failure(action, this.name, started, 'PROCESS_PRECONDITION_FAILED', 'Process identity changed since inspection.');
|
|
318
318
|
if (!sameWindowsUser(target.userName, os.userInfo().username)) return failure(action, this.name, started, 'PROCESS_TERMINATE_DENIED', 'Refusing to terminate a process owned by another Windows account.');
|
|
319
319
|
if (CRITICAL_WINDOWS_PROCESSES.has(target.imageName.toLowerCase())) return failure(action, this.name, started, 'PROCESS_TERMINATE_DENIED', 'Refusing to terminate a critical Windows process.');
|
|
320
320
|
await runTaskkill(pid, signal);
|
|
321
|
-
const remaining = (await runTasklist(signal)).some((entry) => entry.pid === pid && entry.fingerprint === expectedFingerprint);
|
|
321
|
+
const remaining = (await runTasklist(signal, pid)).some((entry) => entry.pid === pid && entry.fingerprint === expectedFingerprint);
|
|
322
322
|
if (remaining) throw new OperatorError('PROCESS_TERMINATE_POSTCONDITION_FAILED', 'Target process remained after taskkill completed.');
|
|
323
323
|
return {
|
|
324
324
|
ok: true, capability: action.capability, provider: this.name,
|
|
@@ -556,10 +556,12 @@ const CRITICAL_WINDOWS_PROCESSES = new Set([
|
|
|
556
556
|
|
|
557
557
|
|
|
558
558
|
|
|
559
|
-
async function runTasklist(signal ) {
|
|
559
|
+
async function runTasklist(signal , pidFilter ) {
|
|
560
560
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR || 'C:\\Windows';
|
|
561
561
|
const executable = path.join(systemRoot, 'System32', 'tasklist.exe');
|
|
562
|
-
const
|
|
562
|
+
const args = ['/V', '/FO', 'CSV', '/NH'];
|
|
563
|
+
if (pidFilter !== undefined) args.push('/FI', `PID eq ${pidFilter}`);
|
|
564
|
+
const output = await runProcess(executable, args, process.cwd(), 15_000, 8 * 1024 * 1024, {}, signal);
|
|
563
565
|
if (output.exitCode !== 0) throw new OperatorError('PROCESS_INSPECT_FAILED', `tasklist exited with ${String(output.exitCode)}.`);
|
|
564
566
|
const rows = [];
|
|
565
567
|
for (const line of output.stdout.split(/\r?\n/).filter(Boolean)) {
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "mecord-connect",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"platform": "win32",
|
|
6
6
|
"arch": "x64",
|
|
7
|
-
"sourceCommit": "
|
|
7
|
+
"sourceCommit": "b73d699f3cdca4d6e372942f626012fb4909068b",
|
|
8
8
|
"files": [
|
|
9
9
|
{
|
|
10
10
|
"path": "app/apps/local-agent/src/approval-store.js",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"path": "app/src/capabilities/process.js",
|
|
166
|
-
"sizeBytes":
|
|
167
|
-
"sha256": "
|
|
166
|
+
"sizeBytes": 31734,
|
|
167
|
+
"sha256": "00aa20f525eff32395f2689a3a60c6563532a2aa51a27af4aa47d949633ef67c"
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"path": "app/src/capabilities/project-command.js",
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
{
|
|
550
550
|
"path": "native/operator-windows-dpapi.exe",
|
|
551
551
|
"sizeBytes": 146944,
|
|
552
|
-
"sha256": "
|
|
552
|
+
"sha256": "0c865f88f0b489d74108d13ef22df9438d0099d54ca908ee74f9797942216bfd"
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
"path": "native/operator-windows-path-lease.exe",
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
{
|
|
560
560
|
"path": "native/operator-windows-uia.exe",
|
|
561
561
|
"sizeBytes": 487936,
|
|
562
|
-
"sha256": "
|
|
562
|
+
"sha256": "bdd3e41358ae7f752b700bc6202a5041781b3207f5c8728046ab668e919c8ebd"
|
|
563
563
|
}
|
|
564
564
|
]
|
|
565
565
|
}
|