happy-imou-cloud 2.0.2 → 2.0.3

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-D8VhEbs2.mjs → BaseReasoningProcessor-B37yOHxo.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-B6tJ_eL5.cjs → BaseReasoningProcessor-_wxlqKB8.cjs} +4 -4
  3. package/dist/{api-D2Njw9Im.cjs → api-D9dIR956.cjs} +43 -43
  4. package/dist/{api-MYhAGPLn.mjs → api-DpQIC-DJ.mjs} +2 -2
  5. package/dist/{command-CVldr51S.cjs → command-CdXv1zNF.cjs} +3 -3
  6. package/dist/{command-nmK6O-ab.mjs → command-DRqrBuHM.mjs} +3 -3
  7. package/dist/{index-B97L7qLD.mjs → index-CriPm_z9.mjs} +8 -8
  8. package/dist/{index-Bg-YziG2.cjs → index-LYPXVO_L.cjs} +95 -95
  9. package/dist/index.cjs +3 -3
  10. package/dist/index.mjs +3 -3
  11. package/dist/lib.cjs +1 -1
  12. package/dist/lib.mjs +1 -1
  13. package/dist/{persistence-Dkm7rm8k.mjs → persistence-CqgPgbzN.mjs} +1 -1
  14. package/dist/{persistence-D_2GkJAO.cjs → persistence-PzKU0QCa.cjs} +28 -28
  15. package/dist/{registerKillSessionHandler-BAXmJQRt.cjs → registerKillSessionHandler-BDBPoQSA.cjs} +2 -2
  16. package/dist/{registerKillSessionHandler-5GbrO0FM.mjs → registerKillSessionHandler-C3M_-4Zg.mjs} +2 -2
  17. package/dist/{runClaude-Cii3R2Fv.mjs → runClaude-D6Pdkevn.mjs} +25 -5
  18. package/dist/{runClaude-B-GNEkKg.cjs → runClaude-IeRSC5qX.cjs} +53 -33
  19. package/dist/{runCodex-C--ZwAhl.mjs → runCodex-CsfUU1Wb.mjs} +216 -401
  20. package/dist/{runCodex-CPHyGwj9.cjs → runCodex-WRmgSK6L.cjs} +216 -401
  21. package/dist/{runGemini-CQp7Nuzn.mjs → runGemini-CrH3dQ0Y.mjs} +5 -5
  22. package/dist/{runGemini-DaDz1bzQ.cjs → runGemini-qBh6zs5G.cjs} +5 -5
  23. package/package.json +1 -1
  24. package/dist/future-Dq4Ha1Dn.cjs +0 -24
  25. package/dist/future-xRdLl3vf.mjs +0 -22
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var api = require('./api-D2Njw9Im.cjs');
5
- var persistence = require('./persistence-D_2GkJAO.cjs');
4
+ var api = require('./api-D9dIR956.cjs');
5
+ var persistence = require('./persistence-PzKU0QCa.cjs');
6
6
  var z = require('zod');
7
- var fs$2 = require('fs/promises');
7
+ var fs$1 = require('fs/promises');
8
8
  var os$1 = require('os');
9
9
  var tmp = require('tmp');
10
10
  var node_crypto = require('node:crypto');
@@ -14,18 +14,18 @@ var qrcode = require('qrcode-terminal');
14
14
  var promises = require('node:fs/promises');
15
15
  var node_module = require('node:module');
16
16
  var os = require('node:os');
17
- var path = require('node:path');
17
+ var node_path = require('node:path');
18
18
  var open = require('open');
19
19
  var React = require('react');
20
20
  var ink = require('ink');
21
21
  var child_process = require('child_process');
22
- var path$1 = require('path');
22
+ var path = require('path');
23
23
  var url = require('url');
24
- var fs$1 = require('fs');
24
+ var fs = require('fs');
25
25
  var node_child_process = require('node:child_process');
26
26
  var psList = require('ps-list');
27
27
  var spawn = require('cross-spawn');
28
- var fs = require('node:fs');
28
+ var node_fs = require('node:fs');
29
29
  var fastify = require('fastify');
30
30
  var fastifyTypeProviderZod = require('fastify-type-provider-zod');
31
31
  var node_readline = require('node:readline');
@@ -70,7 +70,7 @@ async function openBrowser(url) {
70
70
  }
71
71
  }
72
72
 
73
- 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-Bg-YziG2.cjs', document.baseURI).href)));
73
+ 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-LYPXVO_L.cjs', document.baseURI).href)));
74
74
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
75
75
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
76
76
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -164,7 +164,7 @@ async function openWindowsQrCode(value) {
164
164
  "</body>",
165
165
  "</html>"
166
166
  ].join("");
