happy-imou-cloud 2.1.44 → 2.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseReasoningProcessor-CMyFNQ1O.cjs → BaseReasoningProcessor-Bsnew7fc.cjs} +2 -2
- package/dist/{BaseReasoningProcessor-DVSN7PCw.mjs → BaseReasoningProcessor-Mrdbmfl3.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-2IaDlDBx.mjs → ProviderSelectionHandler-BymmO261.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-Dqa4j1pD.cjs → ProviderSelectionHandler-gaUVvyCU.cjs} +2 -2
- package/dist/{api-BoWVQeVe.cjs → api-Bekjk9d5.cjs} +104 -1
- package/dist/{api-BhMVpzwg.mjs → api-DTSpLLTK.mjs} +104 -2
- package/dist/{command-DoF8oaxg.cjs → command-BwhJX0G5.cjs} +2 -2
- package/dist/{command-h3Rr4Abu.mjs → command-umgXYSY2.mjs} +2 -2
- package/dist/{index-DxF1W0nt.mjs → index-CUVIZLuf.mjs} +270 -29
- package/dist/{index-kIN8gN9G.cjs → index-DkaYNlRO.cjs} +274 -30
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +86 -86
- package/dist/lib.d.mts +86 -86
- package/dist/lib.mjs +1 -1
- package/dist/{registerKillSessionHandler-CBm2WFM0.cjs → registerKillSessionHandler-BYWJJDre.cjs} +10 -5
- package/dist/{registerKillSessionHandler-Dsg63Cx6.mjs → registerKillSessionHandler-hQE08yMO.mjs} +10 -6
- package/dist/{runClaude-BpwlCyVT.mjs → runClaude-CFeIMCY2.mjs} +11 -8
- package/dist/{runClaude-Dq9OISKt.cjs → runClaude-jpo2aFey.cjs} +11 -8
- package/dist/{runCodex-BMNR2hNp.mjs → runCodex-ByjUfTyr.mjs} +496 -59
- package/dist/{runCodex-BnzErOK_.cjs → runCodex-CrxyWcga.cjs} +496 -59
- package/dist/{runGemini-CYc9Ufxo.cjs → runGemini-BhIz1N_b.cjs} +11 -8
- package/dist/{runGemini-D4Af8oH1.mjs → runGemini-CihCRgcR.mjs} +11 -8
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var persistence = require('./api-
|
|
3
|
+
var index = require('./index-DkaYNlRO.cjs');
|
|
4
|
+
var persistence = require('./api-Bekjk9d5.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-
|
|
2
|
-
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-
|
|
1
|
+
import { a as createSessionMetadata, p as publishSessionRegistration } from './index-CUVIZLuf.mjs';
|
|
2
|
+
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-DTSpLLTK.mjs';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
|
package/dist/{ProviderSelectionHandler-2IaDlDBx.mjs → ProviderSelectionHandler-BymmO261.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as logger } from './api-
|
|
2
|
-
import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-
|
|
1
|
+
import { l as logger } from './api-DTSpLLTK.mjs';
|
|
2
|
+
import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-hQE08yMO.mjs';
|
|
3
3
|
|
|
4
4
|
async function runModeLoop(opts) {
|
|
5
5
|
let currentMode = opts.startingMode;
|
package/dist/{ProviderSelectionHandler-Dqa4j1pD.cjs → ProviderSelectionHandler-gaUVvyCU.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var persistence = require('./api-
|
|
4
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
3
|
+
var persistence = require('./api-Bekjk9d5.cjs');
|
|
4
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-BYWJJDre.cjs');
|
|
5
5
|
|
|
6
6
|
async function runModeLoop(opts) {
|
|
7
7
|
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.
|
|
41
|
+
var version = "2.1.46";
|
|
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.
|
|
21
|
+
var version = "2.1.46";
|
|
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,
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { c as createDefaultRuntimeShell } from './index-
|
|
1
|
+
import { c as createDefaultRuntimeShell } from './index-CUVIZLuf.mjs';
|
|
2
2
|
import 'chalk';
|
|
3
|
-
import './api-
|
|
3
|
+
import './api-DTSpLLTK.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'node:fs';
|