happy-imou-cloud 2.0.9 → 2.0.10

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.
@@ -17,7 +17,7 @@ import { resolve, join as join$1 } from 'path';
17
17
  import { Expo } from 'expo-server-sdk';
18
18
 
19
19
  var name = "happy-imou-cloud";
20
- var version = "2.0.9";
20
+ var version = "2.0.10";
21
21
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
22
22
  var author = "long.zhu";
23
23
  var license = "MIT";
@@ -430,7 +430,7 @@ async function listDaemonLogFiles(limit = 50) {
430
430
  return { file, path: fullPath, modified: stats.mtime };
431
431
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
432
432
  try {
433
- const { readDaemonState } = await import('./persistence-BPV3AmJL.mjs');
433
+ const { readDaemonState } = await import('./persistence-BxP6Jw1f.mjs');
434
434
  const state = await readDaemonState();
435
435
  if (!state) {
436
436
  return logs;
@@ -2,10 +2,10 @@
2
2
 
3
3
  var axios = require('axios');
4
4
  var chalk = require('chalk');
5
- var fs = require('fs');
6
- var node_fs = require('node:fs');
5
+ var fs$1 = require('fs');
6
+ var fs = require('node:fs');
7
7
  var os = require('node:os');
8
- var node_path = require('node:path');
8
+ var path = require('node:path');
9
9
  var node_events = require('node:events');
10
10
  var socket_ioClient = require('socket.io-client');
11
11
  var z = require('zod');
@@ -13,13 +13,13 @@ var node_crypto = require('node:crypto');
13
13
  var tweetnacl = require('tweetnacl');
14
14
  var child_process = require('child_process');
15
15
  var util = require('util');
16
- var fs$1 = require('fs/promises');
16
+ var fs$2 = require('fs/promises');
17
17
  var crypto = require('crypto');
18
- var path = require('path');
18
+ var path$1 = require('path');
19
19
  var expoServerSdk = require('expo-server-sdk');
20
20
 
21
21
  var name = "happy-imou-cloud";
22
- var version = "2.0.9";
22
+ var version = "2.0.10";
23
23
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
24
24
  var author = "long.zhu";
25
25
  var license = "MIT";
@@ -217,7 +217,7 @@ class Configuration {
217
217
  const expandedPath = process.env.HAPPY_CLOUD_HOME_DIR.replace(/^~/, os.homedir());
218
218
  this.happyCloudHomeDir = expandedPath;
219
219
  } else {
220
- this.happyCloudHomeDir = node_path.join(os.homedir(), ".happy-cloud");
220
+ this.happyCloudHomeDir = path.join(os.homedir(), ".happy-cloud");
221
221
  }
222
222
  this.happyHomeDir = this.happyCloudHomeDir;
223
223
  } else {
@@ -225,15 +225,15 @@ class Configuration {
225
225
  const expandedPath = process.env.HAPPY_HOME_DIR.replace(/^~/, os.homedir());
226
226
  this.happyHomeDir = expandedPath;
227
227
  } else {
228
- this.happyHomeDir = node_path.join(os.homedir(), ".happy");
228
+ this.happyHomeDir = path.join(os.homedir(), ".happy");
229
229
  }
230
230
  this.happyCloudHomeDir = this.happyHomeDir;
231
231
  }
232
- this.logsDir = node_path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "logs");
233
- this.settingsFile = node_path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "settings.json");
234
- this.privateKeyFile = node_path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "access.key");
235
- this.daemonStateFile = node_path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "daemon.state.json");
236
- this.daemonLockFile = node_path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "daemon.state.json.lock");
232
+ this.logsDir = path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "logs");
233
+ this.settingsFile = path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "settings.json");
234
+ this.privateKeyFile = path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "access.key");
235
+ this.daemonStateFile = path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "daemon.state.json");
236
+ this.daemonLockFile = path.join(this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir, "daemon.state.json.lock");
237
237
  this.isExperimentalEnabled = ["true", "1", "yes"].includes(process.env.HAPPY_EXPERIMENTAL?.toLowerCase() || "");
238
238
  this.disableCaffeinate = ["true", "1", "yes"].includes(process.env.HAPPY_DISABLE_CAFFEINATE?.toLowerCase() || "");
239
239
  this.currentCliVersion = packageJson.version;
@@ -251,11 +251,11 @@ class Configuration {
251
251
  }
252
252
  }
253
253
  const homeDir = this.isHappyCloudMode ? this.happyCloudHomeDir : this.happyHomeDir;
