happy-imou-cloud 2.1.3 → 2.1.4

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 (30) hide show
  1. package/bin/happy-cloud.mjs +39 -39
  2. package/dist/{BaseReasoningProcessor-BrcBFCoL.cjs → BaseReasoningProcessor-DgdsExMH.cjs} +3 -3
  3. package/dist/{BaseReasoningProcessor-CPLK0a8y.mjs → BaseReasoningProcessor-lTsZVuAU.mjs} +3 -3
  4. package/dist/{ProviderSelectionHandler-f7_I3vQa.cjs → ProviderSelectionHandler-Bavm9TDG.cjs} +2 -2
  5. package/dist/{ProviderSelectionHandler-CrXfMTg1.mjs → ProviderSelectionHandler-CGTnB7ba.mjs} +2 -2
  6. package/dist/{api-OoiG7XjD.cjs → api-B6ESNpGB.cjs} +3 -3
  7. package/dist/{api-BGv79x9Q.mjs → api-l8X03rs-.mjs} +3 -3
  8. package/dist/{command-FbV44egL.mjs → command-BVCkEMtp.mjs} +3 -3
  9. package/dist/{command-DAYJSP16.cjs → command-DPLKOzMr.cjs} +3 -3
  10. package/dist/{index-D9lWHpn-.cjs → index-D1BP-fEm.cjs} +406 -34
  11. package/dist/{index-TRC83Ks9.mjs → index-D72RMo5Z.mjs} +403 -31
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.mjs +3 -3
  14. package/dist/lib.cjs +1 -1
  15. package/dist/lib.mjs +1 -1
  16. package/dist/{persistence-Cmgj3ubQ.mjs → persistence-CyFjFOlN.mjs} +1 -1
  17. package/dist/{persistence-lN9HV4IZ.cjs → persistence-EDmI-c8T.cjs} +1 -1
  18. package/dist/{registerKillSessionHandler-pk4Ohq4Y.cjs → registerKillSessionHandler-71xCO8e_.cjs} +6 -5
  19. package/dist/{registerKillSessionHandler-NZd3xieQ.mjs → registerKillSessionHandler-DAVhkb-l.mjs} +6 -5
  20. package/dist/{runClaude-7St9-Jci.mjs → runClaude-BRhQLKjh.mjs} +5 -5
  21. package/dist/{runClaude-BP-O6ucu.cjs → runClaude-DjnTGJGC.cjs} +5 -5
  22. package/dist/{runCodex-BV6kKtTO.cjs → runCodex-BHq7Rnq7.cjs} +6 -6
  23. package/dist/{runCodex-BaXi_9BC.mjs → runCodex-DUs_jBE-.mjs} +6 -6
  24. package/dist/{runGemini-BiYKqJqO.cjs → runGemini-hkZeOnA_.cjs} +6 -6
  25. package/dist/{runGemini-ClNqE9N3.mjs → runGemini-pmvBZ6qU.mjs} +6 -6
  26. package/package.json +3 -3
  27. package/scripts/devtools/README.md +9 -9
  28. package/scripts/e2e/fake-codex-acp-agent.mjs +139 -139
  29. package/scripts/e2e/local-server-session-roundtrip.mjs +1063 -1063
  30. package/scripts/ensureAcpSdkCompat.mjs +1 -1
@@ -3,7 +3,7 @@
3
3
  var promises = require('node:fs/promises');
4
4
  var fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var api = require('./api-OoiG7XjD.cjs');
6
+ var api = require('./api-B6ESNpGB.cjs');
7
7
  var z = require('zod');
8
8
  require('axios');
9
9
  require('chalk');
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D9lWHpn-.cjs');
4
- var persistence = require('./persistence-lN9HV4IZ.cjs');
3
+ var index = require('./index-D1BP-fEm.cjs');
4
+ var persistence = require('./persistence-EDmI-c8T.cjs');
5
5
  var os = require('node:os');
6
6
  var path = require('node:path');
