happy-imou-cloud 2.1.44 → 2.1.47

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-CMyFNQ1O.cjs → BaseReasoningProcessor-CBbzF7oj.cjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-DVSN7PCw.mjs → BaseReasoningProcessor-KXIi0QF_.mjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-Dqa4j1pD.cjs → ProviderSelectionHandler-CJLlwlAu.cjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-2IaDlDBx.mjs → ProviderSelectionHandler-DzYObYrV.mjs} +2 -2
  5. package/dist/{api-BoWVQeVe.cjs → api-CVuTajTL.cjs} +104 -1
  6. package/dist/{api-BhMVpzwg.mjs → api-D3vYIva3.mjs} +104 -2
  7. package/dist/{command-DoF8oaxg.cjs → command-BZRQuZsh.cjs} +2 -3
  8. package/dist/{command-h3Rr4Abu.mjs → command-fcJ-4Yq3.mjs} +2 -3
  9. package/dist/{index-DxF1W0nt.mjs → index-Cp1I5I3U.mjs} +345 -59
  10. package/dist/{index-kIN8gN9G.cjs → index-CyW9A7hx.cjs} +323 -53
  11. package/dist/index.cjs +2 -3
  12. package/dist/index.mjs +2 -3
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +86 -86
  15. package/dist/lib.d.mts +86 -86
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-CBm2WFM0.cjs → registerKillSessionHandler-8C_Wrgor.cjs} +10 -5
  18. package/dist/{registerKillSessionHandler-Dsg63Cx6.mjs → registerKillSessionHandler-OhhMUuCQ.mjs} +10 -6
  19. package/dist/{runClaude-BpwlCyVT.mjs → runClaude-BviM1Wl5.mjs} +11 -9
  20. package/dist/{runClaude-Dq9OISKt.cjs → runClaude-CfdT_ccS.cjs} +11 -9
  21. package/dist/{runCodex-BnzErOK_.cjs → runCodex-B-t0yy4k.cjs} +496 -60
  22. package/dist/{runCodex-BMNR2hNp.mjs → runCodex-Dx3osc7U.mjs} +496 -60
  23. package/dist/{runGemini-D4Af8oH1.mjs → runGemini-CnJ75Q--.mjs} +11 -9
  24. package/dist/{runGemini-CYc9Ufxo.cjs → runGemini-DZ5-uzB9.cjs} +11 -9
  25. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-kIN8gN9G.cjs');
4
- var persistence = require('./api-BoWVQeVe.cjs');
3
+ var index = require('./index-CyW9A7hx.cjs');
4
+ var persistence = require('./api-CVuTajTL.cjs');
5
5
  var node_events = require('node:events');
6
6
  var node_crypto = require('node:crypto');
7
7
 
@@ -1,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-DxF1W0nt.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-BhMVpzwg.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-Cp1I5I3U.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-D3vYIva3.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 persistence = require('./api-BoWVQeVe.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-CBm2WFM0.cjs');
3
+ var persistence = require('./api-CVuTajTL.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-8C_Wrgor.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-BhMVpzwg.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-Dsg63Cx6.mjs';
1
+ import { l as logger } from './api-D3vYIva3.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-OhhMUuCQ.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -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.44";
41
+ var version = "2.1.47";
42
42
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
43
43
  var author = "long.zhu";
44
44
  var license = "MIT";
@@ -3694,6 +3694,97 @@ function quoteShellArgument(value) {
3694
3694
  }
3695
3695
  return `'${value.replace(/'/g, `'"'"'`)}'`;
3696
3696
  }