254
- if (!node_fs.existsSync(homeDir)) {
255
- node_fs.mkdirSync(homeDir, { recursive: true });
254
+ if (!fs.existsSync(homeDir)) {
255
+ fs.mkdirSync(homeDir, { recursive: true });
256
256
  }
257
- if (!node_fs.existsSync(this.logsDir)) {
258
- node_fs.mkdirSync(this.logsDir, { recursive: true });
257
+ if (!fs.existsSync(this.logsDir)) {
258
+ fs.mkdirSync(this.logsDir, { recursive: true });
259
259
  }
260
260
  }
261
261
  }
@@ -285,7 +285,7 @@ function createTimestampForLogEntry(date = /* @__PURE__ */ new Date()) {
285
285
  function getSessionLogPath() {
286
286
  const timestamp = createTimestampForFilename();
287
287
  const filename = configuration.isDaemonProcess ? `${timestamp}-daemon.log` : `${timestamp}.log`;
288
- return node_path.join(configuration.logsDir, filename);
288
+ return path.join(configuration.logsDir, filename);
289
289
  }
290
290
  class Logger {
291
291
  constructor(logFilePath = getSessionLogPath()) {
@@ -410,7 +410,7 @@ class Logger {
410
410
  });
411
411
  }
412
412
  try {
413
- fs.appendFileSync(this.logFilePath, logLine);
413
+ fs$1.appendFileSync(this.logFilePath, logLine);
414
414
  } catch (appendError) {
415
415
  if (process.env.DEBUG) {
416
416
  console.error("[DEV MODE ONLY THROWING] Failed to append to log file:", appendError);
@@ -423,24 +423,24 @@ let logger = new Logger();
423
423
  async function listDaemonLogFiles(limit = 50) {
424
424
  try {
425
425
  const logsDir = configuration.logsDir;
426
- if (!node_fs.existsSync(logsDir)) {
426
+ if (!fs.existsSync(logsDir)) {
427
427
  return [];
428
428
  }
429
- const logs = node_fs.readdirSync(logsDir).filter((file) => file.endsWith("-daemon.log")).map((file) => {
430
- const fullPath = node_path.join(logsDir, file);
431
- const stats = node_fs.statSync(fullPath);
429
+ const logs = fs.readdirSync(logsDir).filter((file) => file.endsWith("-daemon.log")).map((file) => {
430
+ const fullPath = path.join(logsDir, file);
431
+ const stats = fs.statSync(fullPath);
432
432
  return { file, path: fullPath, modified: stats.mtime };
433
433
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
434
434
  try {
435
- const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-CxvL0cwp.cjs'); });
435
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-D7JtnrYA.cjs'); });
436
436
  const state = await readDaemonState();
437
437
  if (!state) {
438
438
  return logs;
439
439
  }
440
- if (state.daemonLogPath && node_fs.existsSync(state.daemonLogPath)) {
441
- const stats = node_fs.statSync(state.daemonLogPath);
440
+ if (state.daemonLogPath && fs.existsSync(state.daemonLogPath)) {
441
+ const stats = fs.statSync(state.daemonLogPath);
442
442
  const persisted = {
443
- file: node_path.basename(state.daemonLogPath),
443
+ file: path.basename(state.daemonLogPath),
444
444
  path: state.daemonLogPath,
445
445
  modified: stats.mtime
446
446
  };
@@ -853,8 +853,8 @@ class RpcHandlerManager {
853
853
  }
854
854
 
855
855
  function validatePath(targetPath, workingDirectory) {
856
- const resolvedTarget = path.resolve(workingDirectory, targetPath);
857
- const resolvedWorkingDir = path.resolve(workingDirectory);
856
+ const resolvedTarget = path$1.resolve(workingDirectory, targetPath);
857
+ const resolvedWorkingDir = path$1.resolve(workingDirectory);
858
858
  const targetNormalized = resolvedTarget.replace(/\\/g, "/");
859
859
  const workingDirNormalized = resolvedWorkingDir.replace(/\\/g, "/");
860
860
  process.platform === "win32" ? "\\" : "/";
@@ -940,7 +940,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
940
940
  return { success: false, error: validation.error };
941
941
  }
942
942
  try {
943
- const buffer = await fs$1.readFile(data.path);
943
+ const buffer = await fs$2.readFile(data.path);
944
944
  const content = buffer.toString("base64");
945
945
  return { success: true, content };
946
946
  } catch (error) {
@@ -957,7 +957,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
957
957
  try {
958
958
  if (data.expectedHash !== null && data.expectedHash !== void 0) {
959
959
  try {
960
- const existingBuffer = await fs$1.readFile(data.path);
960
+ const existingBuffer = await fs$2.readFile(data.path);
961
961
  const existingHash = crypto.createHash("sha256").update(existingBuffer).digest("hex");
962
962
  if (existingHash !== data.expectedHash) {
963
963
  return {
@@ -977,7 +977,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
977
977
  }
978
978
  } else {
979
979
  try {
980
- await fs$1.stat(data.path);
980
+ await fs$2.stat(data.path);
981
981
  return {
982
982
  success: false,
983
983
  error: "File already exists but was expected to be new"
@@ -990,7 +990,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
990
990
  }
991
991
  }
992
992
  const buffer = Buffer.from(data.content, "base64");
993
- await fs$1.writeFile(data.path, buffer);
993
+ await fs$2.writeFile(data.path, buffer);
994
994
  const hash = crypto.createHash("sha256").update(buffer).digest("hex");
995
995
  return { success: true, hash };
996
996
  } catch (error) {
@@ -1005,10 +1005,10 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
1005
1005
  return { success: false, error: validation.error };
1006
1006
  }
1007
1007
  try {
1008
- const entries = await fs$1.readdir(data.path, { withFileTypes: true });
1008
+ const entries = await fs$2.readdir(data.path, { withFileTypes: true });
1009
1009
  const directoryEntries = await Promise.all(
1010
1010
  entries.map(async (entry) => {
1011
- const fullPath = path.join(data.path, entry.name);
1011
+ const fullPath = path$1.join(data.path, entry.name);
1012
1012
  let type = "other";
1013
1013
  let size;
1014
1014
  let modified;
@@ -1018,7 +1018,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
1018
1018
  type = "file";
1019
1019
  }
1020
1020
  try {
1021
- const stats = await fs$1.stat(fullPath);
1021
+ const stats = await fs$2.stat(fullPath);
1022
1022
  size = stats.size;
1023
1023
  modified = stats.mtime.getTime();
1024
1024
  } catch (error) {
@@ -1049,26 +1049,26 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
1049
1049
  if (!validation.valid) {
1050
1050
  return { success: false, error: validation.error };
1051
1051
  }
1052
- async function buildTree(path$1, name, currentDepth) {
1052
+ async function buildTree(path, name, currentDepth) {
1053
1053
  try {
1054
- const stats = await fs$1.stat(path$1);
1054
+ const stats = await fs$2.stat(path);
1055
1055
  const node = {
1056
1056
  name,
1057
- path: path$1,
1057
+ path,
1058
1058
  type: stats.isDirectory() ? "directory" : "file",
1059
1059
  size: stats.size,
1060
1060
  modified: stats.mtime.getTime()
1061
1061
  };
1062
1062
  if (stats.isDirectory() && currentDepth < data.maxDepth) {
1063
- const entries = await fs$1.readdir(path$1, { withFileTypes: true });
1063
+ const entries = await fs$2.readdir(path, { withFileTypes: true });
1064
1064
  const children = [];
1065
1065
  await Promise.all(
1066
1066
  entries.map(async (entry) => {
1067
1067
  if (entry.isSymbolicLink()) {
1068
- logger.debug(`Skipping symlink: ${path.join(path$1, entry.name)}`);
1068
+ logger.debug(`Skipping symlink: ${path$1.join(path, entry.name)}`);
1069
1069
  return;
1070
1070
  }
1071
- const childPath = path.join(path$1, entry.name);
1071
+ const childPath = path$1.join(path, entry.name);
1072
1072
  const childNode = await buildTree(childPath, entry.name, currentDepth + 1);
1073
1073
  if (childNode) {
1074
1074
  children.push(childNode);
@@ -1084,7 +1084,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
1084
1084
  }
1085
1085
  return node;
1086
1086
  } catch (error) {
1087
- logger.debug(`Failed to process ${path$1}:`, error instanceof Error ? error.message : String(error));
1087
+ logger.debug(`Failed to process ${path}:`, error instanceof Error ? error.message : String(error));
1088
1088
  return null;
1089
1089
  }
1090
1090
  }
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-BpZL4RcT.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-CzvgPwr1.mjs';
2
2
  import 'chalk';
3
- import './api-CnvyGas2.mjs';
3
+ import './api-BjxmW-0W.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -17,7 +17,7 @@ import 'fs/promises';
17
17
  import 'crypto';
18
18
  import 'path';
19
19
  import 'expo-server-sdk';
20
- import './persistence-BPV3AmJL.mjs';
20
+ import './persistence-BxP6Jw1f.mjs';
21
21
  import 'node:fs/promises';
22
22
  import 'os';
23
23
  import 'tmp';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D4OdFq68.cjs');
3
+ var index = require('./index-Cuvfa15L.cjs');
4
4
  require('chalk');
5
- require('./api-CUTdFiFP.cjs');
5
+ require('./api-DUE5TJBE.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -19,7 +19,7 @@ require('fs/promises');
19
19
  require('crypto');
20
20
  require('path');
21
21
  require('expo-server-sdk');
22
- require('./persistence-CxvL0cwp.cjs');
22
+ require('./persistence-D7JtnrYA.cjs');
23
23
  require('node:fs/promises');
24
24
  require('os');
25
25
  require('tmp');