happy-imou-cloud 2.1.4 → 2.1.5

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 +38 -38
  2. package/dist/{BaseReasoningProcessor-lTsZVuAU.mjs → BaseReasoningProcessor-CTWoJTb8.mjs} +3 -3
  3. package/dist/{BaseReasoningProcessor-DgdsExMH.cjs → BaseReasoningProcessor-DsunYoSL.cjs} +3 -3
  4. package/dist/{ProviderSelectionHandler-Bavm9TDG.cjs → ProviderSelectionHandler-BxcgZ5df.cjs} +2 -2
  5. package/dist/{ProviderSelectionHandler-CGTnB7ba.mjs → ProviderSelectionHandler-LiWZjziD.mjs} +2 -2
  6. package/dist/{api-B6ESNpGB.cjs → api-DOn5w7Lv.cjs} +2 -2
  7. package/dist/{api-l8X03rs-.mjs → api-RxQ4bfJm.mjs} +2 -2
  8. package/dist/{command-BVCkEMtp.mjs → command-BZ8G4IiN.mjs} +3 -3
  9. package/dist/{command-DPLKOzMr.cjs → command-C3XGNSfh.cjs} +3 -3
  10. package/dist/{index-D1BP-fEm.cjs → index-C06zeR85.cjs} +11 -11
  11. package/dist/{index-D72RMo5Z.mjs → index-CQEVJsPp.mjs} +8 -8
  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-CyFjFOlN.mjs → persistence-Bf5FdmEK.mjs} +1 -1
  17. package/dist/{persistence-EDmI-c8T.cjs → persistence-DuakVvfB.cjs} +1 -1
  18. package/dist/{registerKillSessionHandler-71xCO8e_.cjs → registerKillSessionHandler-BRC1HO05.cjs} +72 -8
  19. package/dist/{registerKillSessionHandler-DAVhkb-l.mjs → registerKillSessionHandler-BuzsaxI2.mjs} +72 -8
  20. package/dist/{runClaude-DjnTGJGC.cjs → runClaude-C8Lx-Xij.cjs} +5 -5
  21. package/dist/{runClaude-BRhQLKjh.mjs → runClaude-Cg8x5JOI.mjs} +5 -5
  22. package/dist/{runCodex-DUs_jBE-.mjs → runCodex-e4wK1OuI.mjs} +6 -6
  23. package/dist/{runCodex-BHq7Rnq7.cjs → runCodex-rYroXLgt.cjs} +6 -6
  24. package/dist/{runGemini-hkZeOnA_.cjs → runGemini-Bjw2PSMh.cjs} +5 -5
  25. package/dist/{runGemini-pmvBZ6qU.mjs → runGemini-Cd1FWJJ_.mjs} +5 -5
  26. package/package.json +2 -2
  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
@@ -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,6 +1,6 @@
1
- import { p as publishSessionRegistration } from './index-D72RMo5Z.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-l8X03rs-.mjs';
3
- import { c as createSessionMetadata } from './registerKillSessionHandler-DAVhkb-l.mjs';
1
+ import { p as publishSessionRegistration } from './index-CQEVJsPp.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-RxQ4bfJm.mjs';
3
+ import { c as createSessionMetadata } from './registerKillSessionHandler-BuzsaxI2.mjs';
4
4
  import { EventEmitter } from 'node:events';
5
5
  import { randomUUID } from 'node:crypto';
6
6
 
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D1BP-fEm.cjs');
4
- var api = require('./api-B6ESNpGB.cjs');
5
- var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
3
+ var index = require('./index-C06zeR85.cjs');
4
+ var api = require('./api-DOn5w7Lv.cjs');
5
+ var registerKillSessionHandler = require('./registerKillSessionHandler-BRC1HO05.cjs');
6
6
  var node_events = require('node:events');
7
7
  var node_crypto = require('node:crypto');