3697
+ const APP_PREVIEW_CHUNK_READ_SCRIPT = 'const fs=require("fs"); const p=process.argv[1]; const start=Number(process.argv[2]); const len=Number(process.argv[3]); const data=fs.readFileSync(p).toString("base64"); process.stdout.write(data.slice(start,start+len)); process.stderr.write(data.slice(start+len,start+len*2));';
3698
+ const MAX_PREVIEW_CHUNK_READ_OFFSET = 25e5;
3699
+ const MAX_PREVIEW_CHUNK_READ_LENGTH = 64e3;
3700
+ function parseShellWords(command) {
3701
+ const words = [];
3702
+ let index = 0;
3703
+ while (index < command.length) {
3704
+ while (index < command.length && /\s/.test(command[index])) {
3705
+ index += 1;
3706
+ }
3707
+ if (index >= command.length) {
3708
+ break;
3709
+ }
3710
+ let word = "";
3711
+ while (index < command.length && !/\s/.test(command[index])) {
3712
+ const char = command[index];
3713
+ if (char === "'") {
3714
+ index += 1;
3715
+ let closed = false;
3716
+ while (index < command.length) {
3717
+ const quotedChar = command[index];
3718
+ if (quotedChar === "'") {
3719
+ closed = true;
3720
+ index += 1;
3721
+ break;
3722
+ }
3723
+ word += quotedChar;
3724
+ index += 1;
3725
+ }
3726
+ if (!closed) {
3727
+ return null;
3728
+ }
3729
+ continue;
3730
+ }
3731
+ if (char === "\\" && index + 1 < command.length) {
3732
+ word += command[index + 1];
3733
+ index += 2;
3734
+ continue;
3735
+ }
3736
+ word += char;
3737
+ index += 1;
3738
+ }
3739
+ words.push(word);
3740
+ }
3741
+ return words;
3742
+ }
3743
+ function parsePreviewChunkReadCommand(command) {
3744
+ const words = parseShellWords(command);
3745
+ if (!words || words.length !== 6) {
3746
+ return null;
3747
+ }
3748
+ const [nodeCommand, nodeFlag, script, filePath, startText, lengthText] = words;
3749
+ if (nodeCommand !== "node" || nodeFlag !== "-e" || script !== APP_PREVIEW_CHUNK_READ_SCRIPT) {
3750
+ return null;
3751
+ }
3752
+ const start = Number(startText);
3753
+ const length = Number(lengthText);
3754
+ if (!Number.isSafeInteger(start) || start < 0 || start > MAX_PREVIEW_CHUNK_READ_OFFSET) {
3755
+ return null;
3756
+ }
3757
+ if (!Number.isSafeInteger(length) || length <= 0 || length > MAX_PREVIEW_CHUNK_READ_LENGTH) {
3758
+ return null;
3759
+ }
3760
+ return { filePath, start, length };
3761
+ }
3762
+ async function tryHandlePreviewChunkReadCommand(command, cwd) {
3763
+ const parsedCommand = parsePreviewChunkReadCommand(command);
3764
+ if (!parsedCommand) {
3765
+ return null;
3766
+ }
3767
+ try {
3768
+ const filePath = path$1.resolve(cwd ?? process.cwd(), parsedCommand.filePath);
3769
+ const buffer = await fs$2.readFile(filePath);
3770
+ const base64 = buffer.toString("base64");
3771
+ return {
3772
+ success: true,
3773
+ stdout: base64.slice(parsedCommand.start, parsedCommand.start + parsedCommand.length),
3774
+ stderr: base64.slice(parsedCommand.start + parsedCommand.length, parsedCommand.start + parsedCommand.length * 2),
3775
+ exitCode: 0
3776
+ };
3777
+ } catch (error) {
3778
+ const message = error instanceof Error ? error.message : "Failed to read file";
3779
+ return {
3780
+ success: false,
3781
+ stdout: "",
3782
+ stderr: message,
3783
+ exitCode: 1,
3784
+ error: message
3785
+ };
3786
+ }
3787
+ }
3697
3788
  function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
3698
3789
  rpcHandlerManager.registerHandler("bash", async (data) => {
3699
3790
  logger.debug("Shell command request:", data.command);
@@ -3709,6 +3800,17 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
3709
3800
  cwd,
3710
3801
  timeout: data.timeout || 3e4
3711
3802
  });