167
- const filePath = path.join(os.tmpdir(), `happy-auth-qrcode-${node_crypto.randomUUID()}.html`);
167
+ const filePath = node_path.join(os.tmpdir(), `happy-auth-qrcode-${node_crypto.randomUUID()}.html`);
168
168
  await promises.writeFile(filePath, html, "utf8");
169
169
  const opened = await openBrowser(filePath);
170
170
  if (opened) {
@@ -693,18 +693,18 @@ function setupCleanupHandlers() {
693
693
  });
694
694
  }
695
695
 
696
- const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Bg-YziG2.cjs', document.baseURI).href))));
696
+ const __dirname$1 = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-LYPXVO_L.cjs', document.baseURI).href))));
697
697
  function projectPath() {
698
- const path = path$1.resolve(__dirname$1, "..");
699
- return path;
698
+ const path$1 = path.resolve(__dirname$1, "..");
699
+ return path$1;
700
700
  }
701
701
 
702
702
  function getDaemonPid() {
703
703
  try {
704
- if (!fs.existsSync(api.configuration.daemonStateFile)) {
704
+ if (!node_fs.existsSync(api.configuration.daemonStateFile)) {
705
705
  return null;
706
706
  }
707
- const state = JSON.parse(fs.readFileSync(api.configuration.daemonStateFile, "utf-8"));
707
+ const state = JSON.parse(node_fs.readFileSync(api.configuration.daemonStateFile, "utf-8"));
708
708
  return typeof state.pid === "number" ? state.pid : null;
709
709
  } catch {
710
710
  return null;
@@ -1030,8 +1030,8 @@ async function isDaemonRunningCurrentlyInstalledHappyVersion() {
1030
1030
  return false;
1031
1031
  }
1032
1032
  try {
1033
- const packageJsonPath = path$1.join(projectPath(), "package.json");
1034
- const packageJson = JSON.parse(fs$1.readFileSync(packageJsonPath, "utf-8"));
1033
+ const packageJsonPath = path.join(projectPath(), "package.json");
1034
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
1035
1035
  const currentCliVersion = packageJson.version;
1036
1036
  api.logger.debug(`[DAEMON CONTROL] Current CLI version: ${currentCliVersion}, Daemon started with version: ${state.startedWithCliVersion}`);
1037
1037
  if (currentCliVersion !== state.startedWithCliVersion) {
@@ -1131,14 +1131,14 @@ function getEnvironmentInfo() {
1131
1131
  };
1132
1132
  }
1133
1133
  function getLogFiles(logDir) {
1134
- if (!fs.existsSync(logDir)) {
1134
+ if (!node_fs.existsSync(logDir)) {
1135
1135
  return [];
1136
1136
  }
1137
1137
  try {
1138
- return fs.readdirSync(logDir).filter((file) => file.endsWith(".log")).map((file) => {
1139
- const path$1 = path.join(logDir, file);
1140
- const stats = fs.statSync(path$1);
1141
- return { file, path: path$1, modified: stats.mtime };
1138
+ return node_fs.readdirSync(logDir).filter((file) => file.endsWith(".log")).map((file) => {
1139
+ const path = node_path.join(logDir, file);
1140
+ const stats = node_fs.statSync(path);
1141
+ return { file, path, modified: stats.mtime };
1142
1142
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
1143
1143
  } catch {
1144
1144
  return [];
@@ -1157,13 +1157,13 @@ async function runDoctorCommand(filter) {
1157
1157
  console.log("");
1158
1158
  console.log(chalk.bold("\u{1F527} Daemon Spawn Diagnostics"));
1159
1159
  const projectRoot = projectPath();
1160
- const wrapperPath = path.join(projectRoot, "bin", "happy.mjs");
1161
- const cliEntrypoint = path.join(projectRoot, "dist", "index.mjs");
1160
+ const wrapperPath = node_path.join(projectRoot, "bin", "happy.mjs");
1161
+ const cliEntrypoint = node_path.join(projectRoot, "dist", "index.mjs");
1162
1162
  console.log(`Project Root: ${chalk.blue(projectRoot)}`);
1163
1163
  console.log(`Wrapper Script: ${chalk.blue(wrapperPath)}`);
1164
1164
  console.log(`CLI Entrypoint: ${chalk.blue(cliEntrypoint)}`);
1165
- console.log(`Wrapper Exists: ${fs.existsSync(wrapperPath) ? chalk.green("\u2713 Yes") : chalk.red("\u274C No")}`);
1166
- console.log(`CLI Exists: ${fs.existsSync(cliEntrypoint) ? chalk.green("\u2713 Yes") : chalk.red("\u274C No")}`);
1165
+ console.log(`Wrapper Exists: ${node_fs.existsSync(wrapperPath) ? chalk.green("\u2713 Yes") : chalk.red("\u274C No")}`);
1166
+ console.log(`CLI Exists: ${node_fs.existsSync(cliEntrypoint) ? chalk.green("\u2713 Yes") : chalk.red("\u274C No")}`);
1167
1167
  console.log("");
1168
1168
  console.log(chalk.bold("\u2699\uFE0F Configuration"));
1169
1169
  console.log(`Happy Home: ${chalk.blue(api.configuration.happyCloudHomeDir)}`);
@@ -1329,7 +1329,7 @@ const isBun = () => getRuntime() === "bun";
1329
1329
 
1330
1330
  function spawnHappyCLI(args, options = {}) {
1331
1331
  const projectRoot = projectPath();
1332
- const entrypoint = path.join(projectRoot, "dist", "index.mjs");
1332
+ const entrypoint = node_path.join(projectRoot, "dist", "index.mjs");
1333
1333
  let directory;
1334
1334
  if ("cwd" in options) {
1335
1335
  directory = options.cwd;
@@ -1344,7 +1344,7 @@ function spawnHappyCLI(args, options = {}) {
1344
1344
  entrypoint,
1345
1345
  ...args
1346
1346
  ];
1347
- if (!fs.existsSync(entrypoint)) {
1347
+ if (!node_fs.existsSync(entrypoint)) {
1348
1348
  const errorMessage = `Entrypoint ${entrypoint} does not exist`;
1349
1349
  api.logger.debug(`[SPAWN HAPPY CLOUD CLI] ${errorMessage}`);
1350
1350
  throw new Error(errorMessage);
@@ -2404,7 +2404,7 @@ async function startDaemon() {
2404
2404
  const { directory, sessionId, machineId: machineId2, approvedNewDirectoryCreation = true } = options;
2405
2405
  let directoryCreated = false;
2406
2406
  try {
2407
- await fs$2.access(directory);
2407
+ await fs$1.access(directory);
2408
2408
  api.logger.debug(`[DAEMON RUN] Directory exists: ${directory}`);
2409
2409
  } catch (error) {
2410
2410
  api.logger.debug(`[DAEMON RUN] Directory doesn't exist, creating: ${directory}`);
@@ -2416,7 +2416,7 @@ async function startDaemon() {
2416
2416
  };
2417
2417
  }
2418
2418
  try {
2419
- await fs$2.mkdir(directory, { recursive: true });
2419
+ await fs$1.mkdir(directory, { recursive: true });
2420
2420
  api.logger.debug(`[DAEMON RUN] Successfully created directory: ${directory}`);
2421
2421
  directoryCreated = true;
2422
2422
  } catch (mkdirError) {
@@ -2445,7 +2445,7 @@ async function startDaemon() {
2445
2445
  if (options.token) {
2446
2446
  if (options.agent === "codex") {
2447
2447
  const codexHomeDir = tmp__namespace.dirSync();
2448
- fs$2.writeFile(path$1.join(codexHomeDir.name, "auth.json"), options.token);
2448
+ fs$1.writeFile(path.join(codexHomeDir.name, "auth.json"), options.token);
2449
2449
  authEnv.CODEX_HOME = codexHomeDir.name;
2450
2450
  } else {
2451
2451
  authEnv.CLAUDE_CODE_OAUTH_TOKEN = options.token;
@@ -2511,7 +2511,7 @@ async function startDaemon() {
2511
2511
  const sessionDesc = tmuxSessionName || "current/most recent session";
2512
2512
  api.logger.debug(`[DAEMON RUN] Attempting to spawn session in tmux: ${sessionDesc}`);
2513
2513
  const tmux = getTmuxUtilities(tmuxSessionName);
2514
- const cliPath = path$1.join(projectPath(), "dist", "index.mjs");
2514
+ const cliPath = path.join(projectPath(), "dist", "index.mjs");
2515
2515
  const agent = resolveDaemonSpawnAgent(options.agent);
2516
2516
  const fullCommand = `node --no-warnings --no-deprecation ${cliPath} ${buildDaemonSpawnArgs(agent).join(" ")}`;
2517
2517
  const windowName = `happy-${Date.now()}-${agent}`;
@@ -2757,7 +2757,7 @@ async function startDaemon() {
2757
2757
  pidToTrackedSession.delete(pid);
2758
2758
  }
2759
2759
  }
2760
- const projectVersion = JSON.parse(fs$1.readFileSync(path$1.join(projectPath(), "package.json"), "utf-8")).version;
2760
+ const projectVersion = JSON.parse(fs.readFileSync(path.join(projectPath(), "package.json"), "utf-8")).version;
2761
2761
  if (projectVersion !== api.configuration.currentCliVersion) {
2762
2762
  api.logger.debug("[DAEMON RUN] Daemon is outdated, triggering self-restart with latest version, clearing heartbeat interval");
2763
2763
  clearInterval(restartOnStaleVersionAndHeartbeat);
@@ -2850,7 +2850,7 @@ const PLIST_LABEL$1 = "com.happy-cloud.daemon";
2850
2850
  const PLIST_FILE$1 = `/Library/LaunchDaemons/${PLIST_LABEL$1}.plist`;
2851
2851
  async function install$1() {
2852
2852
  try {
2853
- if (fs$1.existsSync(PLIST_FILE$1)) {
2853
+ if (fs.existsSync(PLIST_FILE$1)) {
2854
2854
  api.logger.info("Daemon plist already exists. Uninstalling first...");
2855
2855
  child_process.execSync(`launchctl unload ${PLIST_FILE$1}`, { stdio: "inherit" });
2856
2856
  }
@@ -2894,8 +2894,8 @@ async function install$1() {
2894
2894
  </dict>
2895
2895
  </plist>
2896
2896
  `);
2897
- fs$1.writeFileSync(PLIST_FILE$1, plistContent);
2898
- fs$1.chmodSync(PLIST_FILE$1, 420);
2897
+ fs.writeFileSync(PLIST_FILE$1, plistContent);
2898
+ fs.chmodSync(PLIST_FILE$1, 420);
2899
2899
  api.logger.info(`Created daemon plist at ${PLIST_FILE$1}`);
2900
2900
  child_process.execSync(`launchctl load ${PLIST_FILE$1}`, { stdio: "inherit" });
2901
2901
  api.logger.info("Daemon installed and started successfully");
@@ -2921,7 +2921,7 @@ const PLIST_LABEL = "com.happy-cli.daemon";
2921
2921
  const PLIST_FILE = `/Library/LaunchDaemons/${PLIST_LABEL}.plist`;
2922
2922
  async function uninstall$1() {
2923
2923
  try {
2924
- if (!fs$1.existsSync(PLIST_FILE)) {
2924
+ if (!fs.existsSync(PLIST_FILE)) {
2925
2925
  api.logger.info("Daemon plist not found. Nothing to uninstall.");
2926
2926
  return;
2927
2927
  }
@@ -2931,7 +2931,7 @@ async function uninstall$1() {
2931
2931
  } catch (error) {
2932
2932
  api.logger.info("Failed to unload daemon (it might not be running)");
2933
2933
  }
2934
- fs$1.unlinkSync(PLIST_FILE);
2934
+ fs.unlinkSync(PLIST_FILE);
2935
2935
  api.logger.info(`Removed daemon plist from ${PLIST_FILE}`);
2936
2936
  api.logger.info("Daemon uninstalled successfully");
2937
2937
  } catch (error) {
@@ -3071,8 +3071,8 @@ async function handleAuthLogout(args = []) {
3071
3071
  console.log(chalk.gray("Stopped daemon"));
3072
3072
  } catch {
3073
3073
  }
3074
- if (fs.existsSync(happyDir)) {
3075
- fs.rmSync(happyDir, { recursive: true, force: true });
3074
+ if (node_fs.existsSync(happyDir)) {
3075
+ node_fs.rmSync(happyDir, { recursive: true, force: true });
3076
3076
  }
3077
3077
  console.log(chalk.green("\u2713 Successfully logged out"));
3078
3078
  console.log(chalk.gray(' Run "hicloud auth login" to authenticate again'));
@@ -3745,10 +3745,10 @@ async function handleConnectStatus() {
3745
3745
  }
3746
3746
  function updateLocalGeminiCredentials(tokens) {
3747
3747
  try {
3748
- const geminiDir = path$1.join(os$1.homedir(), ".gemini");
3749
- const credentialsPath = path$1.join(geminiDir, "oauth_creds.json");
3750
- if (!fs$1.existsSync(geminiDir)) {
3751
- fs$1.mkdirSync(geminiDir, { recursive: true });
3748
+ const geminiDir = path.join(os$1.homedir(), ".gemini");
3749
+ const credentialsPath = path.join(geminiDir, "oauth_creds.json");
3750
+ if (!fs.existsSync(geminiDir)) {
3751
+ fs.mkdirSync(geminiDir, { recursive: true });
3752
3752
  }
3753
3753
  const credentials = {
3754
3754
  access_token: tokens.access_token,
@@ -3758,7 +3758,7 @@ function updateLocalGeminiCredentials(tokens) {
3758
3758
  ...tokens.id_token && { id_token: tokens.id_token },
3759
3759
  ...tokens.expires_in && { expires_in: tokens.expires_in }
3760
3760
  };
3761
- fs$1.writeFileSync(credentialsPath, JSON.stringify(credentials, null, 2), "utf-8");
3761
+ fs.writeFileSync(credentialsPath, JSON.stringify(credentials, null, 2), "utf-8");
3762
3762
  console.log(chalk.gray(` Updated local credentials: ${credentialsPath}`));
3763
3763
  } catch (error) {
3764
3764
  console.log(chalk.yellow(` \u26A0\uFE0F Could not update local credentials: ${error}`));
@@ -3766,22 +3766,22 @@ function updateLocalGeminiCredentials(tokens) {
3766
3766
  }
3767
3767
 
3768
3768
  function getProjectPath(workingDirectory, claudeConfigDirOverride) {
3769
- const projectId = path.resolve(workingDirectory).replace(/[^a-zA-Z0-9-]/g, "-");
3769
+ const projectId = node_path.resolve(workingDirectory).replace(/[^a-zA-Z0-9-]/g, "-");
3770
3770
  const claudeConfigDirRaw = process.env.CLAUDE_CONFIG_DIR ?? "";
3771
3771
  const claudeConfigDirTrimmed = claudeConfigDirRaw.trim();
3772
- const claudeConfigDir = claudeConfigDirTrimmed ? claudeConfigDirTrimmed : path.join(os.homedir(), ".claude");
3773
- return path.join(claudeConfigDir, "projects", projectId);
3772
+ const claudeConfigDir = claudeConfigDirTrimmed ? claudeConfigDirTrimmed : node_path.join(os.homedir(), ".claude");
3773
+ return node_path.join(claudeConfigDir, "projects", projectId);
3774
3774
  }
3775
3775
 
3776
- function claudeCheckSession(sessionId, path$1, transcriptPath) {
3777
- const projectDir = getProjectPath(path$1);
3778
- const sessionFile = transcriptPath ?? path.join(projectDir, `${sessionId}.jsonl`);
3779
- const sessionExists = fs.existsSync(sessionFile);
3776
+ function claudeCheckSession(sessionId, path, transcriptPath) {
3777
+ const projectDir = getProjectPath(path);
3778
+ const sessionFile = transcriptPath ?? node_path.join(projectDir, `${sessionId}.jsonl`);
3779
+ const sessionExists = node_fs.existsSync(sessionFile);
3780
3780
  if (!sessionExists) {
3781
3781
  api.logger.debug(`[claudeCheckSession] Path ${sessionFile} does not exist`);
3782
3782
  return false;
3783
3783
  }
3784
- const sessionData = fs.readFileSync(sessionFile, "utf-8").split("\n");
3784
+ const sessionData = node_fs.readFileSync(sessionFile, "utf-8").split("\n");
3785
3785
  const hasGoodMessage = !!sessionData.find((v, index) => {
3786
3786
  if (!v.trim()) return false;
3787
3787
  try {
@@ -3802,7 +3802,7 @@ function claudeFindLastSession(workingDirectory) {
3802
3802
  try {
3803
3803
  const projectDir = getProjectPath(workingDirectory);
3804
3804
  const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3805
- const files = fs.readdirSync(projectDir).filter((f) => f.endsWith(".jsonl")).map((f) => {
3805
+ const files = node_fs.readdirSync(projectDir).filter((f) => f.endsWith(".jsonl")).map((f) => {
3806
3806
  const sessionId = f.replace(".jsonl", "");
3807
3807
  if (!uuidPattern.test(sessionId)) {
3808
3808
  return null;
@@ -3811,7 +3811,7 @@ function claudeFindLastSession(workingDirectory) {
3811
3811
  return {
3812
3812
  name: f,
3813
3813
  sessionId,
3814
- mtime: fs.statSync(path.join(projectDir, f)).mtime.getTime()
3814
+ mtime: node_fs.statSync(node_path.join(projectDir, f)).mtime.getTime()
3815
3815
  };
3816
3816
  }
3817
3817
  return null;
@@ -3831,10 +3831,10 @@ class ExitCodeError extends Error {
3831
3831
  this.exitCode = exitCode;
3832
3832
  }
3833
3833
  }
3834
- const claudeCliPath = path.resolve(path.join(projectPath(), "scripts", "claude_local_launcher.cjs"));
3834
+ const claudeCliPath = node_path.resolve(node_path.join(projectPath(), "scripts", "claude_local_launcher.cjs"));
3835
3835
  async function claudeLocal(opts) {
3836
3836
  const projectDir = getProjectPath(opts.path);
3837
- fs.mkdirSync(projectDir, { recursive: true });
3837
+ node_fs.mkdirSync(projectDir, { recursive: true });
3838
3838
  const hasContinueFlag = opts.claudeArgs?.includes("--continue");
3839
3839
  const hasResumeFlag = opts.claudeArgs?.includes("--resume");
3840
3840
  const hasUserSessionControl = hasContinueFlag || hasResumeFlag;
@@ -3953,7 +3953,7 @@ async function claudeLocal(opts) {
3953
3953
  args.push("--settings", opts.hookSettingsPath);
3954
3954
  api.logger.debug(`[ClaudeLocal] Using hook settings: ${opts.hookSettingsPath}`);
3955
3955
  }
3956
- if (!claudeCliPath || !fs.existsSync(claudeCliPath)) {
3956
+ if (!claudeCliPath || !node_fs.existsSync(claudeCliPath)) {
3957
3957
  throw new Error("Claude local launcher not found. Please ensure HAPPY_PROJECT_ROOT is set correctly for development.");
3958
3958
  }
3959
3959
  const env = {
@@ -5711,17 +5711,17 @@ function readGeminiLocalConfig() {
5711
5711
  let googleCloudProject = null;
5712
5712
  let googleCloudProjectEmail = null;
5713
5713
  const possiblePaths = [
5714
- path$1.join(os$1.homedir(), ".gemini", "oauth_creds.json"),
5714
+ path.join(os$1.homedir(), ".gemini", "oauth_creds.json"),
5715
5715
  // Main OAuth credentials file
5716
- path$1.join(os$1.homedir(), ".gemini", "config.json"),
5717
- path$1.join(os$1.homedir(), ".config", "gemini", "config.json"),
5718
- path$1.join(os$1.homedir(), ".gemini", "auth.json"),
5719
- path$1.join(os$1.homedir(), ".config", "gemini", "auth.json")
5716
+ path.join(os$1.homedir(), ".gemini", "config.json"),
5717
+ path.join(os$1.homedir(), ".config", "gemini", "config.json"),
5718
+ path.join(os$1.homedir(), ".gemini", "auth.json"),
5719
+ path.join(os$1.homedir(), ".config", "gemini", "auth.json")
5720
5720
  ];
5721
5721
  for (const configPath of possiblePaths) {
5722
- if (fs$1.existsSync(configPath)) {
5722
+ if (fs.existsSync(configPath)) {
5723
5723
  try {
5724
- const config = JSON.parse(fs$1.readFileSync(configPath, "utf-8"));
5724
+ const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
5725
5725
  if (!token) {
5726
5726
  const foundToken = config.access_token || config.token || config.apiKey || config.GEMINI_API_KEY;
5727
5727
  if (foundToken && typeof foundToken === "string") {
@@ -5793,22 +5793,22 @@ function determineGeminiModel(explicitModel, localConfig) {
5793
5793
  }
5794
5794
  function saveGeminiModelToConfig(model) {
5795
5795
  try {
5796
- const configDir = path$1.join(os$1.homedir(), ".gemini");
5797
- const configPath = path$1.join(configDir, "config.json");
5798
- if (!fs$1.existsSync(configDir)) {
5799
- fs$1.mkdirSync(configDir, { recursive: true });
5796
+ const configDir = path.join(os$1.homedir(), ".gemini");
5797
+ const configPath = path.join(configDir, "config.json");
5798
+ if (!fs.existsSync(configDir)) {
5799
+ fs.mkdirSync(configDir, { recursive: true });
5800
5800
  }
5801
5801
  let config = {};
5802
- if (fs$1.existsSync(configPath)) {
5802
+ if (fs.existsSync(configPath)) {
5803
5803
  try {
5804
- config = JSON.parse(fs$1.readFileSync(configPath, "utf-8"));
5804
+ config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
5805
5805
  } catch (error) {
5806
5806
  api.logger.debug(`[Gemini] Failed to read existing config, creating new one`);
5807
5807
  config = {};
5808
5808
  }
5809
5809
  }
5810
5810
  config.model = model;
5811
- fs$1.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
5811
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
5812
5812
  api.logger.debug(`[Gemini] Saved model "${model}" to ${configPath}`);
5813
5813
  } catch (error) {
5814
5814
  api.logger.debug(`[Gemini] Failed to save model to config:`, error);
@@ -5816,15 +5816,15 @@ function saveGeminiModelToConfig(model) {
5816
5816
  }
5817
5817
  function saveGoogleCloudProjectToConfig(projectId, email) {
5818
5818
  try {
5819
- const configDir = path$1.join(os$1.homedir(), ".gemini");
5820
- const configPath = path$1.join(configDir, "config.json");
5821
- if (!fs$1.existsSync(configDir)) {
5822
- fs$1.mkdirSync(configDir, { recursive: true });
5819
+ const configDir = path.join(os$1.homedir(), ".gemini");
5820
+ const configPath = path.join(configDir, "config.json");
5821
+ if (!fs.existsSync(configDir)) {
5822
+ fs.mkdirSync(configDir, { recursive: true });
5823
5823
  }
5824
5824
  let config = {};
5825
- if (fs$1.existsSync(configPath)) {
5825
+ if (fs.existsSync(configPath)) {
5826
5826
  try {
5827
- config = JSON.parse(fs$1.readFileSync(configPath, "utf-8"));
5827
+ config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
5828
5828
  } catch {
5829
5829
  config = {};
5830
5830
  }
@@ -5833,7 +5833,7 @@ function saveGoogleCloudProjectToConfig(projectId, email) {
5833
5833
  if (email) {
5834
5834
  config.googleCloudProjectEmail = email;
5835
5835
  }
5836
- fs$1.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
5836
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
5837
5837
  api.logger.debug(`[Gemini] Saved Google Cloud Project "${projectId}"${email ? ` for ${email}` : ""} to ${configPath}`);
5838
5838
  } catch (error) {
5839
5839
  api.logger.debug(`[Gemini] Failed to save Google Cloud Project to config:`, error);
@@ -5940,11 +5940,11 @@ function readFirstEnv(...names) {
5940
5940
  return "";
5941
5941
  }
5942
5942
  function normalizeCommandPath(command) {
5943
- if (path.isAbsolute(command)) {
5943
+ if (node_path.isAbsolute(command)) {
5944
5944
  return command;
5945
5945
  }
5946
- const resolved = path.resolve(process.cwd(), command);
5947
- return fs.existsSync(resolved) ? resolved : command;
5946
+ const resolved = node_path.resolve(process.cwd(), command);
5947
+ return node_fs.existsSync(resolved) ? resolved : command;
5948
5948
  }
5949
5949
  function resolveCommandOnPath(command) {
5950
5950
  const pathValue = typeof process.env.PATH === "string" ? process.env.PATH : "";
@@ -5952,13 +5952,13 @@ function resolveCommandOnPath(command) {
5952
5952
  return null;
5953
5953
  }
5954
5954
  const extensions = process.platform === "win32" ? (process.env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";").map((value) => value.trim().toLowerCase()).filter(Boolean) : [""];
5955
- for (const dir of pathValue.split(path.delimiter)) {
5955
+ for (const dir of pathValue.split(node_path.delimiter)) {
5956
5956
  const trimmedDir = dir.trim();
5957
5957
  if (!trimmedDir) {
5958
5958
  continue;
5959
5959
  }
5960
- const directCandidate = path.join(trimmedDir, command);
5961
- if (fs.existsSync(directCandidate)) {
5960
+ const directCandidate = node_path.join(trimmedDir, command);
5961
+ if (node_fs.existsSync(directCandidate)) {
5962
5962
  return directCandidate;
5963
5963
  }
5964
5964
  if (process.platform !== "win32") {
@@ -5969,8 +5969,8 @@ function resolveCommandOnPath(command) {
5969
5969
  continue;
5970
5970
  }
5971
5971
  for (const extension of extensions) {
5972
- const candidate = path.join(trimmedDir, `${command}${extension.toLowerCase()}`);
5973
- if (fs.existsSync(candidate)) {
5972
+ const candidate = node_path.join(trimmedDir, `${command}${extension.toLowerCase()}`);
5973
+ if (node_fs.existsSync(candidate)) {
5974
5974
  return candidate;
5975
5975
  }
5976
5976
  }
@@ -6065,8 +6065,8 @@ function validateCodexAcpSpawn(options = {}) {
6065
6065
  const normalizedCommand = spawn.command.trim();
6066
6066
  const commandLower = normalizedCommand.toLowerCase();
6067
6067
  const npxMode = readCodexAcpNpxMode();
6068
- if (path.isAbsolute(normalizedCommand)) {
6069
- if (!fs.existsSync(normalizedCommand)) {
6068
+ if (node_path.isAbsolute(normalizedCommand)) {
6069
+ if (!node_fs.existsSync(normalizedCommand)) {
6070
6070
  return {
6071
6071
  ok: false,
6072
6072
  errorMessage: `Codex ACP is enabled, but the resolved command does not exist: ${normalizedCommand}`
@@ -6336,12 +6336,12 @@ async function ensureUnifiedDaemonStarted() {
6336
6336
  async function executeUnifiedProvider(opts) {
6337
6337
  const credentials = await ensureUnifiedRuntimePrerequisites(opts.credentials);
6338
6338
  if (opts.provider === "claude") {
6339
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-B-GNEkKg.cjs'); });
6339
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-IeRSC5qX.cjs'); });
6340
6340
  await runClaude(credentials, opts.claudeOptions ?? {});
6341
6341
  return;
6342
6342
  }
6343
6343
  if (opts.provider === "codex") {
6344
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-CPHyGwj9.cjs'); });
6344
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-WRmgSK6L.cjs'); });
6345
6345
  await runCodex({
6346
6346
  credentials,
6347
6347
  startedBy: opts.startedBy,
@@ -6351,7 +6351,7 @@ async function executeUnifiedProvider(opts) {
6351
6351
  return;
6352
6352
  }
6353
6353
  if (opts.provider === "gemini") {
6354
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-DaDz1bzQ.cjs'); });
6354
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-qBh6zs5G.cjs'); });
6355
6355
  await runGemini({
6356
6356
  credentials,
6357
6357
  startedBy: opts.startedBy
@@ -6393,7 +6393,7 @@ function shouldRunMainClaudeFlow(opts) {
6393
6393
  return;
6394
6394
  } else if (subcommand === "runtime") {
6395
6395
  if (args[1] === "providers") {
6396
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-CVldr51S.cjs'); });
6396
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-CdXv1zNF.cjs'); });
6397
6397
  console.log(renderRuntimeProviders());
6398
6398
  return;
6399
6399
  }
@@ -6571,8 +6571,8 @@ function shouldRunMainClaudeFlow(opts) {
6571
6571
  const projectId = args[3];
6572
6572
  try {
6573
6573
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
6574
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-D_2GkJAO.cjs'); });
6575
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-D2Njw9Im.cjs'); }).then(function (n) { return n.api; });
6574
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-PzKU0QCa.cjs'); });
6575
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-D9dIR956.cjs'); }).then(function (n) { return n.api; });
6576
6576
  let userEmail = void 0;
6577
6577
  try {
6578
6578
  const credentials = await readCredentials2();
@@ -6735,7 +6735,7 @@ function shouldRunMainClaudeFlow(opts) {
6735
6735
  if (latest) {
6736
6736
  console.error(`Latest daemon log: ${latest.path}`);
6737
6737
  try {
6738
- const logContent = fs.readFileSync(latest.path, "utf-8");
6738
+ const logContent = node_fs.readFileSync(latest.path, "utf-8");
6739
6739
  if (logContent.includes("EADDRINUSE")) {
6740
6740
  console.error("Daemon control port is already in use. Retry after stopping the stale daemon or run `hicloud doctor clean`.");
6741
6741
  }
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-D2Njw9Im.cjs');
5
- require('./persistence-D_2GkJAO.cjs');
4
+ require('./api-D9dIR956.cjs');
5
+ require('./persistence-PzKU0QCa.cjs');
6
6
  require('zod');
7
- require('./index-Bg-YziG2.cjs');
7
+ require('./index-LYPXVO_L.cjs');
8
8
  require('node:child_process');
9
9
  require('node:fs');
10
10
  require('@agentclientprotocol/sdk');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './api-MYhAGPLn.mjs';
3
- import './persistence-Dkm7rm8k.mjs';
2
+ import './api-DpQIC-DJ.mjs';
3
+ import './persistence-CqgPgbzN.mjs';
4
4
  import 'zod';
5
- import './index-B97L7qLD.mjs';
5
+ import './index-CriPm_z9.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:fs';
8
8
  import '@agentclientprotocol/sdk';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-D2Njw9Im.cjs');
3
+ var api = require('./api-D9dIR956.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-MYhAGPLn.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-DpQIC-DJ.mjs';
2
2
  export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
3
3
  import 'axios';
4
4
  import 'chalk';
@@ -1,7 +1,7 @@
1
1
  import { readFile, unlink, mkdir, open, stat, writeFile, rename } from 'node:fs/promises';
2
2
  import { existsSync, unlinkSync, writeFileSync, readdirSync, readFileSync, constants } from 'node:fs';
3
3
  import { join, dirname } from 'node:path';
4
- import { c as configuration, l as logger, e as encodeBase64 } from './api-MYhAGPLn.mjs';
4
+ import { c as configuration, l as logger, e as encodeBase64 } from './api-DpQIC-DJ.mjs';
5
5
  import * as z from 'zod';
6
6
  import 'axios';
7
7
  import 'chalk';