happy-imou-cloud 2.1.34 → 2.1.35

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.
Files changed (25) hide show
  1. package/dist/{BaseReasoningProcessor-CxLnyixP.mjs → BaseReasoningProcessor-DbYQw-IT.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-kN8gq-t4.cjs → BaseReasoningProcessor-vn-Cvazk.cjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-oEEvSQ0O.cjs → ProviderSelectionHandler-CHXCKI8q.cjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-DuJGNviz.mjs → ProviderSelectionHandler-Dk4HaiPR.mjs} +2 -2
  5. package/dist/{api-B3Zl8oHG.mjs → api-C_wLDBlG.mjs} +1 -1
  6. package/dist/{api-C94O6IB2.cjs → api-CeZTggZF.cjs} +1 -1
  7. package/dist/{command-CMZlS6zf.mjs → command-Dth-tCSc.mjs} +2 -2
  8. package/dist/{command-96cX402J.cjs → command-djmqu0my.cjs} +2 -2
  9. package/dist/{index-D4TuE2VS.cjs → index-CckDTAoL.cjs} +43 -27
  10. package/dist/{index-sqm5plVs.mjs → index-l0zi9G9M.mjs} +40 -24
  11. package/dist/index.cjs +2 -2
  12. package/dist/index.mjs +2 -2
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +116 -116
  15. package/dist/lib.d.mts +116 -116
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-Dmm6gsoz.mjs → registerKillSessionHandler-BxbrcRl3.mjs} +2 -2
  18. package/dist/{registerKillSessionHandler-7bLVg5RG.cjs → registerKillSessionHandler-CMyw8PFY.cjs} +2 -2
  19. package/dist/{runClaude-BrvxWJ9-.mjs → runClaude-BK-xZzSe.mjs} +4 -4
  20. package/dist/{runClaude-Dn1JJ8m9.cjs → runClaude-CniBKZZh.cjs} +4 -4
  21. package/dist/{runCodex-DfYO-7YG.mjs → runCodex-C4X1beyB.mjs} +5 -5
  22. package/dist/{runCodex-Dc2Rqb8W.cjs → runCodex-Dl1BeoP7.cjs} +5 -5
  23. package/dist/{runGemini-C1_AOBlU.mjs → runGemini-Bigzf0Vw.mjs} +4 -4
  24. package/dist/{runGemini-DQyuAba-.cjs → runGemini-Bw9Z5tD5.cjs} +4 -4
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-sqm5plVs.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-B3Zl8oHG.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-l0zi9G9M.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-C_wLDBlG.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { randomUUID } from 'node:crypto';
5
5
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D4TuE2VS.cjs');
4
- var persistence = require('./api-C94O6IB2.cjs');
3
+ var index = require('./index-CckDTAoL.cjs');
4
+ var persistence = require('./api-CeZTggZF.cjs');
5
5
  var node_events = require('node:events');
6
6
  var node_crypto = require('node:crypto');
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./api-C94O6IB2.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-7bLVg5RG.cjs');
3
+ var persistence = require('./api-CeZTggZF.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-CMyw8PFY.cjs');
5
5
 
6
6
  async function runModeLoop(opts) {
7
7
  let currentMode = opts.startingMode;
@@ -1,5 +1,5 @@
1
- import { l as logger } from './api-B3Zl8oHG.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-Dmm6gsoz.mjs';
1
+ import { l as logger } from './api-C_wLDBlG.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BxbrcRl3.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -18,7 +18,7 @@ import { spawn } from 'node:child_process';
18
18
  import { Expo } from 'expo-server-sdk';
19
19
 
20
20
  var name = "happy-imou-cloud";
21
- var version = "2.1.34";
21
+ var version = "2.1.35";
22
22
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
23
23
  var author = "long.zhu";
24
24
  var license = "MIT";
@@ -38,7 +38,7 @@ function _interopNamespaceDefault(e) {
38
38
  var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
39
39
 
40
40
  var name = "happy-imou-cloud";
41
- var version = "2.1.34";
41
+ var version = "2.1.35";
42
42
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
43
43
  var author = "long.zhu";
44
44
  var license = "MIT";
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-sqm5plVs.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-l0zi9G9M.mjs';
2
2
  import 'chalk';
3
- import './api-B3Zl8oHG.mjs';
3
+ import './api-C_wLDBlG.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D4TuE2VS.cjs');
3
+ var index = require('./index-CckDTAoL.cjs');
4
4
  require('chalk');
5
- require('./api-C94O6IB2.cjs');
5
+ require('./api-CeZTggZF.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var persistence = require('./api-C94O6IB2.cjs');
4
+ var persistence = require('./api-CeZTggZF.cjs');
5
5
  var z = require('zod');
6
6
  var fs$2 = require('fs/promises');
7
7
  var os$1 = require('os');
@@ -72,7 +72,7 @@ async function openBrowser(url) {
72
72
  }
73
73
  }
74
74
 
75
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D4TuE2VS.cjs', document.baseURI).href)));
75
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CckDTAoL.cjs', document.baseURI).href)));
76
76
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
77
77
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
78
78
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -637,7 +637,7 @@ function setupCleanupHandlers() {
637
637
  });
