@google/gemini-cli-core 0.3.1 → 0.3.2
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/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/ide/process-utils.d.ts +0 -1
- package/dist/src/ide/process-utils.js +36 -31
- package/dist/src/ide/process-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
export declare const GIT_COMMIT_INFO = "
|
|
7
|
-
export declare const CLI_VERSION = "0.3.
|
|
6
|
+
export declare const GIT_COMMIT_INFO = "ad3bc17e";
|
|
7
|
+
export declare const CLI_VERSION = "0.3.2";
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// This file is auto-generated by the build script (scripts/generate-git-commit-info.js)
|
|
7
7
|
// Do not edit this file manually.
|
|
8
|
-
export const GIT_COMMIT_INFO = '
|
|
9
|
-
export const CLI_VERSION = '0.3.
|
|
8
|
+
export const GIT_COMMIT_INFO = 'ad3bc17e';
|
|
9
|
+
export const CLI_VERSION = '0.3.2';
|
|
10
10
|
//# sourceMappingURL=git-commit.js.map
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* top-level ancestor process ID and command as a fallback.
|
|
15
15
|
*
|
|
16
16
|
* @returns A promise that resolves to the PID and command of the IDE process.
|
|
17
|
-
* @throws Will throw an error if the underlying shell commands fail.
|
|
18
17
|
*/
|
|
19
18
|
export declare function getIdeProcessInfo(): Promise<{
|
|
20
19
|
pid: number;
|
|
@@ -16,37 +16,43 @@ const MAX_TRAVERSAL_DEPTH = 32;
|
|
|
16
16
|
* @returns A promise that resolves to the parent's PID, name, and command.
|
|
17
17
|
*/
|
|
18
18
|
async function getProcessInfo(pid) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
try {
|
|
20
|
+
const platform = os.platform();
|
|
21
|
+
if (platform === 'win32') {
|
|
22
|
+
const powershellCommand = [
|
|
23
|
+
'$p = Get-CimInstance Win32_Process',
|
|
24
|
+
`-Filter 'ProcessId=${pid}'`,
|
|
25
|
+
'-ErrorAction SilentlyContinue;',
|
|
26
|
+
'if ($p) {',
|
|
27
|
+
'@{Name=$p.Name;ParentProcessId=$p.ParentProcessId;CommandLine=$p.CommandLine}',
|
|
28
|
+
'| ConvertTo-Json',
|
|
29
|
+
'}',
|
|
30
|
+
].join(' ');
|
|
31
|
+
const { stdout } = await execAsync(`powershell "${powershellCommand}"`);
|
|
32
|
+
const output = stdout.trim();
|
|
33
|
+
if (!output)
|
|
34
|
+
return { parentPid: 0, name: '', command: '' };
|
|
35
|
+
const { Name = '', ParentProcessId = 0, CommandLine = '', } = JSON.parse(output);
|
|
36
|
+
return { parentPid: ParentProcessId, name: Name, command: CommandLine };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const command = `ps -o ppid=,command= -p ${pid}`;
|
|
40
|
+
const { stdout } = await execAsync(command);
|
|
41
|
+
const trimmedStdout = stdout.trim();
|
|
42
|
+
const ppidString = trimmedStdout.split(/\s+/)[0];
|
|
43
|
+
const parentPid = parseInt(ppidString, 10);
|
|
44
|
+
const fullCommand = trimmedStdout.substring(ppidString.length).trim();
|
|
45
|
+
const processName = path.basename(fullCommand.split(' ')[0]);
|
|
46
|
+
return {
|
|
47
|
+
parentPid: isNaN(parentPid) ? 1 : parentPid,
|
|
48
|
+
name: processName,
|
|
49
|
+
command: fullCommand,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
36
52
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const trimmedStdout = stdout.trim();
|
|
41
|
-
const ppidString = trimmedStdout.split(/\s+/)[0];
|
|
42
|
-
const parentPid = parseInt(ppidString, 10);
|
|
43
|
-
const fullCommand = trimmedStdout.substring(ppidString.length).trim();
|
|
44
|
-
const processName = path.basename(fullCommand.split(' ')[0]);
|
|
45
|
-
return {
|
|
46
|
-
parentPid: isNaN(parentPid) ? 1 : parentPid,
|
|
47
|
-
name: processName,
|
|
48
|
-
command: fullCommand,
|
|
49
|
-
};
|
|
53
|
+
catch (_e) {
|
|
54
|
+
console.debug(`Failed to get process info for pid ${pid}:`, _e);
|
|
55
|
+
return { parentPid: 0, name: '', command: '' };
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
@@ -147,7 +153,6 @@ async function getIdeProcessInfoForWindows() {
|
|
|
147
153
|
* top-level ancestor process ID and command as a fallback.
|
|
148
154
|
*
|
|
149
155
|
* @returns A promise that resolves to the PID and command of the IDE process.
|
|
150
|
-
* @throws Will throw an error if the underlying shell commands fail.
|
|
151
156
|
*/
|
|
152
157
|
export async function getIdeProcessInfo() {
|
|
153
158
|
const platform = os.platform();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-utils.js","sourceRoot":"","sources":["../../../src/ide/process-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,KAAK,UAAU,cAAc,CAAC,GAAW;IAKvC,MAAM,QA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