3803
+ const previewChunkReadResult = await tryHandlePreviewChunkReadCommand(data.command, cwd);
3804
+ if (previewChunkReadResult) {
3805
+ logger.debug("Shell command handled as preview chunk read:", {
3806
+ success: previewChunkReadResult.success,
3807
+ exitCode: previewChunkReadResult.exitCode,
3808
+ error: previewChunkReadResult.error,
3809
+ stdoutLen: previewChunkReadResult.stdout?.length ?? 0,
3810
+ stderrLen: previewChunkReadResult.stderr?.length ?? 0
3811
+ });
3812
+ return previewChunkReadResult;
3813
+ }
3712
3814
  const result = await runShellCommand({
3713
3815
  command: data.command,
3714
3816
  cwd,
@@ -7313,6 +7415,7 @@ exports.acquireDaemonLock = acquireDaemonLock;
7313
7415
  exports.api = api;
7314
7416
  exports.backoff = backoff;
7315
7417
  exports.buildClientHeaders = buildClientHeaders;
7418
+ exports.buildSessionRuntimeIndex = buildSessionRuntimeIndex;
7316
7419
  exports.buildSocketAuth = buildSocketAuth;
7317
7420
  exports.clearCredentials = clearCredentials;
7318
7421
  exports.clearDaemonState = clearDaemonState;
@@ -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.44";
21
+ var version = "2.1.47";
22
22
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
23
23
  var author = "long.zhu";
24
24
  var license = "MIT";
@@ -3674,6 +3674,97 @@ function quoteShellArgument(value) {
3674
3674
  }
3675
3675
  return `'${value.replace(/'/g, `'"'"'`)}'`;
3676
3676
  }
3677
+ const APP_PREVIEW_CHUNK_READ_SCRIPT = 'const fs=require("fs"); const p=process.argv[1]; const start=Number(process.argv[2]); const len=Number(process.argv[3]); const data=fs.readFileSync(p).toString("base64"); process.stdout.write(data.slice(start,start+len)); process.stderr.write(data.slice(start+len,start+len*2));';
3678
+ const MAX_PREVIEW_CHUNK_READ_OFFSET = 25e5;
3679
+ const MAX_PREVIEW_CHUNK_READ_LENGTH = 64e3;
3680
+ function parseShellWords(command) {
3681
+ const words = [];
3682
+ let index = 0;
3683
+ while (index < command.length) {
3684
+ while (index < command.length && /\s/.test(command[index])) {
3685
+ index += 1;
3686
+ }
3687
+ if (index >= command.length) {
3688
+ break;
3689
+ }
3690
+ let word = "";
3691
+ while (index < command.length && !/\s/.test(command[index])) {
3692
+ const char = command[index];
3693
+ if (char === "'") {
3694
+ index += 1;
3695
+ let closed = false;
3696
+ while (index < command.length) {
3697
+ const quotedChar = command[index];
3698
+ if (quotedChar === "'") {
3699
+ closed = true;
3700
+ index += 1;
3701
+ break;
3702
+ }
3703
+ word += quotedChar;
3704
+ index += 1;
3705
+ }
3706
+ if (!closed) {
3707
+ return null;
3708
+ }
3709
+ continue;
3710
+ }
3711
+ if (char === "\\" && index + 1 < command.length) {
3712
+ word += command[index + 1];
3713
+ index += 2;
3714
+ continue;
3715
+ }
3716
+ word += char;
3717
+ index += 1;
3718
+ }
3719
+ words.push(word);
3720
+ }
3721
+ return words;
3722
+ }
3723
+ function parsePreviewChunkReadCommand(command) {
3724
+ const words = parseShellWords(command);
3725
+ if (!words || words.length !== 6) {
3726
+ return null;
3727
+ }
3728
+ const [nodeCommand, nodeFlag, script, filePath, startText, lengthText] = words;
3729
+ if (nodeCommand !== "node" || nodeFlag !== "-e" || script !== APP_PREVIEW_CHUNK_READ_SCRIPT) {
3730
+ return null;
3731
+ }
3732
+ const start = Number(startText);
3733
+ const length = Number(lengthText);
3734
+ if (!Number.isSafeInteger(start) || start < 0 || start > MAX_PREVIEW_CHUNK_READ_OFFSET) {
3735
+ return null;
3736
+ }
3737
+ if (!Number.isSafeInteger(length) || length <= 0 || length > MAX_PREVIEW_CHUNK_READ_LENGTH) {
3738
+ return null;
3739
+ }
3740
+ return { filePath, start, length };
3741
+ }
3742
+ async function tryHandlePreviewChunkReadCommand(command, cwd) {
3743
+ const parsedCommand = parsePreviewChunkReadCommand(command);
3744
+ if (!parsedCommand) {
3745
+ return null;
3746
+ }
3747
+ try {
3748
+ const filePath = resolve(cwd ?? process.cwd(), parsedCommand.filePath);
3749
+ const buffer = await readFile$1(filePath);
3750
+ const base64 = buffer.toString("base64");
3751
+ return {
3752
+ success: true,
3753
+ stdout: base64.slice(parsedCommand.start, parsedCommand.start + parsedCommand.length),
3754
+ stderr: base64.slice(parsedCommand.start + parsedCommand.length, parsedCommand.start + parsedCommand.length * 2),
3755
+ exitCode: 0
3756
+ };
3757
+ } catch (error) {
3758
+ const message = error instanceof Error ? error.message : "Failed to read file";
3759
+ return {
3760
+ success: false,
3761
+ stdout: "",
3762
+ stderr: message,
3763
+ exitCode: 1,
3764
+ error: message
3765
+ };
3766
+ }
3767
+ }
3677
3768
  function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
3678
3769
  rpcHandlerManager.registerHandler("bash", async (data) => {
3679
3770
  logger.debug("Shell command request:", data.command);
@@ -3689,6 +3780,17 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
3689
3780
  cwd,
3690
3781
  timeout: data.timeout || 3e4
3691
3782
  });
3783
+ const previewChunkReadResult = await tryHandlePreviewChunkReadCommand(data.command, cwd);
3784
+ if (previewChunkReadResult) {
3785
+ logger.debug("Shell command handled as preview chunk read:", {
3786
+ success: previewChunkReadResult.success,
3787
+ exitCode: previewChunkReadResult.exitCode,
3788
+ error: previewChunkReadResult.error,
3789
+ stdoutLen: previewChunkReadResult.stdout?.length ?? 0,
3790
+ stderrLen: previewChunkReadResult.stderr?.length ?? 0
3791
+ });
3792
+ return previewChunkReadResult;
3793
+ }
3692
3794
  const result = await runShellCommand({
3693
3795
  command: data.command,
3694
3796
  cwd,
@@ -7277,4 +7379,4 @@ var api = /*#__PURE__*/Object.freeze({
7277
7379
  ApiClient: ApiClient
7278
7380
  });
7279
7381
 
7280
- export { ApiClient as A, writeCredentialsDataKey as B, readDaemonState as C, HAPPY_CLOUD_DAEMON_PORT as D, clearDaemonState as E, packageJson as F, acquireDaemonLock as G, HeadTailPreviewBuffer as H, writeDaemonState as I, releaseDaemonLock as J, validateProfileForAgent as K, getProfileEnvironmentVariables as L, clearCredentials as M, clearMachineId as N, readHappyOrgDispatchTruthSnapshot as O, processHappyOrgRepoRequests as P, readHappyOrgRepoTaskBoard as Q, HappyOrgTurnReportSchema as R, recordHappyOrgTurnReport as S, MessageContentSchema as T, buildSocketAuth as U, encrypt as V, getLatestDaemonLog as W, persistence as X, api as Y, ApiSessionClient as a, connectionState as b, configuration as c, AssistantMessageStream as d, HAPPY_ORG_REPLY_ACK_VERSION as e, HAPPY_ORG_TURN_REPORT_TAG as f, HAPPY_ORG_SUMMARY_MAX_LENGTH as g, hashObject as h, isAuthenticationRequiredError as i, HAPPY_ORG_REPEAT_THRESHOLD as j, backoff as k, logger as l, delay as m, normalizePreviewableArtifactTarget as n, AsyncLock as o, preserveSessionRuntimeMetadata as p, encodeBase64 as q, readSettings as r, startOfflineReconnection as s, readCredentials as t, ensureSigningCredentials as u, updateSettings as v, encodeBase64Url as w, buildClientHeaders as x, decodeBase64 as y, writeCredentialsLegacy as z };
7382
+ export { ApiClient as A, writeCredentialsDataKey as B, readDaemonState as C, HAPPY_CLOUD_DAEMON_PORT as D, clearDaemonState as E, packageJson as F, buildSessionRuntimeIndex as G, HeadTailPreviewBuffer as H, acquireDaemonLock as I, writeDaemonState as J, releaseDaemonLock as K, validateProfileForAgent as L, getProfileEnvironmentVariables as M, clearCredentials as N, clearMachineId as O, readHappyOrgDispatchTruthSnapshot as P, processHappyOrgRepoRequests as Q, readHappyOrgRepoTaskBoard as R, HappyOrgTurnReportSchema as S, recordHappyOrgTurnReport as T, MessageContentSchema as U, buildSocketAuth as V, encrypt as W, getLatestDaemonLog as X, persistence as Y, api as Z, ApiSessionClient as a, connectionState as b, configuration as c, AssistantMessageStream as d, HAPPY_ORG_REPLY_ACK_VERSION as e, HAPPY_ORG_TURN_REPORT_TAG as f, HAPPY_ORG_SUMMARY_MAX_LENGTH as g, hashObject as h, isAuthenticationRequiredError as i, HAPPY_ORG_REPEAT_THRESHOLD as j, backoff as k, logger as l, delay as m, normalizePreviewableArtifactTarget as n, AsyncLock as o, preserveSessionRuntimeMetadata as p, encodeBase64 as q, readSettings as r, startOfflineReconnection as s, readCredentials as t, ensureSigningCredentials as u, updateSettings as v, encodeBase64Url as w, buildClientHeaders as x, decodeBase64 as y, writeCredentialsLegacy as z };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-kIN8gN9G.cjs');
3
+ var index = require('./index-CyW9A7hx.cjs');
4
4
  require('chalk');
5
- require('./api-BoWVQeVe.cjs');
5
+ require('./api-CVuTajTL.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -20,7 +20,6 @@ require('path');
20
20
  require('node:child_process');
21
21
  require('expo-server-sdk');
22
22
  require('os');
23
- require('tmp');
24
23
  require('qrcode-terminal');
25
24
  require('node:module');
26
25
  require('open');
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-DxF1W0nt.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-Cp1I5I3U.mjs';
2
2
  import 'chalk';
3
- import './api-BhMVpzwg.mjs';
3
+ import './api-D3vYIva3.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -18,7 +18,6 @@ import 'path';
18
18
  import 'node:child_process';
19
19
  import 'expo-server-sdk';
20
20
  import 'os';
21
- import 'tmp';
22
21
  import 'qrcode-terminal';
23
22
  import 'node:module';
24
23
  import 'open';