7
- var api = require('./api-OoiG7XjD.cjs');
7
+ var api = require('./api-B6ESNpGB.cjs');
8
8
  var node_crypto = require('node:crypto');
9
9
  var crypto = require('crypto');
10
10
  require('axios');
@@ -302,7 +302,7 @@ function createAbortError() {
302
302
  error.name = "AbortError";
303
303
  return error;
304
304
  }
305
- async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs = 10 * 6e4) {
305
+ async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs) {
306
306
  if (!backend.waitForResponseComplete) {
307
307
  return;
308
308
  }
@@ -312,7 +312,8 @@ async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs = 10
312
312
  await new Promise((resolve, reject) => {
313
313
  const onAbort = () => reject(createAbortError());
314
314
  signal.addEventListener("abort", onAbort, { once: true });
315
- backend.waitForResponseComplete(timeoutMs).then(resolve).catch(reject).finally(() => {
315
+ const completion = backend.waitForResponseComplete() ;
316
+ completion.then(resolve).catch(reject).finally(() => {
316
317
  signal.removeEventListener("abort", onAbort);
317
318
  });
318
319
  });
@@ -1,8 +1,8 @@
1
- import { i as initialMachineMetadata, e as projectPath, R as RuntimeShell, h as resolveCanonicalToolNameV2, f as formatDisplayMessage } from './index-TRC83Ks9.mjs';
2
- import { readSettings } from './persistence-Cmgj3ubQ.mjs';
1
+ import { i as initialMachineMetadata, e as projectPath, R as RuntimeShell, h as resolveCanonicalToolNameV2, f as formatDisplayMessage } from './index-D72RMo5Z.mjs';
2
+ import { readSettings } from './persistence-CyFjFOlN.mjs';
3
3
  import os from 'node:os';
4
4
  import { resolve } from 'node:path';
5
- import { c as configuration, p as packageJson, H as HAPPY_ORG_TURN_REPORT_TAG, d as HAPPY_ORG_SUMMARY_MAX_LENGTH, f as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-BGv79x9Q.mjs';
5
+ import { c as configuration, p as packageJson, H as HAPPY_ORG_TURN_REPORT_TAG, d as HAPPY_ORG_SUMMARY_MAX_LENGTH, f as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-l8X03rs-.mjs';
6
6
  import { randomUUID } from 'node:crypto';
7
7
  import { createHash } from 'crypto';
8
8
  import 'axios';
@@ -300,7 +300,7 @@ function createAbortError() {
300
300
  error.name = "AbortError";
301
301
  return error;
302
302
  }
303
- async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs = 10 * 6e4) {
303
+ async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs) {
304
304
  if (!backend.waitForResponseComplete) {
305
305
  return;
306
306
  }
@@ -310,7 +310,8 @@ async function waitForResponseCompleteWithAbort(backend, signal, timeoutMs = 10
310
310
  await new Promise((resolve, reject) => {
311
311
  const onAbort = () => reject(createAbortError());
312
312
  signal.addEventListener("abort", onAbort, { once: true });
313
- backend.waitForResponseComplete(timeoutMs).then(resolve).catch(reject).finally(() => {
313
+ const completion = backend.waitForResponseComplete() ;
314
+ completion.then(resolve).catch(reject).finally(() => {
314
315
  signal.removeEventListener("abort", onAbort);
315
316
  });
316
317
  });
@@ -1,8 +1,8 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { l as logger, g as backoff, h as delay, j as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-BGv79x9Q.mjs';
2
+ import { l as logger, g as backoff, h as delay, j as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-l8X03rs-.mjs';
3
3
  import 'cross-spawn';
4
4
  import '@agentclientprotocol/sdk';
5
- import { j as getProjectPath, F as Future, k as claudeLocal, E as ExitCodeError, l as trimIdent, m as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, n as claudeCheckSession, e as projectPath, o as mapToClaudeMode, P as PushableAsyncIterable, q as query, A as AbortError, b as stopCaffeinate, p as publishSessionRegistration, u as getEnvironmentInfo, w as startCaffeinate } from './index-TRC83Ks9.mjs';
5
+ import { j as getProjectPath, F as Future, k as claudeLocal, E as ExitCodeError, l as trimIdent, m as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, n as claudeCheckSession, e as projectPath, o as mapToClaudeMode, P as PushableAsyncIterable, q as query, A as AbortError, b as stopCaffeinate, p as publishSessionRegistration, u as getEnvironmentInfo, w as startCaffeinate } from './index-D72RMo5Z.mjs';
6
6
  import 'ps-list';
7
7
  import 'fs';
8
8
  import 'path';
@@ -13,7 +13,7 @@ import { dirname, basename, join, resolve } from 'node:path';
13
13
  import { homedir } from 'node:os';
14
14
  import { execSync } from 'node:child_process';
15
15
  import 'node:readline';
16
- import './persistence-Cmgj3ubQ.mjs';
16
+ import './persistence-CyFjFOlN.mjs';
17
17
  import { readFile } from 'node:fs/promises';
18
18
  import { stat, watch, access } from 'fs/promises';
19
19
  import 'crypto';
@@ -24,9 +24,9 @@ import 'tweetnacl';
24
24
  import 'open';
25
25
  import React, { useState, useRef, useEffect, useCallback } from 'react';
26
26
  import { useStdout, useInput, Box, Text, render } from 'ink';
27
- import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CrXfMTg1.mjs';
27
+ import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CGTnB7ba.mjs';
28
28
  import { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
29
- import { B as BasePermissionHandler, f as MessageBuffer, C as ConversationHistory$1, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, l as launchRuntimeHandleWithFactoryResult, n as forwardAgentMessageToProviderSession, s as syncControlledByUserState, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, c as createSessionMetadata, b as MessageQueue2, h as hashObject, d as registerKillSessionHandler, k as closeProviderSession } from './registerKillSessionHandler-NZd3xieQ.mjs';
29
+ import { B as BasePermissionHandler, f as MessageBuffer, C as ConversationHistory$1, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, l as launchRuntimeHandleWithFactoryResult, n as forwardAgentMessageToProviderSession, s as syncControlledByUserState, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, c as createSessionMetadata, b as MessageQueue2, h as hashObject, d as registerKillSessionHandler, k as closeProviderSession } from './registerKillSessionHandler-DAVhkb-l.mjs';
30
30
  import 'socket.io-client';
31
31
  import 'expo-server-sdk';
32
32
  import { isDeepStrictEqual } from 'node:util';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var node_crypto = require('node:crypto');
4
- var api = require('./api-OoiG7XjD.cjs');
4
+ var api = require('./api-B6ESNpGB.cjs');
5
5
  require('cross-spawn');
6
6
  require('@agentclientprotocol/sdk');
7
- var index = require('./index-D9lWHpn-.cjs');
7
+ var index = require('./index-D1BP-fEm.cjs');
8
8
  require('ps-list');
9
9
  require('fs');
10
10
  require('path');
@@ -15,7 +15,7 @@ var path = require('node:path');
15
15
  var os = require('node:os');
16
16
  var node_child_process = require('node:child_process');
17
17
  require('node:readline');
18
- require('./persistence-lN9HV4IZ.cjs');
18
+ require('./persistence-EDmI-c8T.cjs');
19
19
  var promises = require('node:fs/promises');
20
20
  var fs = require('fs/promises');
21
21
  require('crypto');
@@ -26,9 +26,9 @@ require('tweetnacl');
26
26
  require('open');
27
27
  var React = require('react');
28
28
  var ink = require('ink');
29
- var ProviderSelectionHandler = require('./ProviderSelectionHandler-f7_I3vQa.cjs');
29
+ var ProviderSelectionHandler = require('./ProviderSelectionHandler-Bavm9TDG.cjs');
30
30
  var types = require('./types-DVk3crez.cjs');
31
- var registerKillSessionHandler = require('./registerKillSessionHandler-pk4Ohq4Y.cjs');
31
+ var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
32
32
  require('socket.io-client');
33
33
  require('expo-server-sdk');
34
34
  var node_util = require('node:util');
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var node_crypto = require('node:crypto');
4
- var api = require('./api-OoiG7XjD.cjs');
5
- var registerKillSessionHandler = require('./registerKillSessionHandler-pk4Ohq4Y.cjs');
6
- var index = require('./index-D9lWHpn-.cjs');
4
+ var api = require('./api-B6ESNpGB.cjs');
5
+ var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
6
+ var index = require('./index-D1BP-fEm.cjs');
7
7
  require('cross-spawn');
8
8
  require('@agentclientprotocol/sdk');
9
9
  require('ps-list');
@@ -16,7 +16,7 @@ require('node:path');
16
16
  require('node:os');
17
17
  require('node:child_process');
18
18
  require('node:readline');
19
- require('./persistence-lN9HV4IZ.cjs');
19
+ require('./persistence-EDmI-c8T.cjs');
20
20
  require('node:fs/promises');
21
21
  require('fs/promises');
22
22
  require('crypto');
@@ -27,8 +27,8 @@ require('tweetnacl');
27
27
  require('open');
28
28
  var React = require('react');
29
29
  var ink = require('ink');
30
- var ProviderSelectionHandler = require('./ProviderSelectionHandler-f7_I3vQa.cjs');
31
- var BaseReasoningProcessor = require('./BaseReasoningProcessor-BrcBFCoL.cjs');
30
+ var ProviderSelectionHandler = require('./ProviderSelectionHandler-Bavm9TDG.cjs');
31
+ var BaseReasoningProcessor = require('./BaseReasoningProcessor-DgdsExMH.cjs');
32
32
  require('zod');
33
33
  require('socket.io-client');
34
34
  require('expo-server-sdk');
@@ -1,7 +1,7 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { l as logger, b as connectionState, A as ApiClient } from './api-BGv79x9Q.mjs';
3
- import { B as BasePermissionHandler, h as hashObject, f as MessageBuffer, C as ConversationHistory$1, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, d as registerKillSessionHandler, l as launchRuntimeHandleWithFactoryResult, m as inferToolResultError, n as forwardAgentMessageToProviderSession, k as closeProviderSession, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, r as resolveHappyOrgQueuedTurn, s as syncControlledByUserState } from './registerKillSessionHandler-NZd3xieQ.mjs';
4
- import { f as formatDisplayMessage, v as validateCodexAcpSpawn, d as createCodexBackend, t as truncateDisplayMessage, b as stopCaffeinate } from './index-TRC83Ks9.mjs';
2
+ import { l as logger, b as connectionState, A as ApiClient } from './api-l8X03rs-.mjs';
3
+ import { B as BasePermissionHandler, h as hashObject, f as MessageBuffer, C as ConversationHistory$1, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, d as registerKillSessionHandler, l as launchRuntimeHandleWithFactoryResult, m as inferToolResultError, n as forwardAgentMessageToProviderSession, k as closeProviderSession, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, r as resolveHappyOrgQueuedTurn, s as syncControlledByUserState } from './registerKillSessionHandler-DAVhkb-l.mjs';
4
+ import { f as formatDisplayMessage, v as validateCodexAcpSpawn, d as createCodexBackend, t as truncateDisplayMessage, b as stopCaffeinate } from './index-D72RMo5Z.mjs';
5
5
  import 'cross-spawn';
6
6
  import '@agentclientprotocol/sdk';
7
7
  import 'ps-list';
@@ -14,7 +14,7 @@ import 'node:path';
14
14
  import 'node:os';
15
15
  import 'node:child_process';
16
16
  import 'node:readline';
17
- import './persistence-Cmgj3ubQ.mjs';
17
+ import './persistence-CyFjFOlN.mjs';
18
18
  import 'node:fs/promises';
19
19
  import 'fs/promises';
20
20
  import 'crypto';
@@ -25,8 +25,8 @@ import 'tweetnacl';
25
25
  import 'open';
26
26
  import React, { useState, useRef, useEffect, useCallback } from 'react';
27
27
  import { useStdout, useInput, Box, Text, render } from 'ink';
28
- import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CrXfMTg1.mjs';
29
- import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-CPLK0a8y.mjs';
28
+ import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CGTnB7ba.mjs';
29
+ import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-lTsZVuAU.mjs';
30
30
  import 'zod';
31
31
  import 'socket.io-client';
32
32
  import 'expo-server-sdk';
@@ -3,10 +3,10 @@
3
3
  var ink = require('ink');
4
4
  var React = require('react');
5
5
  var node_crypto = require('node:crypto');
6
- var api = require('./api-OoiG7XjD.cjs');
7
- var registerKillSessionHandler = require('./registerKillSessionHandler-pk4Ohq4Y.cjs');
8
- var index = require('./index-D9lWHpn-.cjs');
9
- var BaseReasoningProcessor = require('./BaseReasoningProcessor-BrcBFCoL.cjs');
6
+ var api = require('./api-B6ESNpGB.cjs');
7
+ var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
8
+ var index = require('./index-D1BP-fEm.cjs');
9
+ var BaseReasoningProcessor = require('./BaseReasoningProcessor-DgdsExMH.cjs');
10
10
  require('cross-spawn');
11
11
  require('@agentclientprotocol/sdk');
12
12
  require('ps-list');
@@ -17,7 +17,7 @@ require('node:child_process');
17
17
  require('node:readline');
18
18
  require('tweetnacl');
19
19
  require('axios');
20
- require('./persistence-lN9HV4IZ.cjs');
20
+ require('./persistence-EDmI-c8T.cjs');
21
21
  require('open');
22
22
  require('chalk');
23
23
  require('fs');
@@ -1181,7 +1181,7 @@ Guide: https://goo.gle/gemini-cli-auth-docs#workspace-gca`;
1181
1181
  try {
1182
1182
  await activeHandle.sendPrompt(promptToSend);
1183
1183
  api.logger.debug("[gemini] Prompt sent successfully");
1184
- await registerKillSessionHandler.waitForResponseCompleteWithAbort(activeHandle.backend, abortController.signal, 10 * 6e4);
1184
+ await registerKillSessionHandler.waitForResponseCompleteWithAbort(activeHandle.backend, abortController.signal);
1185
1185
  api.logger.debug("[gemini] Response complete");
1186
1186
  shouldInjectHistoryOnNextSession = false;
1187
1187
  break;
@@ -1,10 +1,10 @@
1
1
  import { useStdout, useInput, Box, Text, render } from 'ink';
2
2
  import React, { useState, useRef, useEffect, useCallback } from 'react';
3
3
  import { randomUUID } from 'node:crypto';
4
- import { l as logger, b as connectionState, A as ApiClient } from './api-BGv79x9Q.mjs';
5
- import { B as BasePermissionHandler, C as ConversationHistory$1, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, s as syncControlledByUserState, b as MessageQueue2, h as hashObject, d as registerKillSessionHandler, f as MessageBuffer, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, k as closeProviderSession, l as launchRuntimeHandleWithFactoryResult, m as inferToolResultError, n as forwardAgentMessageToProviderSession } from './registerKillSessionHandler-NZd3xieQ.mjs';
6
- import { g as getInitialGeminiModel, r as readGeminiLocalConfig, G as GEMINI_MODEL_ENV, s as saveGeminiModelToConfig, a as createGeminiBackend, b as stopCaffeinate } from './index-TRC83Ks9.mjs';
7
- import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-CPLK0a8y.mjs';
4
+ import { l as logger, b as connectionState, A as ApiClient } from './api-l8X03rs-.mjs';
5
+ import { B as BasePermissionHandler, C as ConversationHistory$1, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, s as syncControlledByUserState, b as MessageQueue2, h as hashObject, d as registerKillSessionHandler, f as MessageBuffer, i as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, j as finalizeHappyOrgTurn, k as closeProviderSession, l as launchRuntimeHandleWithFactoryResult, m as inferToolResultError, n as forwardAgentMessageToProviderSession } from './registerKillSessionHandler-DAVhkb-l.mjs';
6
+ import { g as getInitialGeminiModel, r as readGeminiLocalConfig, G as GEMINI_MODEL_ENV, s as saveGeminiModelToConfig, a as createGeminiBackend, b as stopCaffeinate } from './index-D72RMo5Z.mjs';
7
+ import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-lTsZVuAU.mjs';
8
8
  import 'cross-spawn';
9
9
  import '@agentclientprotocol/sdk';
10
10
  import 'ps-list';
@@ -15,7 +15,7 @@ import 'node:child_process';
15
15
  import 'node:readline';
16
16
  import 'tweetnacl';
17
17
  import 'axios';
18
- import './persistence-Cmgj3ubQ.mjs';
18
+ import './persistence-CyFjFOlN.mjs';
19
19
  import 'open';
20
20
  import 'chalk';
21
21
  import 'fs';
@@ -1179,7 +1179,7 @@ Guide: https://goo.gle/gemini-cli-auth-docs#workspace-gca`;
1179
1179
  try {
1180
1180
  await activeHandle.sendPrompt(promptToSend);
1181
1181
  logger.debug("[gemini] Prompt sent successfully");
1182
- await waitForResponseCompleteWithAbort(activeHandle.backend, abortController.signal, 10 * 6e4);
1182
+ await waitForResponseCompleteWithAbort(activeHandle.backend, abortController.signal);
1183
1183
  logger.debug("[gemini] Response complete");
1184
1184
  shouldInjectHistoryOnNextSession = false;
1185
1185
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "happy-imou-cloud",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI",
5
5
  "author": "long.zhu",
6
6
  "license": "MIT",
@@ -85,7 +85,7 @@
85
85
  "unlink:dev": "node scripts/link-dev.cjs unlink"
86
86
  },
87
87
  "dependencies": {
88
- "@agentclientprotocol/sdk": "0.14.1",
88
+ "@agentclientprotocol/sdk": "0.16.1",
89
89
  "@stablelib/base64": "^2.0.1",
90
90
  "@stablelib/hex": "^2.0.1",
91
91
  "@types/cross-spawn": "^6.0.6",
@@ -125,7 +125,7 @@
125
125
  "shx": "^0.3.3",
126
126
  "ts-node": "^10",
127
127
  "tsx": "^4.20.6",
128
- "typescript": "5.9.3",
128
+ "typescript": "5.9.3",
129
129
  "vitest": "^3.2.4"
130
130
  },
131
131
  "resolutions": {
@@ -1,9 +1,9 @@
1
- # CLI Devtools
2
-
3
- 这组脚本用于 CLI 本地开发辅助。
4
-
5
- 当前包含:
6
-
7
- - mock credentials 生成器
8
-
9
- 新增 CLI 专属开发脚本应优先放在这里。
1
+ # CLI Devtools
2
+
3
+ 这组脚本用于 CLI 本地开发辅助。
4
+
5
+ 当前包含:
6
+
7
+ - mock credentials 生成器
8
+
9
+ 新增 CLI 专属开发脚本应优先放在这里。
@@ -1,139 +1,139 @@
1
- #!/usr/bin/env node
2
-
3
- import { appendFileSync } from 'node:fs';
4
-
5
- const decoder = new TextDecoder();
6
- let buffer = '';
7
- let sessionId = 'fake-codex-session';
8
- const logPath = process.env.HAPPY_E2E_FAKE_ACP_LOG || '';
9
-
10
- function send(payload) {
11
- process.stdout.write(`${JSON.stringify(payload)}\n`);
12
- }
13
-
14
- function trace(message) {
15
- if (!logPath) {
16
- return;
17
- }
18
-
19
- appendFileSync(logPath, `${message}\n`, 'utf8');
20
- }
21
-
22
- function ok(id, result) {
23
- send({
24
- jsonrpc: '2.0',
25
- id,
26
- result,
27
- });
28
- }
29
-
30
- function parsePromptText(params) {
31
- const blocks = Array.isArray(params?.prompt) ? params.prompt : [];
32
- return blocks
33
- .map((block) => (block && typeof block === 'object' && typeof block.text === 'string' ? block.text : ''))
34
- .filter(Boolean)
35
- .join('\n');
36
- }
37
-
38
- function emitPromptResponse(promptText) {
39
- const replyPrefix = process.env.HAPPY_E2E_FAKE_ACP_RESPONSE || 'LOCAL_E2E_ACK';
40
- const replyText = `${replyPrefix}: ${promptText}`.trim();
41
- trace(`prompt=${JSON.stringify(promptText)}`);
42
- trace(`reply=${JSON.stringify(replyText)}`);
43
-
44
- setTimeout(() => {
45
- send({
46
- jsonrpc: '2.0',
47
- method: 'session/update',
48
- params: {
49
- sessionId,
50
- update: {
51
- sessionUpdate: 'agent_message_chunk',
52
- content: {
53
- type: 'text',
54
- text: replyText,
55
- },
56
- },
57
- },
58
- });
59
-
60
- send({
61
- jsonrpc: '2.0',
62
- method: 'session/update',
63
- params: {
64
- sessionId,
65
- update: {
66
- sessionUpdate: 'task_complete',
67
- usage: {
68
- input_tokens: Math.max(1, promptText.length),
69
- output_tokens: Math.max(1, replyText.length),
70
- total_tokens: Math.max(2, promptText.length + replyText.length),
71
- },
72
- },
73
- },
74
- });
75
- }, 50);
76
- }
77
-
78
- process.stdin.on('data', (chunk) => {
79
- buffer += decoder.decode(chunk, { stream: true });
80
- const lines = buffer.split('\n');
81
- buffer = lines.pop() || '';
82
-
83
- for (const line of lines) {
84
- const trimmed = line.trim();
85
- if (!trimmed) {
86
- continue;
87
- }
88
-
89
- let request;
90
- try {
91
- request = JSON.parse(trimmed);
92
- } catch {
93
- continue;
94
- }
95
-
96
- const id = request?.id;
97
- const method = request?.method;
98
-
99
- if (typeof method !== 'string' || id === undefined || id === null) {
100
- continue;
101
- }
102
-
103
- trace(`method=${method}`);
104
-
105
- if (method === 'initialize') {
106
- ok(id, {
107
- protocolVersion: 1,
108
- authMethods: [],
109
- });
110
- continue;
111
- }
112
-
113
- if (method === 'session/new') {
114
- sessionId = request?.params?.cwd
115
- ? `fake-codex-session:${request.params.cwd}`
116
- : 'fake-codex-session';
117
- ok(id, { sessionId });
118
- continue;
119
- }
120
-
121
- if (method === 'session/prompt') {
122
- ok(id, {});
123
- emitPromptResponse(parsePromptText(request?.params));
124
- continue;
125
- }
126
-
127
- if (method === 'session/cancel') {
128
- ok(id, {});
129
- continue;
130
- }
131
-
132
- ok(id, {});
133
- }
134
- });
135
-
136
- process.stdin.on('end', () => {
137
- trace('stdin=end');
138
- process.exit(0);
139
- });
1
+ #!/usr/bin/env node
2
+
3
+ import { appendFileSync } from 'node:fs';
4
+
5
+ const decoder = new TextDecoder();
6
+ let buffer = '';
7
+ let sessionId = 'fake-codex-session';
8
+ const logPath = process.env.HAPPY_E2E_FAKE_ACP_LOG || '';
9
+
10
+ function send(payload) {
11
+ process.stdout.write(`${JSON.stringify(payload)}\n`);
12
+ }
13
+
14
+ function trace(message) {
15
+ if (!logPath) {
16
+ return;
17
+ }
18
+
19
+ appendFileSync(logPath, `${message}\n`, 'utf8');
20
+ }
21
+
22
+ function ok(id, result) {
23
+ send({
24
+ jsonrpc: '2.0',
25
+ id,
26
+ result,
27
+ });
28
+ }
29
+
30
+ function parsePromptText(params) {
31
+ const blocks = Array.isArray(params?.prompt) ? params.prompt : [];
32
+ return blocks
33
+ .map((block) => (block && typeof block === 'object' && typeof block.text === 'string' ? block.text : ''))
34
+ .filter(Boolean)
35
+ .join('\n');
36
+ }
37
+
38
+ function emitPromptResponse(promptText) {
39
+ const replyPrefix = process.env.HAPPY_E2E_FAKE_ACP_RESPONSE || 'LOCAL_E2E_ACK';
40
+ const replyText = `${replyPrefix}: ${promptText}`.trim();
41
+ trace(`prompt=${JSON.stringify(promptText)}`);
42
+ trace(`reply=${JSON.stringify(replyText)}`);
43
+
44
+ setTimeout(() => {
45
+ send({
46
+ jsonrpc: '2.0',
47
+ method: 'session/update',
48
+ params: {
49
+ sessionId,
50
+ update: {
51
+ sessionUpdate: 'agent_message_chunk',
52
+ content: {
53
+ type: 'text',
54
+ text: replyText,
55
+ },
56
+ },
57
+ },
58
+ });
59
+
60
+ send({
61
+ jsonrpc: '2.0',
62
+ method: 'session/update',
63
+ params: {
64
+ sessionId,
65
+ update: {
66
+ sessionUpdate: 'task_complete',
67
+ usage: {
68
+ input_tokens: Math.max(1, promptText.length),
69
+ output_tokens: Math.max(1, replyText.length),
70
+ total_tokens: Math.max(2, promptText.length + replyText.length),
71
+ },
72
+ },
73
+ },
74
+ });
75
+ }, 50);
76
+ }
77
+
78
+ process.stdin.on('data', (chunk) => {
79
+ buffer += decoder.decode(chunk, { stream: true });
80
+ const lines = buffer.split('\n');
81
+ buffer = lines.pop() || '';
82
+
83
+ for (const line of lines) {
84
+ const trimmed = line.trim();
85
+ if (!trimmed) {
86
+ continue;
87
+ }
88
+
89
+ let request;
90
+ try {
91
+ request = JSON.parse(trimmed);
92
+ } catch {
93
+ continue;
94
+ }
95
+
96
+ const id = request?.id;
97
+ const method = request?.method;
98
+
99
+ if (typeof method !== 'string' || id === undefined || id === null) {
100
+ continue;
101
+ }
102
+
103
+ trace(`method=${method}`);
104
+
105
+ if (method === 'initialize') {
106
+ ok(id, {
107
+ protocolVersion: 1,
108
+ authMethods: [],
109
+ });
110
+ continue;
111
+ }
112
+
113
+ if (method === 'session/new') {
114
+ sessionId = request?.params?.cwd
115
+ ? `fake-codex-session:${request.params.cwd}`
116
+ : 'fake-codex-session';
117
+ ok(id, { sessionId });
118
+ continue;
119
+ }
120
+
121
+ if (method === 'session/prompt') {
122
+ ok(id, {});
123
+ emitPromptResponse(parsePromptText(request?.params));
124
+ continue;
125
+ }
126
+
127
+ if (method === 'session/cancel') {
128
+ ok(id, {});
129
+ continue;
130
+ }
131
+
132
+ ok(id, {});
133
+ }
134
+ });
135
+
136
+ process.stdin.on('end', () => {
137
+ trace('stdin=end');
138
+ process.exit(0);
139
+ });