happy-imou-cloud 2.1.4 → 2.1.6
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/bin/happy-cloud.mjs +38 -38
- package/dist/{BaseReasoningProcessor-DgdsExMH.cjs → BaseReasoningProcessor-C3oDrA4i.cjs} +17 -4
- package/dist/{BaseReasoningProcessor-lTsZVuAU.mjs → BaseReasoningProcessor-CRXr7Axk.mjs} +16 -3
- package/dist/{ProviderSelectionHandler-CGTnB7ba.mjs → ProviderSelectionHandler-C3kHFqeq.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-Bavm9TDG.cjs → ProviderSelectionHandler-Drg2Pp1-.cjs} +2 -2
- package/dist/{api-B6ESNpGB.cjs → api-CvtU4DI-.cjs} +2 -2
- package/dist/{api-l8X03rs-.mjs → api-DF9A136-.mjs} +3 -3
- package/dist/{command-DPLKOzMr.cjs → command-UZr1nodh.cjs} +3 -3
- package/dist/{command-BVCkEMtp.mjs → command-hO52qTzQ.mjs} +3 -3
- package/dist/{index-D72RMo5Z.mjs → index-B5e-MA1d.mjs} +268 -32
- package/dist/{index-D1BP-fEm.cjs → index-DA-K28E3.cjs} +264 -24
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +36 -36
- package/dist/lib.d.mts +36 -36
- package/dist/lib.mjs +1 -1
- package/dist/{persistence-CyFjFOlN.mjs → persistence-BsWBBi7E.mjs} +1 -1
- package/dist/{persistence-EDmI-c8T.cjs → persistence-CKgPuZRR.cjs} +1 -1
- package/dist/{registerKillSessionHandler-71xCO8e_.cjs → registerKillSessionHandler-3ytO-yBI.cjs} +72 -79
- package/dist/{registerKillSessionHandler-DAVhkb-l.mjs → registerKillSessionHandler-DmG1p8l7.mjs} +73 -78
- package/dist/{runClaude-BRhQLKjh.mjs → runClaude-MF34EsCp.mjs} +103 -40
- package/dist/{runClaude-DjnTGJGC.cjs → runClaude-bAlUdUGw.cjs} +106 -43
- package/dist/{runCodex-DUs_jBE-.mjs → runCodex-B31D_imZ.mjs} +10 -8
- package/dist/{runCodex-BHq7Rnq7.cjs → runCodex-CiIbJ1wa.cjs} +12 -10
- package/dist/{runGemini-pmvBZ6qU.mjs → runGemini-BJ7PxLyl.mjs} +5 -5
- package/dist/{runGemini-hkZeOnA_.cjs → runGemini-BZJR84o-.cjs} +7 -7
- package/package.json +2 -2
package/bin/happy-cloud.mjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { execFileSync } from 'child_process';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { join, dirname } from 'path';
|
|
6
|
-
import { ensureAcpSdkCompat } from '../scripts/ensureAcpSdkCompat.mjs';
|
|
7
|
-
|
|
8
|
-
// Check if we're already running with the flags
|
|
9
|
-
const hasNoWarnings = process.execArgv.includes('--no-warnings');
|
|
10
|
-
const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
|
|
11
|
-
|
|
12
|
-
if (!hasNoWarnings || !hasNoDeprecation) {
|
|
13
|
-
// Get path to the actual CLI entrypoint
|
|
14
|
-
const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
-
const entrypoint = join(projectRoot, 'dist', 'index.mjs');
|
|
16
|
-
|
|
17
|
-
ensureAcpSdkCompat();
|
|
18
|
-
|
|
19
|
-
// Execute the actual CLI directly with the correct flags
|
|
20
|
-
try {
|
|
21
|
-
execFileSync(process.execPath, [
|
|
22
|
-
'--no-warnings',
|
|
23
|
-
'--no-deprecation',
|
|
24
|
-
entrypoint,
|
|
25
|
-
...process.argv.slice(2)
|
|
26
|
-
], {
|
|
27
|
-
stdio: 'inherit',
|
|
28
|
-
env: process.env
|
|
29
|
-
});
|
|
30
|
-
} catch (error) {
|
|
31
|
-
// execFileSync throws if the process exits with non-zero
|
|
32
|
-
process.exit(error.status || 1);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
// We're running Node with the flags we wanted, import the CLI entrypoint
|
|
36
|
-
// module to avoid creating a new process.
|
|
37
|
-
ensureAcpSdkCompat();
|
|
38
|
-
import("../dist/index.mjs");
|
|
39
|
-
}
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { join, dirname } from 'path';
|
|
6
|
+
import { ensureAcpSdkCompat } from '../scripts/ensureAcpSdkCompat.mjs';
|
|
7
|
+
|
|
8
|
+
// Check if we're already running with the flags
|
|
9
|
+
const hasNoWarnings = process.execArgv.includes('--no-warnings');
|
|
10
|
+
const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
|
|
11
|
+
|
|
12
|
+
if (!hasNoWarnings || !hasNoDeprecation) {
|
|
13
|
+
// Get path to the actual CLI entrypoint
|
|
14
|
+
const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const entrypoint = join(projectRoot, 'dist', 'index.mjs');
|
|
16
|
+
|
|
17
|
+
ensureAcpSdkCompat();
|
|
18
|
+
|
|
19
|
+
// Execute the actual CLI directly with the correct flags
|
|
20
|
+
try {
|
|
21
|
+
execFileSync(process.execPath, [
|
|
22
|
+
'--no-warnings',
|
|
23
|
+
'--no-deprecation',
|
|
24
|
+
entrypoint,
|
|
25
|
+
...process.argv.slice(2)
|
|
26
|
+
], {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
env: process.env
|
|
29
|
+
});
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// execFileSync throws if the process exits with non-zero
|
|
32
|
+
process.exit(error.status || 1);
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
// We're running Node with the flags we wanted, import the CLI entrypoint
|
|
36
|
+
// module to avoid creating a new process.
|
|
37
|
+
ensureAcpSdkCompat();
|
|
38
|
+
import("../dist/index.mjs");
|
|
39
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var api = require('./api-
|
|
5
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
|
|
3
|
+
var index = require('./index-DA-K28E3.cjs');
|
|
4
|
+
var api = require('./api-CvtU4DI-.cjs');
|
|
6
5
|
var node_events = require('node:events');
|
|
7
6
|
var node_crypto = require('node:crypto');
|
|
8
7
|
|
|
@@ -86,11 +85,21 @@ function setupOfflineReconnection(opts) {
|
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
async function bootstrapManagedProviderSession(opts) {
|
|
89
|
-
const { state, metadata } =
|
|
88
|
+
const { state, metadata } = index.createSessionMetadata({
|
|
90
89
|
flavor: opts.flavor,
|
|
91
90
|
machineId: opts.machineId,
|
|
92
91
|
startedBy: opts.startedBy
|
|
93
92
|
});
|
|
93
|
+
const reconcileAttachedSessionMetadata = (session2) => {
|
|
94
|
+
if (!opts.reconcileMetadataOnAttach) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
session2.updateMetadata(() => metadata);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
api.logger.debug(`[managed-session] Failed to reconcile metadata for ${opts.flavor} session`, error);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
94
103
|
let response = null;
|
|
95
104
|
try {
|
|
96
105
|
response = await opts.api.getOrCreateSession({
|
|
@@ -112,9 +121,13 @@ async function bootstrapManagedProviderSession(opts) {
|
|
|
112
121
|
response,
|
|
113
122
|
onSessionSwap: (newSession) => {
|
|
114
123
|
opts.onSessionSwap?.(newSession, metadata);
|
|
124
|
+
reconcileAttachedSessionMetadata(newSession);
|
|
115
125
|
void index.publishSessionRegistration(newSession.sessionId, metadata);
|
|
116
126
|
}
|
|
117
127
|
});
|
|
128
|
+
if (response) {
|
|
129
|
+
reconcileAttachedSessionMetadata(session);
|
|
130
|
+
}
|
|
118
131
|
if (response) {
|
|
119
132
|
await index.publishSessionRegistration(response.id, metadata);
|
|
120
133
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { p as publishSessionRegistration } from './index-
|
|
2
|
-
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-
|
|
3
|
-
import { c as createSessionMetadata } from './registerKillSessionHandler-DAVhkb-l.mjs';
|
|
1
|
+
import { a as createSessionMetadata, p as publishSessionRegistration } from './index-B5e-MA1d.mjs';
|
|
2
|
+
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-DF9A136-.mjs';
|
|
4
3
|
import { EventEmitter } from 'node:events';
|
|
5
4
|
import { randomUUID } from 'node:crypto';
|
|
6
5
|
|
|
@@ -89,6 +88,16 @@ async function bootstrapManagedProviderSession(opts) {
|
|
|
89
88
|
machineId: opts.machineId,
|
|
90
89
|
startedBy: opts.startedBy
|
|
91
90
|
});
|
|
91
|
+
const reconcileAttachedSessionMetadata = (session2) => {
|
|
92
|
+
if (!opts.reconcileMetadataOnAttach) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
session2.updateMetadata(() => metadata);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
logger.debug(`[managed-session] Failed to reconcile metadata for ${opts.flavor} session`, error);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
92
101
|
let response = null;
|
|
93
102
|
try {
|
|
94
103
|
response = await opts.api.getOrCreateSession({
|
|
@@ -110,9 +119,13 @@ async function bootstrapManagedProviderSession(opts) {
|
|
|
110
119
|
response,
|
|
111
120
|
onSessionSwap: (newSession) => {
|
|
112
121
|
opts.onSessionSwap?.(newSession, metadata);
|
|
122
|
+
reconcileAttachedSessionMetadata(newSession);
|
|
113
123
|
void publishSessionRegistration(newSession.sessionId, metadata);
|
|
114
124
|
}
|
|
115
125
|
});
|
|
126
|
+
if (response) {
|
|
127
|
+
reconcileAttachedSessionMetadata(session);
|
|
128
|
+
}
|
|
116
129
|
if (response) {
|
|
117
130
|
await publishSessionRegistration(response.id, metadata);
|
|
118
131
|
}
|
package/dist/{ProviderSelectionHandler-CGTnB7ba.mjs → ProviderSelectionHandler-C3kHFqeq.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-DF9A136-.mjs';
|
|
2
|
+
import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-DmG1p8l7.mjs';
|
|
3
3
|
|
|
4
4
|
async function runModeLoop(opts) {
|
|
5
5
|
let currentMode = opts.startingMode;
|
package/dist/{ProviderSelectionHandler-Bavm9TDG.cjs → ProviderSelectionHandler-Drg2Pp1-.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var api = require('./api-
|
|
4
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
3
|
+
var api = require('./api-CvtU4DI-.cjs');
|
|
4
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-3ytO-yBI.cjs');
|
|
5
5
|
|
|
6
6
|
async function runModeLoop(opts) {
|
|
7
7
|
let currentMode = opts.startingMode;
|
|
@@ -18,7 +18,7 @@ var node_child_process = require('node:child_process');
|
|
|
18
18
|
var expoServerSdk = require('expo-server-sdk');
|
|
19
19
|
|
|
20
20
|
var name = "happy-imou-cloud";
|
|
21
|
-
var version = "2.1.
|
|
21
|
+
var version = "2.1.6";
|
|
22
22
|
var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
|
|
23
23
|
var author = "long.zhu";
|
|
24
24
|
var license = "MIT";
|
|
@@ -433,7 +433,7 @@ async function listDaemonLogFiles(limit = 50) {
|
|
|
433
433
|
return { file, path: fullPath, modified: stats.mtime };
|
|
434
434
|
}).sort((a, b) => b.modified.getTime() - a.modified.getTime());
|
|
435
435
|
try {
|
|
436
|
-
const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-
|
|
436
|
+
const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-CKgPuZRR.cjs'); });
|
|
437
437
|
const state = await readDaemonState();
|
|
438
438
|
if (!state) {
|
|
439
439
|
return logs;
|
|
@@ -16,7 +16,7 @@ import { spawn } from 'node:child_process';
|
|
|
16
16
|
import { Expo } from 'expo-server-sdk';
|
|
17
17
|
|
|
18
18
|
var name = "happy-imou-cloud";
|
|
19
|
-
var version = "2.1.
|
|
19
|
+
var version = "2.1.6";
|
|
20
20
|
var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
|
|
21
21
|
var author = "long.zhu";
|
|
22
22
|
var license = "MIT";
|
|
@@ -431,7 +431,7 @@ async function listDaemonLogFiles(limit = 50) {
|
|
|
431
431
|
return { file, path: fullPath, modified: stats.mtime };
|
|
432
432
|
}).sort((a, b) => b.modified.getTime() - a.modified.getTime());
|
|
433
433
|
try {
|
|
434
|
-
const { readDaemonState } = await import('./persistence-
|
|
434
|
+
const { readDaemonState } = await import('./persistence-BsWBBi7E.mjs');
|
|
435
435
|
const state = await readDaemonState();
|
|
436
436
|
if (!state) {
|
|
437
437
|
return logs;
|
|
@@ -3645,4 +3645,4 @@ var api = /*#__PURE__*/Object.freeze({
|
|
|
3645
3645
|
ApiClient: ApiClient
|
|
3646
3646
|
});
|
|
3647
3647
|
|
|
3648
|
-
export { ApiClient as A, HAPPY_ORG_TURN_REPORT_TAG as H, SigningBootstrapRequiredError as S, ApiSessionClient as a, connectionState as b, configuration as c, HAPPY_ORG_SUMMARY_MAX_LENGTH as d, encodeBase64 as e, HAPPY_ORG_REPEAT_THRESHOLD as f, backoff as g, delay as h, isAuthenticationRequiredError as i, AsyncLock as j, buildAuthenticatedHeaders as k, logger as l, SIGNING_BOOTSTRAP_REQUIRED_MESSAGE as m, encodeBase64Url as n, buildClientHeaders as o,
|
|
3648
|
+
export { ApiClient as A, HAPPY_ORG_TURN_REPORT_TAG as H, SigningBootstrapRequiredError as S, ApiSessionClient as a, connectionState as b, configuration as c, HAPPY_ORG_SUMMARY_MAX_LENGTH as d, encodeBase64 as e, HAPPY_ORG_REPEAT_THRESHOLD as f, backoff as g, delay as h, isAuthenticationRequiredError as i, AsyncLock as j, buildAuthenticatedHeaders as k, logger as l, SIGNING_BOOTSTRAP_REQUIRED_MESSAGE as m, encodeBase64Url as n, buildClientHeaders as o, decodeBase64 as p, HAPPY_CLOUD_DAEMON_PORT as q, packageJson as r, startOfflineReconnection as s, HeadTailPreviewBuffer as t, getLatestDaemonLog as u, api as v };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DA-K28E3.cjs');
|
|
4
4
|
require('chalk');
|
|
5
|
-
require('./api-
|
|
5
|
+
require('./api-CvtU4DI-.cjs');
|
|
6
6
|
require('axios');
|
|
7
7
|
require('fs');
|
|
8
8
|
require('node:fs');
|
|
@@ -18,7 +18,7 @@ require('crypto');
|
|
|
18
18
|
require('path');
|
|
19
19
|
require('node:child_process');
|
|
20
20
|
require('expo-server-sdk');
|
|
21
|
-
require('./persistence-
|
|
21
|
+
require('./persistence-CKgPuZRR.cjs');
|
|
22
22
|
require('node:fs/promises');
|
|
23
23
|
require('os');
|
|
24
24
|
require('tmp');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createDefaultRuntimeShell } from './index-
|
|
1
|
+
import { c as createDefaultRuntimeShell } from './index-B5e-MA1d.mjs';
|
|
2
2
|
import 'chalk';
|
|
3
|
-
import './api-
|
|
3
|
+
import './api-DF9A136-.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'node:fs';
|
|
@@ -16,7 +16,7 @@ import 'crypto';
|
|
|
16
16
|
import 'path';
|
|
17
17
|
import 'node:child_process';
|
|
18
18
|
import 'expo-server-sdk';
|
|
19
|
-
import './persistence-
|
|
19
|
+
import './persistence-BsWBBi7E.mjs';
|
|
20
20
|
import 'node:fs/promises';
|
|
21
21
|
import 'os';
|
|
22
22
|
import 'tmp';
|