happy-imou-cloud 2.1.26 → 2.1.27
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-KMtgV6ap.mjs → BaseReasoningProcessor-C5fKjdpv.mjs} +2 -2
- package/dist/{BaseReasoningProcessor-0e-Wwv5i.cjs → BaseReasoningProcessor-Cc9g89Zo.cjs} +2 -2
- package/dist/{ProviderSelectionHandler-CG8ktb5b.mjs → ProviderSelectionHandler-CqMvpE6K.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-CzRyfT1v.cjs → ProviderSelectionHandler-DANtoYaW.cjs} +2 -2
- package/dist/{api-hgzFUi7o.cjs → api-BVXbJ3M_.cjs} +46 -11
- package/dist/{api-DugHuNd4.mjs → api-CuWWLsDI.mjs} +47 -12
- package/dist/{command-DU0KWNsf.mjs → command-C7KnQtPU.mjs} +2 -2
- package/dist/{command-Dh8sawXu.cjs → command-CKw7FVJ3.cjs} +2 -2
- package/dist/{index-ythl_OD6.cjs → index-BBD69Ds-.cjs} +75 -26
- package/dist/{index-hj-qbq8Y.mjs → index-DPNRq_mT.mjs} +72 -23
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/{registerKillSessionHandler-BNzbdofF.mjs → registerKillSessionHandler-BVIaG4zk.mjs} +59 -7
- package/dist/{registerKillSessionHandler-Q_rOuCNA.cjs → registerKillSessionHandler-CeO8n78A.cjs} +59 -6
- package/dist/{runClaude-BUi2fgRI.cjs → runClaude-DU69fser.cjs} +7 -6
- package/dist/{runClaude-Y84RT6V0.mjs → runClaude-DWSBt6tE.mjs} +7 -6
- package/dist/{runCodex-D2xIzHke.mjs → runCodex-C3VoO79w.mjs} +15 -10
- package/dist/{runCodex-vO3-iZ8E.cjs → runCodex-DFH1tiGD.cjs} +15 -10
- package/dist/{runGemini-CAotw19V.mjs → runGemini-CCbOfI6U.mjs} +12 -7
- package/dist/{runGemini-DIKiIVdN.cjs → runGemini-QTOE7LXy.cjs} +12 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
|
|
2
|
-
import { l as logger,
|
|
2
|
+
import { l as logger, k as encodeBase64, c as configuration, m as readCredentials, n as ensureSigningCredentials, r as readSettings, u as updateSettings, o as encodeBase64Url, h as delay, q as buildClientHeaders, t as decodeBase64, w as writeCredentialsLegacy, v as writeCredentialsDataKey, x as readDaemonState, y as HAPPY_CLOUD_DAEMON_PORT, z as clearDaemonState, B as packageJson, i as isAuthenticationRequiredError, C as acquireDaemonLock, D as writeDaemonState, A as ApiClient, E as releaseDaemonLock, F as validateProfileForAgent, G as getProfileEnvironmentVariables, I as clearCredentials, J as clearMachineId, M as MessageContentSchema, K as buildSocketAuth, L as encrypt, H as HeadTailPreviewBuffer, N as getLatestDaemonLog } from './api-CuWWLsDI.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
|
|
5
5
|
import os$1, { homedir } from 'os';
|
|
@@ -705,7 +705,8 @@ function runWindowsProcessSnapshotQuery(command) {
|
|
|
705
705
|
],
|
|
706
706
|
{
|
|
707
707
|
stdio: "pipe",
|
|
708
|
-
maxBuffer: WINDOWS_PROCESS_QUERY_MAX_BUFFER_BYTES
|
|
708
|
+
maxBuffer: WINDOWS_PROCESS_QUERY_MAX_BUFFER_BYTES,
|
|
709
|
+
windowsHide: true
|
|
709
710
|
}
|
|
710
711
|
);
|
|
711
712
|
if (result.error || result.status !== 0) {
|
|
@@ -835,7 +836,7 @@ async function killRunawayHappyProcesses() {
|
|
|
835
836
|
try {
|
|
836
837
|
console.log(`Killing runaway process PID ${pid}: ${command}`);
|
|
837
838
|
if (process.platform === "win32") {
|
|
838
|
-
const result = spawn$1.sync("taskkill", ["/F", "/PID", pid.toString()], { stdio: "pipe" });
|
|
839
|
+
const result = spawn$1.sync("taskkill", ["/F", "/PID", pid.toString()], { stdio: "pipe", windowsHide: true });
|
|
839
840
|
if (result.error) throw result.error;
|
|
840
841
|
if (result.status !== 0) throw new Error(`taskkill exited with code ${result.status}`);
|
|
841
842
|
} else {
|
|
@@ -978,7 +979,7 @@ async function killOrphanDaemonProcesses() {
|
|
|
978
979
|
for (const proc of orphanDaemons) {
|
|
979
980
|
try {
|
|
980
981
|
if (process.platform === "win32") {
|
|
981
|
-
execFileSync("taskkill", ["/F", "/PID", proc.pid.toString()], { stdio: "ignore" });
|
|
982
|
+
execFileSync("taskkill", ["/F", "/PID", proc.pid.toString()], { stdio: "ignore", windowsHide: true });
|
|
982
983
|
} else {
|
|
983
984
|
process.kill(proc.pid, "SIGKILL");
|
|
984
985
|
}
|
|
@@ -5578,7 +5579,8 @@ async function claudeLocal(opts) {
|
|
|
5578
5579
|
stdio: ["inherit", "inherit", "inherit", "pipe"],
|
|
5579
5580
|
signal: opts.abort,
|
|
5580
5581
|
cwd: opts.path,
|
|
5581
|
-
env
|
|
5582
|
+
env,
|
|
5583
|
+
windowsHide: true
|
|
5582
5584
|
});
|
|
5583
5585
|
if (child.stdio[3]) {
|
|
5584
5586
|
const rl = createInterface({
|
|
@@ -6473,8 +6475,8 @@ const cursorTransport = new CursorTransport();
|
|
|
6473
6475
|
|
|
6474
6476
|
const DEFAULT_IDLE_TIMEOUT_MS = 500;
|
|
6475
6477
|
const DEFAULT_TOOL_CALL_TIMEOUT_MS = 10 * 6e4;
|
|
6476
|
-
const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES =
|
|
6477
|
-
const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES =
|
|
6478
|
+
const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES = 4096;
|
|
6479
|
+
const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES = 12288;
|
|
6478
6480
|
function parseArgsFromContent(content) {
|
|
6479
6481
|
if (Array.isArray(content)) {
|
|
6480
6482
|
return { items: content };
|
|
@@ -7081,6 +7083,7 @@ function buildAcpSpawnSpec(params) {
|
|
|
7081
7083
|
}
|
|
7082
7084
|
|
|
7083
7085
|
const MAX_DROPPED_LINE_PREVIEW_CHARS = 4096;
|
|
7086
|
+
const DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES = 128 * 1024;
|
|
7084
7087
|
function formatDroppedLinePreview(line) {
|
|
7085
7088
|
if (line.length <= MAX_DROPPED_LINE_PREVIEW_CHARS) {
|
|
7086
7089
|
return line;
|
|
@@ -7093,7 +7096,7 @@ function formatDroppedLinePreview(line) {
|
|
|
7093
7096
|
${line.slice(-tailChars)}`;
|
|
7094
7097
|
}
|
|
7095
7098
|
function createAcpFilteredStdoutReadable(params) {
|
|
7096
|
-
const maxMultilineBytes = typeof params.maxMultilineBytes === "number" && Number.isFinite(params.maxMultilineBytes) && params.maxMultilineBytes > 0 ? Math.trunc(params.maxMultilineBytes) :
|
|
7099
|
+
const maxMultilineBytes = typeof params.maxMultilineBytes === "number" && Number.isFinite(params.maxMultilineBytes) && params.maxMultilineBytes > 0 ? Math.trunc(params.maxMultilineBytes) : DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES;
|
|
7097
7100
|
const encoder = new TextEncoder();
|
|
7098
7101
|
return new ReadableStream({
|
|
7099
7102
|
async start(controller) {
|
|
@@ -7439,6 +7442,17 @@ function appendDroppedStdoutLineSummary(summary, entry) {
|
|
|
7439
7442
|
}
|
|
7440
7443
|
}
|
|
7441
7444
|
function nodeToWebStreams(stdin, stdout) {
|
|
7445
|
+
const isIgnorableStdinPipeError = (error) => {
|
|
7446
|
+
const code = typeof error === "object" && error !== null ? error.code : void 0;
|
|
7447
|
+
return code === "ERR_STREAM_DESTROYED" || code === "EPIPE";
|
|
7448
|
+
};
|
|
7449
|
+
stdin.on("error", (err) => {
|
|
7450
|
+
if (isIgnorableStdinPipeError(err)) {
|
|
7451
|
+
logger.debug("[AcpBackend] Ignoring stdin pipe error:", err);
|
|
7452
|
+
return;
|
|
7453
|
+
}
|
|
7454
|
+
logger.debug("[AcpBackend] Stdin error:", err);
|
|
7455
|
+
});
|
|
7442
7456
|
const writable = new WritableStream({
|
|
7443
7457
|
write(chunk) {
|
|
7444
7458
|
return new Promise((resolve, reject) => {
|
|
@@ -7448,7 +7462,7 @@ function nodeToWebStreams(stdin, stdout) {
|
|
|
7448
7462
|
}
|
|
7449
7463
|
const ok = stdin.write(chunk, (err) => {
|
|
7450
7464
|
if (err) {
|
|
7451
|
-
if (err
|
|
7465
|
+
if (isIgnorableStdinPipeError(err)) {
|
|
7452
7466
|
resolve();
|
|
7453
7467
|
return;
|
|
7454
7468
|
}
|
|
@@ -7469,7 +7483,34 @@ function nodeToWebStreams(stdin, stdout) {
|
|
|
7469
7483
|
resolve();
|
|
7470
7484
|
return;
|
|
7471
7485
|
}
|
|
7472
|
-
|
|
7486
|
+
let settled = false;
|
|
7487
|
+
const settle = () => {
|
|
7488
|
+
if (settled) {
|
|
7489
|
+
return;
|
|
7490
|
+
}
|
|
7491
|
+
settled = true;
|
|
7492
|
+
stdin.off("close", settle);
|
|
7493
|
+
stdin.off("finish", settle);
|
|
7494
|
+
stdin.off("error", handleError);
|
|
7495
|
+
resolve();
|
|
7496
|
+
};
|
|
7497
|
+
const handleError = (err) => {
|
|
7498
|
+
if (!isIgnorableStdinPipeError(err)) {
|
|
7499
|
+
logger.debug("[AcpBackend] Error ending stdin:", err);
|
|
7500
|
+
}
|
|
7501
|
+
settle();
|
|
7502
|
+
};
|
|
7503
|
+
stdin.once("close", settle);
|
|
7504
|
+
stdin.once("finish", settle);
|
|
7505
|
+
stdin.once("error", handleError);
|
|
7506
|
+
try {
|
|
7507
|
+
stdin.end(() => settle());
|
|
7508
|
+
} catch (error) {
|
|
7509
|
+
if (!isIgnorableStdinPipeError(error)) {
|
|
7510
|
+
logger.debug("[AcpBackend] Error closing stdin:", error);
|
|
7511
|
+
}
|
|
7512
|
+
settle();
|
|
7513
|
+
}
|
|
7473
7514
|
});
|
|
7474
7515
|
},
|
|
7475
7516
|
abort(reason) {
|
|
@@ -8696,7 +8737,8 @@ ${recentStderrExcerpt}`);
|
|
|
8696
8737
|
kind: "rejected",
|
|
8697
8738
|
error: createAcpAbortError("ACP backend disposed")
|
|
8698
8739
|
});
|
|
8699
|
-
|
|
8740
|
+
const processStillRunning = this.process ? this.process.exitCode === null && this.process.signalCode === null : false;
|
|
8741
|
+
if (this.connection && this.acpSessionId && processStillRunning) {
|
|
8700
8742
|
try {
|
|
8701
8743
|
await Promise.race([
|
|
8702
8744
|
this.connection.cancel({ sessionId: this.acpSessionId }),
|
|
@@ -8706,6 +8748,8 @@ ${recentStderrExcerpt}`);
|
|
|
8706
8748
|
} catch (error) {
|
|
8707
8749
|
logger.debug("[AcpBackend] Error during graceful shutdown:", error);
|
|
8708
8750
|
}
|
|
8751
|
+
} else if (this.connection && this.acpSessionId && this.process && !processStillRunning) {
|
|
8752
|
+
logger.debug("[AcpBackend] Skipping graceful shutdown because ACP process already exited");
|
|
8709
8753
|
}
|
|
8710
8754
|
if (this.process) {
|
|
8711
8755
|
try {
|
|
@@ -8784,7 +8828,8 @@ function readGeminiLocalConfig() {
|
|
|
8784
8828
|
const gcloudToken = execSync("gcloud auth application-default print-access-token", {
|
|
8785
8829
|
encoding: "utf8",
|
|
8786
8830
|
stdio: ["ignore", "pipe", "ignore"],
|
|
8787
|
-
timeout: 5e3
|
|
8831
|
+
timeout: 5e3,
|
|
8832
|
+
windowsHide: true
|
|
8788
8833
|
}).trim();
|
|
8789
8834
|
if (gcloudToken && gcloudToken.length > 0) {
|
|
8790
8835
|
token = gcloudToken;
|
|
@@ -9639,7 +9684,8 @@ function getGlobalClaudeVersion() {
|
|
|
9639
9684
|
encoding: "utf8",
|
|
9640
9685
|
stdio: ["pipe", "pipe", "pipe"],
|
|
9641
9686
|
cwd: homedir$1(),
|
|
9642
|
-
env: cleanEnv
|
|
9687
|
+
env: cleanEnv,
|
|
9688
|
+
windowsHide: true
|
|
9643
9689
|
}).trim();
|
|
9644
9690
|
const match = output.match(/(\d+\.\d+\.\d+)/);
|
|
9645
9691
|
logger.debug(`[Claude SDK] Global claude --version output: ${output}`);
|
|
@@ -9681,7 +9727,8 @@ function findGlobalClaudePath() {
|
|
|
9681
9727
|
encoding: "utf8",
|
|
9682
9728
|
stdio: ["pipe", "pipe", "pipe"],
|
|
9683
9729
|
cwd: homeDir,
|
|
9684
|
-
env: cleanEnv
|
|
9730
|
+
env: cleanEnv,
|
|
9731
|
+
windowsHide: true
|
|
9685
9732
|
});
|
|
9686
9733
|
logger.debug("[Claude SDK] Global claude command available (checked with clean PATH)");
|
|
9687
9734
|
return "claude";
|
|
@@ -9693,7 +9740,8 @@ function findGlobalClaudePath() {
|
|
|
9693
9740
|
encoding: "utf8",
|
|
9694
9741
|
stdio: ["pipe", "pipe", "pipe"],
|
|
9695
9742
|
cwd: homeDir,
|
|
9696
|
-
env: cleanEnv
|
|
9743
|
+
env: cleanEnv,
|
|
9744
|
+
windowsHide: true
|
|
9697
9745
|
}).trim();
|
|
9698
9746
|
if (result && existsSync(result)) {
|
|
9699
9747
|
logger.debug(`[Claude SDK] Found global claude path via which: ${result}`);
|
|
@@ -10032,7 +10080,8 @@ function query(config) {
|
|
|
10032
10080
|
signal: config.options?.abort,
|
|
10033
10081
|
env: spawnEnv,
|
|
10034
10082
|
// Use shell on Windows for global binaries and command-only mode
|
|
10035
|
-
shell: !isJsFile && process.platform === "win32"
|
|
10083
|
+
shell: !isJsFile && process.platform === "win32",
|
|
10084
|
+
windowsHide: true
|
|
10036
10085
|
});
|
|
10037
10086
|
let childStdin = null;
|
|
10038
10087
|
if (typeof prompt === "string") {
|
|
@@ -10949,14 +10998,14 @@ var launch = /*#__PURE__*/Object.freeze({
|
|
|
10949
10998
|
const unifiedProviderExecutors = {
|
|
10950
10999
|
claude: async (opts) => {
|
|
10951
11000
|
const claudeOptions = opts.claudeOptions ?? {};
|
|
10952
|
-
const { runClaude } = await import('./runClaude-
|
|
11001
|
+
const { runClaude } = await import('./runClaude-DWSBt6tE.mjs');
|
|
10953
11002
|
await runClaude(opts.credentials, {
|
|
10954
11003
|
...claudeOptions,
|
|
10955
11004
|
startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
|
|
10956
11005
|
});
|
|
10957
11006
|
},
|
|
10958
11007
|
codex: async (opts) => {
|
|
10959
|
-
const { runCodex } = await import('./runCodex-
|
|
11008
|
+
const { runCodex } = await import('./runCodex-C3VoO79w.mjs');
|
|
10960
11009
|
await runCodex({
|
|
10961
11010
|
credentials: opts.credentials,
|
|
10962
11011
|
startedBy: opts.startedBy,
|
|
@@ -10965,7 +11014,7 @@ const unifiedProviderExecutors = {
|
|
|
10965
11014
|
});
|
|
10966
11015
|
},
|
|
10967
11016
|
gemini: async (opts) => {
|
|
10968
|
-
const { runGemini } = await import('./runGemini-
|
|
11017
|
+
const { runGemini } = await import('./runGemini-CCbOfI6U.mjs');
|
|
10969
11018
|
await runGemini({
|
|
10970
11019
|
credentials: opts.credentials,
|
|
10971
11020
|
startedBy: opts.startedBy
|
|
@@ -11048,7 +11097,7 @@ function shouldRunMainClaudeFlow(opts) {
|
|
|
11048
11097
|
return;
|
|
11049
11098
|
} else if (subcommand === "runtime") {
|
|
11050
11099
|
if (args[1] === "providers") {
|
|
11051
|
-
const { renderRuntimeProviders } = await import('./command-
|
|
11100
|
+
const { renderRuntimeProviders } = await import('./command-C7KnQtPU.mjs');
|
|
11052
11101
|
console.log(renderRuntimeProviders());
|
|
11053
11102
|
return;
|
|
11054
11103
|
}
|
|
@@ -11254,8 +11303,8 @@ function shouldRunMainClaudeFlow(opts) {
|
|
|
11254
11303
|
const projectId = args[3];
|
|
11255
11304
|
try {
|
|
11256
11305
|
const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
|
|
11257
|
-
const { readCredentials: readCredentials2 } = await import('./api-
|
|
11258
|
-
const { ApiClient: ApiClient2 } = await import('./api-
|
|
11306
|
+
const { readCredentials: readCredentials2 } = await import('./api-CuWWLsDI.mjs').then(function (n) { return n.O; });
|
|
11307
|
+
const { ApiClient: ApiClient2 } = await import('./api-CuWWLsDI.mjs').then(function (n) { return n.P; });
|
|
11259
11308
|
let userEmail = void 0;
|
|
11260
11309
|
try {
|
|
11261
11310
|
const credentials = await readCredentials2();
|
|
@@ -11576,7 +11625,7 @@ ${chalk.gray("\u2500".repeat(60))}
|
|
|
11576
11625
|
${chalk.bold.cyan("Claude Code Options (from `claude --help`):")}
|
|
11577
11626
|
`);
|
|
11578
11627
|
try {
|
|
11579
|
-
const claudeHelp = execFileSync(claudeCliPath, ["--help"], { encoding: "utf8" });
|
|
11628
|
+
const claudeHelp = execFileSync(claudeCliPath, ["--help"], { encoding: "utf8", windowsHide: true });
|
|
11580
11629
|
console.log(claudeHelp);
|
|
11581
11630
|
} catch (e) {
|
|
11582
11631
|
console.log(chalk.yellow("Could not retrieve claude help. Make sure claude is installed."));
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('chalk');
|
|
4
|
-
require('./api-
|
|
4
|
+
require('./api-BVXbJ3M_.cjs');
|
|
5
5
|
require('zod');
|
|
6
|
-
require('./index-
|
|
6
|
+
require('./index-BBD69Ds-.cjs');
|
|
7
7
|
require('node:child_process');
|
|
8
8
|
require('node:fs');
|
|
9
9
|
require('cross-spawn');
|
package/dist/index.mjs
CHANGED
package/dist/lib.cjs
CHANGED
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-
|
|
1
|
+
export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-CuWWLsDI.mjs';
|
|
2
2
|
export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import 'chalk';
|
package/dist/{registerKillSessionHandler-BNzbdofF.mjs → registerKillSessionHandler-BVIaG4zk.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as initialMachineMetadata, R as RuntimeShell,
|
|
2
|
-
import { r as readSettings, H as
|
|
1
|
+
import { k as initialMachineMetadata, R as RuntimeShell, f as formatDisplayMessage, l as resolveCanonicalToolNameV2 } from './index-DPNRq_mT.mjs';
|
|
2
|
+
import { r as readSettings, H as HeadTailPreviewBuffer, d as HAPPY_ORG_TURN_REPORT_TAG, e as HAPPY_ORG_SUMMARY_MAX_LENGTH, f as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-CuWWLsDI.mjs';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import { basename } from 'node:path';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
@@ -88,6 +88,17 @@ function attachToolHappierMetaV2(value, meta) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
const DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES = 4096;
|
|
92
|
+
const DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES = 12288;
|
|
93
|
+
function renderOutputPreview(value, label, opts) {
|
|
94
|
+
const buffer = new HeadTailPreviewBuffer(
|
|
95
|
+
DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES,
|
|
96
|
+
DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES
|
|
97
|
+
);
|
|
98
|
+
buffer.append(formatDisplayMessage(value));
|
|
99
|
+
return buffer.render(label);
|
|
100
|
+
}
|
|
101
|
+
|
|
91
102
|
const DISPLAY_FRIENDLY_TOOL_FIELDS = ["stdout", "stderr", "output", "text", "message", "detail", "reason", "data"];
|
|
92
103
|
function isRecord(value) {
|
|
93
104
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
@@ -144,6 +155,34 @@ function normalizeCodexToolOutput(value) {
|
|
|
144
155
|
text: flattenedText
|
|
145
156
|
};
|
|
146
157
|
}
|
|
158
|
+
function truncateProviderOutputValue(value, label, seen = /* @__PURE__ */ new WeakSet()) {
|
|
159
|
+
if (typeof value === "string") {
|
|
160
|
+
return renderOutputPreview(value, label);
|
|
161
|
+
}
|
|
162
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(value)) {
|
|
163
|
+
return renderOutputPreview(value, label);
|
|
164
|
+
}
|
|
165
|
+
if (Array.isArray(value)) {
|
|
166
|
+
return renderOutputPreview(value, label);
|
|
167
|
+
}
|
|
168
|
+
if (!isRecord(value)) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
if (seen.has(value)) {
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
seen.add(value);
|
|
175
|
+
let changed = false;
|
|
176
|
+
const next = {};
|
|
177
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
178
|
+
const nextEntry = DISPLAY_FRIENDLY_TOOL_FIELDS.includes(key) || key === "content" ? renderOutputPreview(entry, label) : entry;
|
|
179
|
+
next[key] = nextEntry;
|
|
180
|
+
if (nextEntry !== entry) {
|
|
181
|
+
changed = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return changed ? next : value;
|
|
185
|
+
}
|
|
147
186
|
function getDefaultExecToolName(provider) {
|
|
148
187
|
switch (provider) {
|
|
149
188
|
case "claude":
|
|
@@ -180,7 +219,8 @@ function prepareToolInput(provider, rawToolName, value) {
|
|
|
180
219
|
}
|
|
181
220
|
function prepareToolOutput(provider, rawToolName, value) {
|
|
182
221
|
const enriched = attachToolMeta(provider, rawToolName, value);
|
|
183
|
-
|
|
222
|
+
const normalized = provider === "codex" ? normalizeCodexToolOutput(enriched) : enriched;
|
|
223
|
+
return truncateProviderOutputValue(normalized, "tool output");
|
|
184
224
|
}
|
|
185
225
|
function hasDisplayPayload(value) {
|
|
186
226
|
const sanitized = stripInternalToolMeta(value);
|
|
@@ -198,15 +238,22 @@ function hasDisplayPayload(value) {
|
|
|
198
238
|
}
|
|
199
239
|
return true;
|
|
200
240
|
}
|
|
241
|
+
function shouldDropContentlessFetchTrace(rawToolName, payload) {
|
|
242
|
+
return String(resolveCanonicalToolNameV2(rawToolName)).trim().toLowerCase() === "fetch" && !hasDisplayPayload(payload);
|
|
243
|
+
}
|
|
201
244
|
function forwardAgentMessageToProviderSession(msg, options) {
|
|
202
245
|
const createId = options.createId ?? randomUUID;
|
|
203
246
|
const toolResultType = options.toolResultType ?? "tool-result";
|
|
204
247
|
switch (msg.type) {
|
|
205
248
|
case "tool-call": {
|
|
249
|
+
const canonicalToolName = resolveCanonicalToolNameV2(msg.toolName);
|
|
206
250
|
const input = prepareToolInput(options.provider, msg.toolName, msg.args);
|
|
251
|
+
if (shouldDropContentlessFetchTrace(msg.toolName, input)) {
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
207
254
|
options.send({
|
|
208
255
|
type: "tool-call",
|
|
209
|
-
name:
|
|
256
|
+
name: canonicalToolName,
|
|
210
257
|
callId: msg.callId,
|
|
211
258
|
...hasDisplayPayload(input) ? { input } : {},
|
|
212
259
|
id: createId()
|
|
@@ -214,13 +261,18 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
214
261
|
return true;
|
|
215
262
|
}
|
|
216
263
|
case "tool-result": {
|
|
264
|
+
resolveCanonicalToolNameV2(msg.toolName);
|
|
217
265
|
const output = prepareToolOutput(options.provider, msg.toolName, msg.result);
|
|
266
|
+
const isError = inferToolResultError(msg.result);
|
|
267
|
+
if (!isError && shouldDropContentlessFetchTrace(msg.toolName, output)) {
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
218
270
|
options.send({
|
|
219
271
|
type: toolResultType,
|
|
220
272
|
callId: msg.callId,
|
|
221
273
|
...hasDisplayPayload(output) ? { output } : {},
|
|
222
274
|
id: createId(),
|
|
223
|
-
isError
|
|
275
|
+
isError
|
|
224
276
|
});
|
|
225
277
|
return true;
|
|
226
278
|
}
|
|
@@ -237,7 +289,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
237
289
|
case "terminal-output": {
|
|
238
290
|
options.send({
|
|
239
291
|
type: "terminal-output",
|
|
240
|
-
data: msg.data,
|
|
292
|
+
data: renderOutputPreview(msg.data, "terminal output"),
|
|
241
293
|
callId: msg.callId ?? createId()
|
|
242
294
|
});
|
|
243
295
|
return true;
|
|
@@ -2105,4 +2157,4 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy) {
|
|
|
2105
2157
|
});
|
|
2106
2158
|
}
|
|
2107
2159
|
|
|
2108
|
-
export { BasePermissionHandler as B, ConversationHistory$1 as C, INTERACTION_SUPERSEDED_ERROR as I, MissingMachineIdError as M, INTERACTION_TIMED_OUT_ERROR as a, MessageQueue2 as b, registerKillSessionHandler as c, MessageBuffer as d, ensureManagedProviderMachine as e, buildHappyOrgTurnPrompt as f, getPendingInteractionTimeoutMs as g, hashObject as h, finalizeHappyOrgTurnWithBusinessAck as i,
|
|
2160
|
+
export { BasePermissionHandler as B, ConversationHistory$1 as C, INTERACTION_SUPERSEDED_ERROR as I, MissingMachineIdError as M, INTERACTION_TIMED_OUT_ERROR as a, MessageQueue2 as b, registerKillSessionHandler as c, MessageBuffer as d, ensureManagedProviderMachine as e, buildHappyOrgTurnPrompt as f, getPendingInteractionTimeoutMs as g, hashObject as h, finalizeHappyOrgTurnWithBusinessAck as i, renderOutputPreview as j, inferToolResultError as k, launchRuntimeHandleWithFactoryResult as l, forwardAgentMessageToProviderSession as m, resolveHappyOrgQueuedTurn as r, syncControlledByUserState as s, waitForResponseCompleteWithAbort as w };
|
package/dist/{registerKillSessionHandler-Q_rOuCNA.cjs → registerKillSessionHandler-CeO8n78A.cjs}
RENAMED
|
@@ -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-BBD69Ds-.cjs');
|
|
4
|
+
var persistence = require('./api-BVXbJ3M_.cjs');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var crypto = require('crypto');
|
|
@@ -90,6 +90,17 @@ function attachToolHappierMetaV2(value, meta) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
const DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES = 4096;
|
|
94
|
+
const DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES = 12288;
|
|
95
|
+
function renderOutputPreview(value, label, opts) {
|
|
96
|
+
const buffer = new persistence.HeadTailPreviewBuffer(
|
|
97
|
+
DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES,
|
|
98
|
+
DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES
|
|
99
|
+
);
|
|
100
|
+
buffer.append(index.formatDisplayMessage(value));
|
|
101
|
+
return buffer.render(label);
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
const DISPLAY_FRIENDLY_TOOL_FIELDS = ["stdout", "stderr", "output", "text", "message", "detail", "reason", "data"];
|
|
94
105
|
function isRecord(value) {
|
|
95
106
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
@@ -146,6 +157,34 @@ function normalizeCodexToolOutput(value) {
|
|
|
146
157
|
text: flattenedText
|
|
147
158
|
};
|
|
148
159
|
}
|
|
160
|
+
function truncateProviderOutputValue(value, label, seen = /* @__PURE__ */ new WeakSet()) {
|
|
161
|
+
if (typeof value === "string") {
|
|
162
|
+
return renderOutputPreview(value, label);
|
|
163
|
+
}
|
|
164
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(value)) {
|
|
165
|
+
return renderOutputPreview(value, label);
|
|
166
|
+
}
|
|
167
|
+
if (Array.isArray(value)) {
|
|
168
|
+
return renderOutputPreview(value, label);
|
|
169
|
+
}
|
|
170
|
+
if (!isRecord(value)) {
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
if (seen.has(value)) {
|
|
174
|
+
return value;
|
|
175
|
+
}
|
|
176
|
+
seen.add(value);
|
|
177
|
+
let changed = false;
|
|
178
|
+
const next = {};
|
|
179
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
180
|
+
const nextEntry = DISPLAY_FRIENDLY_TOOL_FIELDS.includes(key) || key === "content" ? renderOutputPreview(entry, label) : entry;
|
|
181
|
+
next[key] = nextEntry;
|
|
182
|
+
if (nextEntry !== entry) {
|
|
183
|
+
changed = true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return changed ? next : value;
|
|
187
|
+
}
|
|
149
188
|
function getDefaultExecToolName(provider) {
|
|
150
189
|
switch (provider) {
|
|
151
190
|
case "claude":
|
|
@@ -182,7 +221,8 @@ function prepareToolInput(provider, rawToolName, value) {
|
|
|
182
221
|
}
|
|
183
222
|
function prepareToolOutput(provider, rawToolName, value) {
|
|
184
223
|
const enriched = attachToolMeta(provider, rawToolName, value);
|
|
185
|
-
|
|
224
|
+
const normalized = provider === "codex" ? normalizeCodexToolOutput(enriched) : enriched;
|
|
225
|
+
return truncateProviderOutputValue(normalized, "tool output");
|
|
186
226
|
}
|
|
187
227
|
function hasDisplayPayload(value) {
|
|
188
228
|
const sanitized = stripInternalToolMeta(value);
|
|
@@ -200,15 +240,22 @@ function hasDisplayPayload(value) {
|
|
|
200
240
|
}
|
|
201
241
|
return true;
|
|
202
242
|
}
|
|
243
|
+
function shouldDropContentlessFetchTrace(rawToolName, payload) {
|
|
244
|
+
return String(index.resolveCanonicalToolNameV2(rawToolName)).trim().toLowerCase() === "fetch" && !hasDisplayPayload(payload);
|
|
245
|
+
}
|
|
203
246
|
function forwardAgentMessageToProviderSession(msg, options) {
|
|
204
247
|
const createId = options.createId ?? node_crypto.randomUUID;
|
|
205
248
|
const toolResultType = options.toolResultType ?? "tool-result";
|
|
206
249
|
switch (msg.type) {
|
|
207
250
|
case "tool-call": {
|
|
251
|
+
const canonicalToolName = index.resolveCanonicalToolNameV2(msg.toolName);
|
|
208
252
|
const input = prepareToolInput(options.provider, msg.toolName, msg.args);
|
|
253
|
+
if (shouldDropContentlessFetchTrace(msg.toolName, input)) {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
209
256
|
options.send({
|
|
210
257
|
type: "tool-call",
|
|
211
|
-
name:
|
|
258
|
+
name: canonicalToolName,
|
|
212
259
|
callId: msg.callId,
|
|
213
260
|
...hasDisplayPayload(input) ? { input } : {},
|
|
214
261
|
id: createId()
|
|
@@ -216,13 +263,18 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
216
263
|
return true;
|
|
217
264
|
}
|
|
218
265
|
case "tool-result": {
|
|
266
|
+
index.resolveCanonicalToolNameV2(msg.toolName);
|
|
219
267
|
const output = prepareToolOutput(options.provider, msg.toolName, msg.result);
|
|
268
|
+
const isError = inferToolResultError(msg.result);
|
|
269
|
+
if (!isError && shouldDropContentlessFetchTrace(msg.toolName, output)) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
220
272
|
options.send({
|
|
221
273
|
type: toolResultType,
|
|
222
274
|
callId: msg.callId,
|
|
223
275
|
...hasDisplayPayload(output) ? { output } : {},
|
|
224
276
|
id: createId(),
|
|
225
|
-
isError
|
|
277
|
+
isError
|
|
226
278
|
});
|
|
227
279
|
return true;
|
|
228
280
|
}
|
|
@@ -239,7 +291,7 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
239
291
|
case "terminal-output": {
|
|
240
292
|
options.send({
|
|
241
293
|
type: "terminal-output",
|
|
242
|
-
data: msg.data,
|
|
294
|
+
data: renderOutputPreview(msg.data, "terminal output"),
|
|
243
295
|
callId: msg.callId ?? createId()
|
|
244
296
|
});
|
|
245
297
|
return true;
|
|
@@ -2123,6 +2175,7 @@ exports.hashObject = hashObject;
|
|
|
2123
2175
|
exports.inferToolResultError = inferToolResultError;
|
|
2124
2176
|
exports.launchRuntimeHandleWithFactoryResult = launchRuntimeHandleWithFactoryResult;
|
|
2125
2177
|
exports.registerKillSessionHandler = registerKillSessionHandler;
|
|
2178
|
+
exports.renderOutputPreview = renderOutputPreview;
|
|
2126
2179
|
exports.resolveHappyOrgQueuedTurn = resolveHappyOrgQueuedTurn;
|
|
2127
2180
|
exports.syncControlledByUserState = syncControlledByUserState;
|
|
2128
2181
|
exports.waitForResponseCompleteWithAbort = waitForResponseCompleteWithAbort;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
|
-
var persistence = require('./api-
|
|
4
|
+
var persistence = require('./api-BVXbJ3M_.cjs');
|
|
5
5
|
require('cross-spawn');
|
|
6
6
|
require('@agentclientprotocol/sdk');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-BBD69Ds-.cjs');
|
|
8
8
|
require('ps-list');
|
|
9
9
|
require('fs');
|
|
10
10
|
require('path');
|
|
@@ -25,9 +25,9 @@ require('tweetnacl');
|
|
|
25
25
|
require('open');
|
|
26
26
|
var React = require('react');
|
|
27
27
|
var ink = require('ink');
|
|
28
|
-
var ProviderSelectionHandler = require('./ProviderSelectionHandler-
|
|
28
|
+
var ProviderSelectionHandler = require('./ProviderSelectionHandler-DANtoYaW.cjs');
|
|
29
29
|
var types = require('./types-DVk3crez.cjs');
|
|
30
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
30
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-CeO8n78A.cjs');
|
|
31
31
|
require('socket.io-client');
|
|
32
32
|
require('expo-server-sdk');
|
|
33
33
|
var node_util = require('node:util');
|
|
@@ -1236,7 +1236,7 @@ async function claudeAcpRemoteLauncher(session) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
case "terminal-output": {
|
|
1238
1238
|
emitPendingThinkingMessage();
|
|
1239
|
-
const output =
|
|
1239
|
+
const output = registerKillSessionHandler.renderOutputPreview(msg.data, "terminal output");
|
|
1240
1240
|
messageBuffer.addMessage(output, "result");
|
|
1241
1241
|
forwardAgentMessage({
|
|
1242
1242
|
...msg,
|
|
@@ -2249,7 +2249,8 @@ function getGitBranch(cwd) {
|
|
|
2249
2249
|
const branch = node_child_process.execSync("git rev-parse --abbrev-ref HEAD", {
|
|
2250
2250
|
cwd,
|
|
2251
2251
|
encoding: "utf8",
|
|
2252
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
2252
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
2253
|
+
windowsHide: true
|
|
2253
2254
|
}).trim();
|
|
2254
2255
|
return branch || void 0;
|
|
2255
2256
|
} catch {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { l as logger,
|
|
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-CuWWLsDI.mjs';
|
|
3
3
|
import 'cross-spawn';
|
|
4
4
|
import '@agentclientprotocol/sdk';
|
|
5
|
-
import { m as getProjectPath, F as Future, n as claudeLocal, E as ExitCodeError, o as trimIdent, q as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, u as claudeCheckSession, w as projectPath, x as mapToClaudeMode, P as PushableAsyncIterable, y as query, A as AbortError, e as stopCaffeinate, p as publishSessionRegistration, z as getEnvironmentInfo, a as createSessionMetadata, B as startCaffeinate, b as closeProviderSession } from './index-
|
|
5
|
+
import { m as getProjectPath, F as Future, n as claudeLocal, E as ExitCodeError, o as trimIdent, q as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, u as claudeCheckSession, w as projectPath, x as mapToClaudeMode, P as PushableAsyncIterable, y as query, A as AbortError, e as stopCaffeinate, p as publishSessionRegistration, z as getEnvironmentInfo, a as createSessionMetadata, B as startCaffeinate, b as closeProviderSession } from './index-DPNRq_mT.mjs';
|
|
6
6
|
import 'ps-list';
|
|
7
7
|
import 'fs';
|
|
8
8
|
import 'path';
|
|
@@ -23,9 +23,9 @@ import 'tweetnacl';
|
|
|
23
23
|
import 'open';
|
|
24
24
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
25
25
|
import { useStdout, useInput, Box, Text, render } from 'ink';
|
|
26
|
-
import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-
|
|
26
|
+
import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CqMvpE6K.mjs';
|
|
27
27
|
import { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
|
|
28
|
-
import { B as BasePermissionHandler, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, l as launchRuntimeHandleWithFactoryResult,
|
|
28
|
+
import { B as BasePermissionHandler, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, l as launchRuntimeHandleWithFactoryResult, j as renderOutputPreview, m as forwardAgentMessageToProviderSession, s as syncControlledByUserState, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, h as hashObject, c as registerKillSessionHandler } from './registerKillSessionHandler-BVIaG4zk.mjs';
|
|
29
29
|
import 'socket.io-client';
|
|
30
30
|
import 'expo-server-sdk';
|
|
31
31
|
import { isDeepStrictEqual } from 'node:util';
|
|
@@ -1234,7 +1234,7 @@ async function claudeAcpRemoteLauncher(session) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
case "terminal-output": {
|
|
1236
1236
|
emitPendingThinkingMessage();
|
|
1237
|
-
const output =
|
|
1237
|
+
const output = renderOutputPreview(msg.data, "terminal output");
|
|
1238
1238
|
messageBuffer.addMessage(output, "result");
|
|
1239
1239
|
forwardAgentMessage({
|
|
1240
1240
|
...msg,
|
|
@@ -2247,7 +2247,8 @@ function getGitBranch(cwd) {
|
|
|
2247
2247
|
const branch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
2248
2248
|
cwd,
|
|
2249
2249
|
encoding: "utf8",
|
|
2250
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
2250
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
2251
|
+
windowsHide: true
|
|
2251
2252
|
}).trim();
|
|
2252
2253
|
return branch || void 0;
|
|
2253
2254
|
} catch {
|