8
8
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-B6ESNpGB.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-71xCO8e_.cjs');
3
+ var api = require('./api-DOn5w7Lv.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-BRC1HO05.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-l8X03rs-.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-DAVhkb-l.mjs';
1
+ import { l as logger } from './api-RxQ4bfJm.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BuzsaxI2.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  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.4";
21
+ var version = "2.1.5";
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-EDmI-c8T.cjs'); });
436
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-DuakVvfB.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.4";
19
+ var version = "2.1.5";
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-CyFjFOlN.mjs');
434
+ const { readDaemonState } = await import('./persistence-Bf5FdmEK.mjs');
435
435
  const state = await readDaemonState();
436
436
  if (!state) {
437
437
  return logs;
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-D72RMo5Z.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-CQEVJsPp.mjs';
2
2
  import 'chalk';
3
- import './api-l8X03rs-.mjs';
3
+ import './api-RxQ4bfJm.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-CyFjFOlN.mjs';
19
+ import './persistence-Bf5FdmEK.mjs';
20
20
  import 'node:fs/promises';
21
21
  import 'os';
22
22
  import 'tmp';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D1BP-fEm.cjs');
3
+ var index = require('./index-C06zeR85.cjs');
4
4
  require('chalk');
5
- require('./api-B6ESNpGB.cjs');
5
+ require('./api-DOn5w7Lv.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-EDmI-c8T.cjs');
21
+ require('./persistence-DuakVvfB.cjs');
22
22
  require('node:fs/promises');
23
23
  require('os');
24
24
  require('tmp');
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var api = require('./api-B6ESNpGB.cjs');
5
- var persistence = require('./persistence-EDmI-c8T.cjs');
4
+ var api = require('./api-DOn5w7Lv.cjs');
5
+ var persistence = require('./persistence-DuakVvfB.cjs');
6
6
  var z = require('zod');
7
7
  var fs$2 = require('fs/promises');
8
8
  var os$1 = require('os');
@@ -72,7 +72,7 @@ async function openBrowser(url) {
72
72
  }
73
73
  }
74
74
 
75
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D1BP-fEm.cjs', document.baseURI).href)));
75
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C06zeR85.cjs', document.baseURI).href)));
76
76
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
77
77
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
78
78
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -695,7 +695,7 @@ function setupCleanupHandlers() {
695
695
  });
696
696
  }
697
697
 
698
- const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D1BP-fEm.cjs', document.baseURI).href))));
698
+ const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C06zeR85.cjs', document.baseURI).href))));
699
699
  function projectPath() {
700
700
  const path = path$1.resolve(__dirname$2, "..");
701
701
  return path;
@@ -8265,7 +8265,7 @@ class AbortError extends Error {
8265
8265
  }
8266
8266
  }
8267
8267
 
8268
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D1BP-fEm.cjs', document.baseURI).href)));
8268
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C06zeR85.cjs', document.baseURI).href)));
8269
8269
  const __dirname$1 = path.join(__filename$1, "..");