638
638
  }
639
639
 
640
- const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D4TuE2VS.cjs', document.baseURI).href))));
640
+ const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CckDTAoL.cjs', document.baseURI).href))));
641
641
  function projectPath() {
642
642
  const path = path$1.resolve(__dirname$2, "..");
643
643
  return path;
@@ -697,6 +697,18 @@ function classifyHappyProcess(proc) {
697
697
  }
698
698
  return { pid: proc.pid, command: cmd || name, type };
699
699
  }
700
+ function collectProtectedProcessIds(processes, currentPid, fallbackParentPid) {
701
+ const pidToProcess = new Map(processes.map((proc) => [proc.pid, proc]));
702
+ const protectedPids = /* @__PURE__ */ new Set([currentPid]);
703
+ const visited = /* @__PURE__ */ new Set();
704
+ let parentPid = pidToProcess.get(currentPid)?.ppid ?? fallbackParentPid;
705
+ while (Number.isInteger(parentPid) && parentPid > 0 && !visited.has(parentPid)) {
706
+ protectedPids.add(parentPid);
707
+ visited.add(parentPid);
708
+ parentPid = pidToProcess.get(parentPid)?.ppid ?? 0;
709
+ }
710
+ return protectedPids;
711
+ }
700
712
  function parseWindowsProcessSnapshots(rawOutput) {
701
713
  if (!rawOutput) {
702
714
  return [];
@@ -710,6 +722,7 @@ function parseWindowsProcessSnapshots(rawOutput) {
710
722
  const rows = Array.isArray(parsed) ? parsed : [parsed];
711
723
  return rows.filter((row) => typeof row?.ProcessId === "number" && typeof row?.Name === "string").map((row) => ({
712
724
  pid: row.ProcessId,
725
+ ppid: typeof row.ParentProcessId === "number" ? row.ParentProcessId : 0,
713
726
  name: row.Name,
714
727
  cmd: typeof row.CommandLine === "string" ? row.CommandLine : ""
715
728
  }));
@@ -738,7 +751,7 @@ function runWindowsProcessSnapshotQuery(command) {
738
751
  }
739
752
  function getWindowsProcessSnapshots() {
740
753
  return runWindowsProcessSnapshotQuery(
741
- "Get-CimInstance Win32_Process | Select-Object ProcessId, Name, CommandLine | ConvertTo-Json -Compress"
754
+ "Get-CimInstance Win32_Process | Select-Object ProcessId, ParentProcessId, Name, CommandLine | ConvertTo-Json -Compress"
742
755
  );
743
756
  }
744
757
  function getWindowsProcessSnapshotByPid(pid) {
@@ -746,7 +759,7 @@ function getWindowsProcessSnapshotByPid(pid) {
746
759
  return null;
747
760
  }
748
761
  const [proc] = runWindowsProcessSnapshotQuery(
749
- `Get-CimInstance Win32_Process -Filter "ProcessId = ${pid}" | Select-Object ProcessId, Name, CommandLine | ConvertTo-Json -Compress`
762
+ `Get-CimInstance Win32_Process -Filter "ProcessId = ${pid}" | Select-Object ProcessId, ParentProcessId, Name, CommandLine | ConvertTo-Json -Compress`
750
763
  );
751
764
  return proc ?? null;
752
765
  }
@@ -782,10 +795,20 @@ function findWindowsHappyProcesses(processes) {
782
795
  function toProcessSnapshot(proc) {
783
796
  return {
784
797
  pid: proc.pid,
798
+ ppid: "ppid" in proc && typeof proc.ppid === "number" ? proc.ppid : 0,
785
799
  name: proc.name || "",
786
800
  cmd: proc.cmd || ""
787
801
  };
788
802
  }
803
+ async function listProcessSnapshots() {
804
+ if (process.platform === "win32") {
805
+ const windowsProcesses = getWindowsProcessSnapshots();
806
+ if (windowsProcesses.length > 0) {
807
+ return windowsProcesses;
808
+ }
809
+ }
810
+ return (await psList()).map(toProcessSnapshot);
811
+ }
789
812
  async function findHappyProcessByPid(pid) {
790
813
  try {
791
814
  if (process.platform === "win32") {
@@ -819,22 +842,13 @@ async function findHappyProcessByPid(pid) {
819
842
  }
820
843
  async function findAllHappyProcesses() {
821
844
  try {
845
+ const processSnapshots = await listProcessSnapshots();
822
846
  if (process.platform === "win32") {
823
- const windowsProcesses = getWindowsProcessSnapshots();
824
- if (windowsProcesses.length > 0) {
825
- return findWindowsHappyProcesses(windowsProcesses);
826
- }
827
- const fallbackProcesses = (await psList()).map(toProcessSnapshot);
828
- return findWindowsHappyProcesses(fallbackProcesses);
847
+ return findWindowsHappyProcesses(processSnapshots);
829
848
  }
830
- const processes = await psList();
831
849
  const allProcesses = [];
832
- for (const proc of processes) {
833
- const match = classifyHappyProcess({
834
- pid: proc.pid,
835
- name: proc.name || "",
836
- cmd: proc.cmd || ""
837
- });
850
+ for (const proc of processSnapshots) {
851
+ const match = classifyHappyProcess(proc);
838
852
  if (match) {
839
853
  allProcesses.push(match);
840
854
  }
@@ -845,9 +859,11 @@ async function findAllHappyProcesses() {
845
859
  }
846
860
  }
847
861
  async function findRunawayHappyProcesses() {
848
- const allProcesses = await findAllHappyProcesses();
862
+ const processSnapshots = await listProcessSnapshots();
863
+ const protectedPids = collectProtectedProcessIds(processSnapshots, process.pid, process.ppid);
864
+ const allProcesses = process.platform === "win32" ? findWindowsHappyProcesses(processSnapshots) : processSnapshots.map(classifyHappyProcess).filter((proc) => proc !== null);
849
865
  return allProcesses.filter(
850
- (p) => p.pid !== process.pid && (p.type === "daemon" || p.type === "dev-daemon" || p.type === "daemon-spawned-session" || p.type === "dev-daemon-spawned" || p.type === "daemon-version-check" || p.type === "dev-daemon-version-check")
866
+ (p) => !protectedPids.has(p.pid) && (p.type === "daemon" || p.type === "dev-daemon" || p.type === "daemon-spawned-session" || p.type === "dev-daemon-spawned" || p.type === "daemon-version-check" || p.type === "dev-daemon-version-check")
851
867
  ).map((p) => ({ pid: p.pid, command: p.command }));
852
868
  }
853
869
  async function killRunawayHappyProcesses() {
@@ -10353,7 +10369,7 @@ class AbortError extends Error {
10353
10369
  }
10354
10370
  }
10355
10371
 
10356
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D4TuE2VS.cjs', document.baseURI).href)));
10372
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CckDTAoL.cjs', document.baseURI).href)));
10357
10373
  const __dirname$1 = path.join(__filename$1, "..");
10358
10374
  function getGlobalClaudeVersion() {
10359
10375
  try {
@@ -11676,14 +11692,14 @@ var launch = /*#__PURE__*/Object.freeze({
11676
11692
  const unifiedProviderExecutors = {
11677
11693
  claude: async (opts) => {
11678
11694
  const claudeOptions = opts.claudeOptions ?? {};
11679
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-Dn1JJ8m9.cjs'); });
11695
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-CniBKZZh.cjs'); });
11680
11696
  await runClaude(opts.credentials, {
11681
11697
  ...claudeOptions,
11682
11698
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
11683
11699
  });
11684
11700
  },
11685
11701
  codex: async (opts) => {
11686
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Dc2Rqb8W.cjs'); });
11702
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Dl1BeoP7.cjs'); });
11687
11703
  await runCodex({
11688
11704
  credentials: opts.credentials,
11689
11705
  startedBy: opts.startedBy,
@@ -11692,7 +11708,7 @@ const unifiedProviderExecutors = {
11692
11708
  });
11693
11709
  },
11694
11710
  gemini: async (opts) => {
11695
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-DQyuAba-.cjs'); });
11711
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Bw9Z5tD5.cjs'); });
11696
11712
  await runGemini({
11697
11713
  credentials: opts.credentials,
11698
11714
  startedBy: opts.startedBy
@@ -11775,7 +11791,7 @@ function shouldRunMainClaudeFlow(opts) {
11775
11791
  return;
11776
11792
  } else if (subcommand === "runtime") {
11777
11793
  if (args[1] === "providers") {
11778
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-96cX402J.cjs'); });
11794
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-djmqu0my.cjs'); });
11779
11795
  console.log(renderRuntimeProviders());
11780
11796
  return;
11781
11797
  }
@@ -11981,8 +11997,8 @@ function shouldRunMainClaudeFlow(opts) {
11981
11997
  const projectId = args[3];
11982
11998
  try {
11983
11999
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11984
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-C94O6IB2.cjs'); }).then(function (n) { return n.persistence; });
11985
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-C94O6IB2.cjs'); }).then(function (n) { return n.api; });
12000
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-CeZTggZF.cjs'); }).then(function (n) { return n.persistence; });
12001
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-CeZTggZF.cjs'); }).then(function (n) { return n.api; });
11986
12002
  let userEmail = void 0;
11987
12003
  try {
11988
12004
  const credentials = await readCredentials2();
@@ -1,5 +1,5 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
- import { l as logger, m as encodeBase64, c as configuration, n as readCredentials, o as ensureSigningCredentials, r as readSettings, u as updateSettings, q as encodeBase64Url, j as delay, t as buildClientHeaders, v as decodeBase64, w as writeCredentialsLegacy, x as writeCredentialsDataKey, y as readDaemonState, z as HAPPY_CLOUD_DAEMON_PORT, B as clearDaemonState, C as packageJson, i as isAuthenticationRequiredError, D as acquireDaemonLock, E as writeDaemonState, A as ApiClient, F as releaseDaemonLock, G as validateProfileForAgent, I as getProfileEnvironmentVariables, J as clearCredentials, K as clearMachineId, L as readHappyOrgDispatchTruthSnapshot, M as processHappyOrgRepoRequests, N as HappyOrgTurnReportSchema, O as recordHappyOrgTurnReport, P as MessageContentSchema, Q as buildSocketAuth, R as encrypt, H as HeadTailPreviewBuffer, S as getLatestDaemonLog } from './api-B3Zl8oHG.mjs';
2
+ import { l as logger, m as encodeBase64, c as configuration, n as readCredentials, o as ensureSigningCredentials, r as readSettings, u as updateSettings, q as encodeBase64Url, j as delay, t as buildClientHeaders, v as decodeBase64, w as writeCredentialsLegacy, x as writeCredentialsDataKey, y as readDaemonState, z as HAPPY_CLOUD_DAEMON_PORT, B as clearDaemonState, C as packageJson, i as isAuthenticationRequiredError, D as acquireDaemonLock, E as writeDaemonState, A as ApiClient, F as releaseDaemonLock, G as validateProfileForAgent, I as getProfileEnvironmentVariables, J as clearCredentials, K as clearMachineId, L as readHappyOrgDispatchTruthSnapshot, M as processHappyOrgRepoRequests, N as HappyOrgTurnReportSchema, O as recordHappyOrgTurnReport, P as MessageContentSchema, Q as buildSocketAuth, R as encrypt, H as HeadTailPreviewBuffer, S as getLatestDaemonLog } from './api-C_wLDBlG.mjs';
3
3
  import { z } from 'zod';
4
4
  import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
5
5
  import os$1, { homedir } from 'os';
@@ -675,6 +675,18 @@ function classifyHappyProcess(proc) {
675
675
  }
676
676
  return { pid: proc.pid, command: cmd || name, type };
677
677
  }
678
+ function collectProtectedProcessIds(processes, currentPid, fallbackParentPid) {
679
+ const pidToProcess = new Map(processes.map((proc) => [proc.pid, proc]));
680
+ const protectedPids = /* @__PURE__ */ new Set([currentPid]);
681
+ const visited = /* @__PURE__ */ new Set();
682
+ let parentPid = pidToProcess.get(currentPid)?.ppid ?? fallbackParentPid;
683
+ while (Number.isInteger(parentPid) && parentPid > 0 && !visited.has(parentPid)) {
684
+ protectedPids.add(parentPid);
685
+ visited.add(parentPid);
686
+ parentPid = pidToProcess.get(parentPid)?.ppid ?? 0;
687
+ }
688
+ return protectedPids;
689
+ }
678
690
  function parseWindowsProcessSnapshots(rawOutput) {
679
691
  if (!rawOutput) {
680
692
  return [];
@@ -688,6 +700,7 @@ function parseWindowsProcessSnapshots(rawOutput) {
688
700
  const rows = Array.isArray(parsed) ? parsed : [parsed];
689
701
  return rows.filter((row) => typeof row?.ProcessId === "number" && typeof row?.Name === "string").map((row) => ({
690
702
  pid: row.ProcessId,
703
+ ppid: typeof row.ParentProcessId === "number" ? row.ParentProcessId : 0,
691
704
  name: row.Name,
692
705
  cmd: typeof row.CommandLine === "string" ? row.CommandLine : ""
693
706
  }));
@@ -716,7 +729,7 @@ function runWindowsProcessSnapshotQuery(command) {
716
729
  }
717
730
  function getWindowsProcessSnapshots() {
718
731
  return runWindowsProcessSnapshotQuery(
719
- "Get-CimInstance Win32_Process | Select-Object ProcessId, Name, CommandLine | ConvertTo-Json -Compress"
732
+ "Get-CimInstance Win32_Process | Select-Object ProcessId, ParentProcessId, Name, CommandLine | ConvertTo-Json -Compress"
720
733
  );
721
734
  }
722
735
  function getWindowsProcessSnapshotByPid(pid) {
@@ -724,7 +737,7 @@ function getWindowsProcessSnapshotByPid(pid) {
724
737
  return null;
725
738
  }
726
739
  const [proc] = runWindowsProcessSnapshotQuery(
727
- `Get-CimInstance Win32_Process -Filter "ProcessId = ${pid}" | Select-Object ProcessId, Name, CommandLine | ConvertTo-Json -Compress`
740
+ `Get-CimInstance Win32_Process -Filter "ProcessId = ${pid}" | Select-Object ProcessId, ParentProcessId, Name, CommandLine | ConvertTo-Json -Compress`
728
741
  );
729
742
  return proc ?? null;
730
743
  }
@@ -760,10 +773,20 @@ function findWindowsHappyProcesses(processes) {
760
773
  function toProcessSnapshot(proc) {
761
774
  return {
762
775
  pid: proc.pid,
776
+ ppid: "ppid" in proc && typeof proc.ppid === "number" ? proc.ppid : 0,
763
777
  name: proc.name || "",
764
778
  cmd: proc.cmd || ""
765
779
  };
766
780
  }
781
+ async function listProcessSnapshots() {
782
+ if (process.platform === "win32") {
783
+ const windowsProcesses = getWindowsProcessSnapshots();
784
+ if (windowsProcesses.length > 0) {
785
+ return windowsProcesses;
786
+ }
787
+ }
788
+ return (await psList()).map(toProcessSnapshot);
789
+ }
767
790
  async function findHappyProcessByPid(pid) {
768
791
  try {
769
792
  if (process.platform === "win32") {
@@ -797,22 +820,13 @@ async function findHappyProcessByPid(pid) {
797
820
  }
798
821
  async function findAllHappyProcesses() {
799
822
  try {
823
+ const processSnapshots = await listProcessSnapshots();
800
824
  if (process.platform === "win32") {
801
- const windowsProcesses = getWindowsProcessSnapshots();
802
- if (windowsProcesses.length > 0) {
803
- return findWindowsHappyProcesses(windowsProcesses);
804
- }
805
- const fallbackProcesses = (await psList()).map(toProcessSnapshot);
806
- return findWindowsHappyProcesses(fallbackProcesses);
825
+ return findWindowsHappyProcesses(processSnapshots);
807
826
  }
808
- const processes = await psList();
809
827
  const allProcesses = [];
810
- for (const proc of processes) {
811
- const match = classifyHappyProcess({
812
- pid: proc.pid,
813
- name: proc.name || "",
814
- cmd: proc.cmd || ""
815
- });
828
+ for (const proc of processSnapshots) {
829
+ const match = classifyHappyProcess(proc);
816
830
  if (match) {
817
831
  allProcesses.push(match);
818
832
  }
@@ -823,9 +837,11 @@ async function findAllHappyProcesses() {
823
837
  }
824
838
  }
825
839
  async function findRunawayHappyProcesses() {
826
- const allProcesses = await findAllHappyProcesses();
840
+ const processSnapshots = await listProcessSnapshots();
841
+ const protectedPids = collectProtectedProcessIds(processSnapshots, process.pid, process.ppid);
842
+ const allProcesses = process.platform === "win32" ? findWindowsHappyProcesses(processSnapshots) : processSnapshots.map(classifyHappyProcess).filter((proc) => proc !== null);
827
843
  return allProcesses.filter(
828
- (p) => p.pid !== process.pid && (p.type === "daemon" || p.type === "dev-daemon" || p.type === "daemon-spawned-session" || p.type === "dev-daemon-spawned" || p.type === "daemon-version-check" || p.type === "dev-daemon-version-check")
844
+ (p) => !protectedPids.has(p.pid) && (p.type === "daemon" || p.type === "dev-daemon" || p.type === "daemon-spawned-session" || p.type === "dev-daemon-spawned" || p.type === "daemon-version-check" || p.type === "dev-daemon-version-check")
829
845
  ).map((p) => ({ pid: p.pid, command: p.command }));
830
846
  }
831
847
  async function killRunawayHappyProcesses() {
@@ -11654,14 +11670,14 @@ var launch = /*#__PURE__*/Object.freeze({
11654
11670
  const unifiedProviderExecutors = {
11655
11671
  claude: async (opts) => {
11656
11672
  const claudeOptions = opts.claudeOptions ?? {};
11657
- const { runClaude } = await import('./runClaude-BrvxWJ9-.mjs');
11673
+ const { runClaude } = await import('./runClaude-BK-xZzSe.mjs');
11658
11674
  await runClaude(opts.credentials, {
11659
11675
  ...claudeOptions,
11660
11676
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
11661
11677
  });
11662
11678
  },
11663
11679
  codex: async (opts) => {
11664
- const { runCodex } = await import('./runCodex-DfYO-7YG.mjs');
11680
+ const { runCodex } = await import('./runCodex-C4X1beyB.mjs');
11665
11681
  await runCodex({
11666
11682
  credentials: opts.credentials,
11667
11683
  startedBy: opts.startedBy,
@@ -11670,7 +11686,7 @@ const unifiedProviderExecutors = {
11670
11686
  });
11671
11687
  },
11672
11688
  gemini: async (opts) => {
11673
- const { runGemini } = await import('./runGemini-C1_AOBlU.mjs');
11689
+ const { runGemini } = await import('./runGemini-Bigzf0Vw.mjs');
11674
11690
  await runGemini({
11675
11691
  credentials: opts.credentials,
11676
11692
  startedBy: opts.startedBy
@@ -11753,7 +11769,7 @@ function shouldRunMainClaudeFlow(opts) {
11753
11769
  return;
11754
11770
  } else if (subcommand === "runtime") {
11755
11771
  if (args[1] === "providers") {
11756
- const { renderRuntimeProviders } = await import('./command-CMZlS6zf.mjs');
11772
+ const { renderRuntimeProviders } = await import('./command-Dth-tCSc.mjs');
11757
11773
  console.log(renderRuntimeProviders());
11758
11774
  return;
11759
11775
  }
@@ -11959,8 +11975,8 @@ function shouldRunMainClaudeFlow(opts) {
11959
11975
  const projectId = args[3];
11960
11976
  try {
11961
11977
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11962
- const { readCredentials: readCredentials2 } = await import('./api-B3Zl8oHG.mjs').then(function (n) { return n.T; });
11963
- const { ApiClient: ApiClient2 } = await import('./api-B3Zl8oHG.mjs').then(function (n) { return n.U; });
11978
+ const { readCredentials: readCredentials2 } = await import('./api-C_wLDBlG.mjs').then(function (n) { return n.T; });
11979
+ const { ApiClient: ApiClient2 } = await import('./api-C_wLDBlG.mjs').then(function (n) { return n.U; });
11964
11980
  let userEmail = void 0;
11965
11981
  try {
11966
11982
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-C94O6IB2.cjs');
4
+ require('./api-CeZTggZF.cjs');
5
5
  require('zod');
6
- require('./index-D4TuE2VS.cjs');
6
+ require('./index-CckDTAoL.cjs');
7
7
  require('node:child_process');
8
8
  require('node:fs');
9
9
  require('cross-spawn');
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import 'chalk';
2
- import './api-B3Zl8oHG.mjs';
2
+ import './api-C_wLDBlG.mjs';
3
3
  import 'zod';
4
- import './index-sqm5plVs.mjs';
4
+ import './index-l0zi9G9M.mjs';
5
5
  import 'node:child_process';
6
6
  import 'node:fs';
7
7
  import 'cross-spawn';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./api-C94O6IB2.cjs');
3
+ var persistence = require('./api-CeZTggZF.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');