8270
8270
  function getGlobalClaudeVersion() {
8271
8271
  try {
@@ -9516,11 +9516,11 @@ var launch = /*#__PURE__*/Object.freeze({
9516
9516
 
9517
9517
  const unifiedProviderExecutors = {
9518
9518
  claude: async (opts) => {
9519
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-DjnTGJGC.cjs'); });
9519
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-C8Lx-Xij.cjs'); });
9520
9520
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9521
9521
  },
9522
9522
  codex: async (opts) => {
9523
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-BHq7Rnq7.cjs'); });
9523
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-rYroXLgt.cjs'); });
9524
9524
  await runCodex({
9525
9525
  credentials: opts.credentials,
9526
9526
  startedBy: opts.startedBy,
@@ -9529,7 +9529,7 @@ const unifiedProviderExecutors = {
9529
9529
  });
9530
9530
  },
9531
9531
  gemini: async (opts) => {
9532
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-hkZeOnA_.cjs'); });
9532
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Bjw2PSMh.cjs'); });
9533
9533
  await runGemini({
9534
9534
  credentials: opts.credentials,
9535
9535
  startedBy: opts.startedBy
@@ -9605,7 +9605,7 @@ function shouldRunMainClaudeFlow(opts) {
9605
9605
  return;
9606
9606
  } else if (subcommand === "runtime") {
9607
9607
  if (args[1] === "providers") {
9608
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-DPLKOzMr.cjs'); });
9608
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-C3XGNSfh.cjs'); });
9609
9609
  console.log(renderRuntimeProviders());
9610
9610
  return;
9611
9611
  }
@@ -9783,8 +9783,8 @@ function shouldRunMainClaudeFlow(opts) {
9783
9783
  const projectId = args[3];
9784
9784
  try {
9785
9785
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
9786
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-EDmI-c8T.cjs'); });
9787
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-B6ESNpGB.cjs'); }).then(function (n) { return n.api; });
9786
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-DuakVvfB.cjs'); });
9787
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DOn5w7Lv.cjs'); }).then(function (n) { return n.api; });
9788
9788
  let userEmail = void 0;
9789
9789
  try {
9790
9790
  const credentials = await readCredentials2();
@@ -1,6 +1,6 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
- import { l as logger, e as encodeBase64, c as configuration, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-l8X03rs-.mjs';
3
- import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-CyFjFOlN.mjs';
2
+ import { l as logger, e as encodeBase64, c as configuration, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-RxQ4bfJm.mjs';
3
+ import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-Bf5FdmEK.mjs';
4
4
  import { z } from 'zod';
5
5
  import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
6
6
  import os, { homedir } from 'os';
@@ -9494,11 +9494,11 @@ var launch = /*#__PURE__*/Object.freeze({
9494
9494
 
9495
9495
  const unifiedProviderExecutors = {
9496
9496
  claude: async (opts) => {
9497
- const { runClaude } = await import('./runClaude-BRhQLKjh.mjs');
9497
+ const { runClaude } = await import('./runClaude-Cg8x5JOI.mjs');
9498
9498
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9499
9499
  },
9500
9500
  codex: async (opts) => {
9501
- const { runCodex } = await import('./runCodex-DUs_jBE-.mjs');
9501
+ const { runCodex } = await import('./runCodex-e4wK1OuI.mjs');
9502
9502
  await runCodex({
9503
9503
  credentials: opts.credentials,
9504
9504
  startedBy: opts.startedBy,
@@ -9507,7 +9507,7 @@ const unifiedProviderExecutors = {
9507
9507
  });
9508
9508
  },
9509
9509
  gemini: async (opts) => {
9510
- const { runGemini } = await import('./runGemini-pmvBZ6qU.mjs');
9510
+ const { runGemini } = await import('./runGemini-Cd1FWJJ_.mjs');
9511
9511
  await runGemini({
9512
9512
  credentials: opts.credentials,
9513
9513
  startedBy: opts.startedBy
@@ -9583,7 +9583,7 @@ function shouldRunMainClaudeFlow(opts) {
9583
9583
  return;
9584
9584
  } else if (subcommand === "runtime") {
9585
9585
  if (args[1] === "providers") {
9586
- const { renderRuntimeProviders } = await import('./command-BVCkEMtp.mjs');
9586
+ const { renderRuntimeProviders } = await import('./command-BZ8G4IiN.mjs');
9587
9587
  console.log(renderRuntimeProviders());
9588
9588
  return;
9589
9589
  }
@@ -9761,8 +9761,8 @@ function shouldRunMainClaudeFlow(opts) {
9761
9761
  const projectId = args[3];
9762
9762
  try {
9763
9763
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
9764
- const { readCredentials: readCredentials2 } = await import('./persistence-CyFjFOlN.mjs');
9765
- const { ApiClient: ApiClient2 } = await import('./api-l8X03rs-.mjs').then(function (n) { return n.v; });
9764
+ const { readCredentials: readCredentials2 } = await import('./persistence-Bf5FdmEK.mjs');
9765
+ const { ApiClient: ApiClient2 } = await import('./api-RxQ4bfJm.mjs').then(function (n) { return n.v; });
9766
9766
  let userEmail = void 0;
9767
9767
  try {
9768
9768
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-B6ESNpGB.cjs');
5
- require('./persistence-EDmI-c8T.cjs');
4
+ require('./api-DOn5w7Lv.cjs');
5
+ require('./persistence-DuakVvfB.cjs');
6
6
  require('zod');
7
- require('./index-D1BP-fEm.cjs');
7
+ require('./index-C06zeR85.cjs');
8
8
  require('node:child_process');
9
9
  require('node:fs');
10
10
  require('cross-spawn');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './api-l8X03rs-.mjs';
3
- import './persistence-CyFjFOlN.mjs';
2
+ import './api-RxQ4bfJm.mjs';
3
+ import './persistence-Bf5FdmEK.mjs';
4
4
  import 'zod';
5
- import './index-D72RMo5Z.mjs';
5
+ import './index-CQEVJsPp.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:fs';
8
8
  import 'cross-spawn';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-B6ESNpGB.cjs');
3
+ var api = require('./api-DOn5w7Lv.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-l8X03rs-.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-RxQ4bfJm.mjs';
2
2
  export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
3
3
  import 'axios';
4
4
  import 'chalk';
@@ -1,7 +1,7 @@
1
1
  import { unlink, readFile, mkdir, open, stat, writeFile, rename } from 'node:fs/promises';
2
2
  import { existsSync, unlinkSync, readdirSync, constants, writeFileSync, readFileSync } from 'node:fs';
3
3
  import { join, dirname } from 'node:path';
4
- import { c as configuration, l as logger, e as encodeBase64 } from './api-l8X03rs-.mjs';
4
+ import { c as configuration, l as logger, e as encodeBase64 } from './api-RxQ4bfJm.mjs';
5
5
  import * as z from 'zod';
6
6
  import 'axios';
7
7
  import 'chalk';
@@ -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-B6ESNpGB.cjs');
6
+ var api = require('./api-DOn5w7Lv.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-D1BP-fEm.cjs');
4
- var persistence = require('./persistence-EDmI-c8T.cjs');
3
+ var index = require('./index-C06zeR85.cjs');
4
+ var persistence = require('./persistence-DuakVvfB.cjs');
5
5
  var os = require('node:os');
6
6
  var path = require('node:path');
7
- var api = require('./api-B6ESNpGB.cjs');
7
+ var api = require('./api-DOn5w7Lv.cjs');
8
8
  var node_crypto = require('node:crypto');
9
9
  var crypto = require('crypto');
10
10
  require('axios');
@@ -116,6 +116,62 @@ function attachToolHappierMetaV2(value, meta) {
116
116
  };
117
117
  }
118
118
 
119
+ const DISPLAY_FRIENDLY_TOOL_FIELDS = ["stdout", "stderr", "output", "text", "message", "detail", "reason", "data"];
120
+ function isRecord(value) {
121
+ return !!value && typeof value === "object" && !Array.isArray(value);
122
+ }
123
+ function stripInternalToolMeta(value) {
124
+ if (!isRecord(value)) {
125
+ return value;
126
+ }
127
+ const {
128
+ _happier: _ignoredHappier,
129
+ _happy: _ignoredHappy,
130
+ ...rest
131
+ } = value;
132
+ return rest;
133
+ }
134
+ function extractNestedTextContent(value) {
135
+ if (typeof value === "string") {
136
+ return value.trim().length > 0 ? value : null;
137
+ }
138
+ if (Array.isArray(value)) {
139
+ const parts = value.map((item) => extractNestedTextContent(item)).filter((item) => typeof item === "string" && item.length > 0);
140
+ return parts.length > 0 ? parts.join("\n") : null;
141
+ }
142
+ if (!isRecord(value)) {
143
+ return null;
144
+ }
145
+ if (typeof value.text === "string" && value.text.trim().length > 0) {
146
+ return value.text;
147
+ }
148
+ if ("content" in value) {
149
+ return extractNestedTextContent(value.content);
150
+ }
151
+ return null;
152
+ }
153
+ function normalizeCodexToolInput(value) {
154
+ return stripInternalToolMeta(value);
155
+ }
156
+ function normalizeCodexToolOutput(value) {
157
+ const sanitized = stripInternalToolMeta(value);
158
+ if (!isRecord(sanitized)) {
159
+ return sanitized;
160
+ }
161
+ const hasDisplayFriendlyField = DISPLAY_FRIENDLY_TOOL_FIELDS.some((field) => field in sanitized);
162
+ if (hasDisplayFriendlyField || !("content" in sanitized)) {
163
+ return sanitized;
164
+ }
165
+ const flattenedText = extractNestedTextContent(sanitized.content);
166
+ if (!flattenedText) {
167
+ return sanitized;
168
+ }
169
+ const { content: _content, ...rest } = sanitized;
170
+ return {
171
+ ...rest,
172
+ text: flattenedText
173
+ };
174
+ }
119
175
  function getDefaultExecToolName(provider) {
120
176
  switch (provider) {
121
177
  case "claude":
@@ -146,6 +202,14 @@ function attachToolMeta(provider, rawToolName, value) {
146
202
  canonicalToolName
147
203
  });
148
204
  }
205
+ function prepareToolInput(provider, rawToolName, value) {
206
+ const enriched = attachToolMeta(provider, rawToolName, value);
207
+ return provider === "codex" ? normalizeCodexToolInput(enriched) : enriched;
208
+ }
209
+ function prepareToolOutput(provider, rawToolName, value) {
210
+ const enriched = attachToolMeta(provider, rawToolName, value);
211
+ return provider === "codex" ? normalizeCodexToolOutput(enriched) : enriched;
212
+ }
149
213
  function forwardAgentMessageToProviderSession(msg, options) {
150
214
  const createId = options.createId ?? node_crypto.randomUUID;
151
215
  const toolResultType = options.toolResultType ?? "tool-result";
@@ -155,7 +219,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
155
219
  type: "tool-call",
156
220
  name: index.resolveCanonicalToolNameV2(msg.toolName),
157
221
  callId: msg.callId,
158
- input: attachToolMeta(options.provider, msg.toolName, msg.args),
222
+ input: prepareToolInput(options.provider, msg.toolName, msg.args),
159
223
  id: createId()
160
224
  });
161
225
  return true;
@@ -164,7 +228,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
164
228
  options.send({
165
229
  type: toolResultType,
166
230
  callId: msg.callId,
167
- output: attachToolMeta(options.provider, msg.toolName, msg.result),
231
+ output: prepareToolOutput(options.provider, msg.toolName, msg.result),
168
232
  id: createId(),
169
233
  isError: inferToolResultError(msg.result)
170
234
  });
@@ -206,7 +270,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
206
270
  type: "tool-call",
207
271
  name: index.resolveCanonicalToolNameV2(rawToolName),
208
272
  callId: call_id,
209
- input: attachToolMeta(options.provider, rawToolName, inputs),
273
+ input: prepareToolInput(options.provider, rawToolName, inputs),
210
274
  id: createId()
211
275
  });
212
276
  return true;
@@ -217,7 +281,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
217
281
  type: "tool-call",
218
282
  name: index.resolveCanonicalToolNameV2(rawToolName),
219
283
  callId: msg.call_id,
220
- input: attachToolMeta(options.provider, rawToolName, {
284
+ input: prepareToolInput(options.provider, rawToolName, {
221
285
  auto_approved: msg.auto_approved,
222
286
  changes: msg.changes
223
287
  }),
@@ -230,7 +294,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
230
294
  options.send({
231
295
  type: toolResultType,
232
296
  callId: msg.call_id,
233
- output: attachToolMeta(options.provider, rawToolName, {
297
+ output: prepareToolOutput(options.provider, rawToolName, {
234
298
  stdout: msg.stdout,
235
299
  stderr: msg.stderr,
236
300
  success: msg.success