happy-imou-cloud 2.1.35 → 2.1.37
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-DbYQw-IT.mjs → BaseReasoningProcessor-CotgApeZ.mjs} +2 -2
- package/dist/{BaseReasoningProcessor-vn-Cvazk.cjs → BaseReasoningProcessor-Do2r_eVW.cjs} +2 -2
- package/dist/{ProviderSelectionHandler-Dk4HaiPR.mjs → ProviderSelectionHandler-CCsorkyV.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-CHXCKI8q.cjs → ProviderSelectionHandler-CywTx_Df.cjs} +2 -2
- package/dist/{api-C_wLDBlG.mjs → api-CMJhY7of.mjs} +1 -1
- package/dist/{api-CeZTggZF.cjs → api-CexMNqai.cjs} +1 -1
- package/dist/{command-Dth-tCSc.mjs → command-C2YB2hE-.mjs} +2 -2
- package/dist/{command-djmqu0my.cjs → command-Ct7Eeo2F.cjs} +2 -2
- package/dist/{index-l0zi9G9M.mjs → index-4t8rMnvz.mjs} +54 -9
- package/dist/{index-CckDTAoL.cjs → index-CQ2Yq72y.cjs} +57 -11
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +80 -80
- package/dist/lib.d.mts +80 -80
- package/dist/lib.mjs +1 -1
- package/dist/{registerKillSessionHandler-CMyw8PFY.cjs → registerKillSessionHandler-C1PIogKI.cjs} +99 -16
- package/dist/{registerKillSessionHandler-BxbrcRl3.mjs → registerKillSessionHandler-CLFQ8bQP.mjs} +99 -16
- package/dist/{runClaude-BK-xZzSe.mjs → runClaude-BiFuU4AP.mjs} +8 -5
- package/dist/{runClaude-CniBKZZh.cjs → runClaude-L4G4BbIJ.cjs} +8 -5
- package/dist/{runCodex-C4X1beyB.mjs → runCodex-C0wjgp2b.mjs} +9 -6
- package/dist/{runCodex-Dl1BeoP7.cjs → runCodex-CaUoS6E4.cjs} +9 -6
- package/dist/{runGemini-Bw9Z5tD5.cjs → runGemini-DhYi_crP.cjs} +8 -5
- package/dist/{runGemini-Bigzf0Vw.mjs → runGemini-DxQX5VhV.mjs} +8 -5
- package/package.json +1 -1
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-CMJhY7of.mjs';
|
|
2
2
|
export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import 'chalk';
|
package/dist/{registerKillSessionHandler-CMyw8PFY.cjs → registerKillSessionHandler-C1PIogKI.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-CQ2Yq72y.cjs');
|
|
4
|
+
var persistence = require('./api-CexMNqai.cjs');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var crypto = require('crypto');
|
|
@@ -93,6 +93,10 @@ function attachToolHappierMetaV2(value, meta) {
|
|
|
93
93
|
|
|
94
94
|
const DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES = 4096;
|
|
95
95
|
const DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES = 12288;
|
|
96
|
+
const ANSI_CSI_PATTERN = /\u001B\[[0-?]*[ -/]*[@-~]/g;
|
|
97
|
+
const ANSI_OSC_PATTERN = /\u001B\][\s\S]*?(?:\u0007|\u001B\\)/g;
|
|
98
|
+
const ANSI_SINGLE_ESCAPE_PATTERN = /\u001B[@-_]/g;
|
|
99
|
+
const NON_DISPLAY_CONTROL_PATTERN = /[\u0000-\u0008\u000B-\u001F\u007F]/g;
|
|
96
100
|
function renderOutputPreview(value, label, opts) {
|
|
97
101
|
const buffer = new persistence.HeadTailPreviewBuffer(
|
|
98
102
|
DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES,
|
|
@@ -101,6 +105,16 @@ function renderOutputPreview(value, label, opts) {
|
|
|
101
105
|
buffer.append(index.formatDisplayMessage(value));
|
|
102
106
|
return buffer.render(label);
|
|
103
107
|
}
|
|
108
|
+
function sanitizeTerminalOutputForDisplay(value) {
|
|
109
|
+
return index.formatDisplayMessage(value).replace(ANSI_OSC_PATTERN, "").replace(ANSI_CSI_PATTERN, "").replace(ANSI_SINGLE_ESCAPE_PATTERN, "").replace(/\r/g, "").replace(NON_DISPLAY_CONTROL_PATTERN, "");
|
|
110
|
+
}
|
|
111
|
+
function renderTerminalOutputPreview(value, opts) {
|
|
112
|
+
const sanitized = sanitizeTerminalOutputForDisplay(value);
|
|
113
|
+
if (sanitized.trim().length === 0) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return renderOutputPreview(sanitized, "terminal output");
|
|
117
|
+
}
|
|
104
118
|
|
|
105
119
|
const DISPLAY_FRIENDLY_TOOL_FIELDS = ["stdout", "stderr", "output", "text", "message", "detail", "reason", "data"];
|
|
106
120
|
function isRecord(value) {
|
|
@@ -118,6 +132,9 @@ function stripInternalToolMeta(value) {
|
|
|
118
132
|
return rest;
|
|
119
133
|
}
|
|
120
134
|
function extractNestedTextContent(value) {
|
|
135
|
+
if (index.isTerminalReferenceOnlyPayload(value)) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
121
138
|
if (typeof value === "string") {
|
|
122
139
|
return value.trim().length > 0 ? value : null;
|
|
123
140
|
}
|
|
@@ -136,23 +153,76 @@ function extractNestedTextContent(value) {
|
|
|
136
153
|
}
|
|
137
154
|
return null;
|
|
138
155
|
}
|
|
156
|
+
function humanizeToolLabel(rawToolName) {
|
|
157
|
+
const canonicalToolName = index.resolveCanonicalToolNameV2(rawToolName);
|
|
158
|
+
const spaced = canonicalToolName.replace(/_/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
159
|
+
if (!spaced) {
|
|
160
|
+
return "Tool";
|
|
161
|
+
}
|
|
162
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();
|
|
163
|
+
}
|
|
164
|
+
function isToolLifecycleResult(value) {
|
|
165
|
+
if (!isRecord(value)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
return typeof value.state === "string" && ("messages" in value || "description" in value || "createdAt" in value || "startedAt" in value || "completedAt" in value);
|
|
169
|
+
}
|
|
170
|
+
function buildToolLifecycleText(rawToolName, value) {
|
|
171
|
+
const messagesText = extractNestedTextContent(value.messages);
|
|
172
|
+
if (messagesText) {
|
|
173
|
+
return messagesText;
|
|
174
|
+
}
|
|
175
|
+
if (typeof value.description === "string" && value.description.trim().length > 0) {
|
|
176
|
+
return value.description.trim();
|
|
177
|
+
}
|
|
178
|
+
const state = typeof value.state === "string" ? value.state.trim() : "";
|
|
179
|
+
if (!state) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
const normalizedState = state.replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
183
|
+
if (!normalizedState) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
return `${humanizeToolLabel(rawToolName)} ${normalizedState}.`;
|
|
187
|
+
}
|
|
188
|
+
function normalizeCodexLifecyclePayload(rawToolName, value) {
|
|
189
|
+
if (!isToolLifecycleResult(value)) {
|
|
190
|
+
return value;
|
|
191
|
+
}
|
|
192
|
+
const hasDisplayFriendlyField = DISPLAY_FRIENDLY_TOOL_FIELDS.some((field) => field in value);
|
|
193
|
+
if (hasDisplayFriendlyField) {
|
|
194
|
+
return value;
|
|
195
|
+
}
|
|
196
|
+
const text = buildToolLifecycleText(rawToolName, value);
|
|
197
|
+
if (!text) {
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
...value,
|
|
202
|
+
text
|
|
203
|
+
};
|
|
204
|
+
}
|
|
139
205
|
function normalizeCodexToolInput(value) {
|
|
140
206
|
return stripInternalToolMeta(value);
|
|
141
207
|
}
|
|
142
|
-
function normalizeCodexToolOutput(value) {
|
|
208
|
+
function normalizeCodexToolOutput(rawToolName, value) {
|
|
143
209
|
const sanitized = stripInternalToolMeta(value);
|
|
144
|
-
|
|
145
|
-
|
|
210
|
+
const normalizedLifecyclePayload = normalizeCodexLifecyclePayload(rawToolName, sanitized);
|
|
211
|
+
if (index.isTerminalReferenceOnlyPayload(normalizedLifecyclePayload)) {
|
|
212
|
+
return void 0;
|
|
146
213
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return sanitized;
|
|
214
|
+
if (!isRecord(normalizedLifecyclePayload)) {
|
|
215
|
+
return normalizedLifecyclePayload;
|
|
150
216
|
}
|
|
151
|
-
const
|
|
217
|
+
const hasDisplayFriendlyField = DISPLAY_FRIENDLY_TOOL_FIELDS.some((field) => field in normalizedLifecyclePayload);
|
|
218
|
+
if (hasDisplayFriendlyField || !("content" in normalizedLifecyclePayload)) {
|
|
219
|
+
return normalizedLifecyclePayload;
|
|
220
|
+
}
|
|
221
|
+
const flattenedText = extractNestedTextContent(normalizedLifecyclePayload.content);
|
|
152
222
|
if (!flattenedText) {
|
|
153
|
-
return
|
|
223
|
+
return normalizedLifecyclePayload;
|
|
154
224
|
}
|
|
155
|
-
const { content: _content, ...rest } =
|
|
225
|
+
const { content: _content, ...rest } = normalizedLifecyclePayload;
|
|
156
226
|
return {
|
|
157
227
|
...rest,
|
|
158
228
|
text: flattenedText
|
|
@@ -222,11 +292,14 @@ function prepareToolInput(provider, rawToolName, value) {
|
|
|
222
292
|
}
|
|
223
293
|
function prepareToolOutput(provider, rawToolName, value) {
|
|
224
294
|
const enriched = attachToolMeta(provider, rawToolName, value);
|
|
225
|
-
const normalized = provider === "codex" ? normalizeCodexToolOutput(enriched) : enriched;
|
|
295
|
+
const normalized = provider === "codex" ? normalizeCodexToolOutput(rawToolName, enriched) : enriched;
|
|
226
296
|
return truncateProviderOutputValue(normalized, "tool output");
|
|
227
297
|
}
|
|
228
298
|
function hasDisplayPayload(value) {
|
|
229
299
|
const sanitized = stripInternalToolMeta(value);
|
|
300
|
+
if (index.isTerminalReferenceOnlyPayload(sanitized)) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
230
303
|
if (sanitized === void 0 || sanitized === null) {
|
|
231
304
|
return false;
|
|
232
305
|
}
|
|
@@ -242,7 +315,10 @@ function hasDisplayPayload(value) {
|
|
|
242
315
|
return true;
|
|
243
316
|
}
|
|
244
317
|
function shouldDropContentlessFetchTrace(rawToolName, payload) {
|
|
245
|
-
return
|
|
318
|
+
return index.resolveCanonicalToolNameV2(rawToolName) === "WebFetch" && !hasDisplayPayload(payload);
|
|
319
|
+
}
|
|
320
|
+
function shouldSuppressContentlessTerminalResult(rawToolName, payload, isError) {
|
|
321
|
+
return !isError && index.resolveCanonicalToolNameV2(rawToolName) === "Bash" && !hasDisplayPayload(payload);
|
|
246
322
|
}
|
|
247
323
|
function forwardAgentMessageToProviderSession(msg, options) {
|
|
248
324
|
const createId = options.createId ?? node_crypto.randomUUID;
|
|
@@ -264,12 +340,15 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
264
340
|
return true;
|
|
265
341
|
}
|
|
266
342
|
case "tool-result": {
|
|
267
|
-
index.resolveCanonicalToolNameV2(msg.toolName);
|
|
343
|
+
const canonicalToolName = index.resolveCanonicalToolNameV2(msg.toolName);
|
|
268
344
|
const output = prepareToolOutput(options.provider, msg.toolName, msg.result);
|
|
269
345
|
const isError = inferToolResultError(msg.result);
|
|
270
346
|
if (!isError && shouldDropContentlessFetchTrace(msg.toolName, output)) {
|
|
271
347
|
return true;
|
|
272
348
|
}
|
|
349
|
+
if (shouldSuppressContentlessTerminalResult(canonicalToolName, output, isError)) {
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
273
352
|
options.send({
|
|
274
353
|
type: toolResultType,
|
|
275
354
|
callId: msg.callId,
|
|
@@ -290,9 +369,13 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
290
369
|
return true;
|
|
291
370
|
}
|
|
292
371
|
case "terminal-output": {
|
|
372
|
+
const preview = renderTerminalOutputPreview(msg.data);
|
|
373
|
+
if (!preview) {
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
293
376
|
options.send({
|
|
294
377
|
type: "terminal-output",
|
|
295
|
-
data:
|
|
378
|
+
data: preview,
|
|
296
379
|
callId: msg.callId ?? createId()
|
|
297
380
|
});
|
|
298
381
|
return true;
|
|
@@ -2421,7 +2504,7 @@ exports.hashObject = hashObject;
|
|
|
2421
2504
|
exports.inferToolResultError = inferToolResultError;
|
|
2422
2505
|
exports.launchRuntimeHandleWithFactoryResult = launchRuntimeHandleWithFactoryResult;
|
|
2423
2506
|
exports.registerKillSessionHandler = registerKillSessionHandler;
|
|
2424
|
-
exports.
|
|
2507
|
+
exports.renderTerminalOutputPreview = renderTerminalOutputPreview;
|
|
2425
2508
|
exports.resolveHappyOrgQueuedTurn = resolveHappyOrgQueuedTurn;
|
|
2426
2509
|
exports.syncControlledByUserState = syncControlledByUserState;
|
|
2427
2510
|
exports.waitForResponseCompleteWithAbort = waitForResponseCompleteWithAbort;
|
package/dist/{registerKillSessionHandler-BxbrcRl3.mjs → registerKillSessionHandler-CLFQ8bQP.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as initialMachineMetadata, R as RuntimeShell, f as formatDisplayMessage, l as resolveCanonicalToolNameV2 } from './index-
|
|
2
|
-
import { r as readSettings, H as HeadTailPreviewBuffer, d as HAPPY_ORG_REPLY_ACK_VERSION, e as HAPPY_ORG_TURN_REPORT_TAG, f as HAPPY_ORG_SUMMARY_MAX_LENGTH, g as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-
|
|
1
|
+
import { k as initialMachineMetadata, R as RuntimeShell, f as formatDisplayMessage, l as resolveCanonicalToolNameV2, m as isTerminalReferenceOnlyPayload } from './index-4t8rMnvz.mjs';
|
|
2
|
+
import { r as readSettings, H as HeadTailPreviewBuffer, d as HAPPY_ORG_REPLY_ACK_VERSION, e as HAPPY_ORG_TURN_REPORT_TAG, f as HAPPY_ORG_SUMMARY_MAX_LENGTH, g as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-CMJhY7of.mjs';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import { basename } from 'node:path';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
@@ -91,6 +91,10 @@ function attachToolHappierMetaV2(value, meta) {
|
|
|
91
91
|
|
|
92
92
|
const DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES = 4096;
|
|
93
93
|
const DEFAULT_OUTPUT_PREVIEW_TAIL_BYTES = 12288;
|
|
94
|
+
const ANSI_CSI_PATTERN = /\u001B\[[0-?]*[ -/]*[@-~]/g;
|
|
95
|
+
const ANSI_OSC_PATTERN = /\u001B\][\s\S]*?(?:\u0007|\u001B\\)/g;
|
|
96
|
+
const ANSI_SINGLE_ESCAPE_PATTERN = /\u001B[@-_]/g;
|
|
97
|
+
const NON_DISPLAY_CONTROL_PATTERN = /[\u0000-\u0008\u000B-\u001F\u007F]/g;
|
|
94
98
|
function renderOutputPreview(value, label, opts) {
|
|
95
99
|
const buffer = new HeadTailPreviewBuffer(
|
|
96
100
|
DEFAULT_OUTPUT_PREVIEW_HEAD_BYTES,
|
|
@@ -99,6 +103,16 @@ function renderOutputPreview(value, label, opts) {
|
|
|
99
103
|
buffer.append(formatDisplayMessage(value));
|
|
100
104
|
return buffer.render(label);
|
|
101
105
|
}
|
|
106
|
+
function sanitizeTerminalOutputForDisplay(value) {
|
|
107
|
+
return formatDisplayMessage(value).replace(ANSI_OSC_PATTERN, "").replace(ANSI_CSI_PATTERN, "").replace(ANSI_SINGLE_ESCAPE_PATTERN, "").replace(/\r/g, "").replace(NON_DISPLAY_CONTROL_PATTERN, "");
|
|
108
|
+
}
|
|
109
|
+
function renderTerminalOutputPreview(value, opts) {
|
|
110
|
+
const sanitized = sanitizeTerminalOutputForDisplay(value);
|
|
111
|
+
if (sanitized.trim().length === 0) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return renderOutputPreview(sanitized, "terminal output");
|
|
115
|
+
}
|
|
102
116
|
|
|
103
117
|
const DISPLAY_FRIENDLY_TOOL_FIELDS = ["stdout", "stderr", "output", "text", "message", "detail", "reason", "data"];
|
|
104
118
|
function isRecord(value) {
|
|
@@ -116,6 +130,9 @@ function stripInternalToolMeta(value) {
|
|
|
116
130
|
return rest;
|
|
117
131
|
}
|
|
118
132
|
function extractNestedTextContent(value) {
|
|
133
|
+
if (isTerminalReferenceOnlyPayload(value)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
119
136
|
if (typeof value === "string") {
|
|
120
137
|
return value.trim().length > 0 ? value : null;
|
|
121
138
|
}
|
|
@@ -134,23 +151,76 @@ function extractNestedTextContent(value) {
|
|
|
134
151
|
}
|
|
135
152
|
return null;
|
|
136
153
|
}
|
|
154
|
+
function humanizeToolLabel(rawToolName) {
|
|
155
|
+
const canonicalToolName = resolveCanonicalToolNameV2(rawToolName);
|
|
156
|
+
const spaced = canonicalToolName.replace(/_/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
157
|
+
if (!spaced) {
|
|
158
|
+
return "Tool";
|
|
159
|
+
}
|
|
160
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();
|
|
161
|
+
}
|
|
162
|
+
function isToolLifecycleResult(value) {
|
|
163
|
+
if (!isRecord(value)) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return typeof value.state === "string" && ("messages" in value || "description" in value || "createdAt" in value || "startedAt" in value || "completedAt" in value);
|
|
167
|
+
}
|
|
168
|
+
function buildToolLifecycleText(rawToolName, value) {
|
|
169
|
+
const messagesText = extractNestedTextContent(value.messages);
|
|
170
|
+
if (messagesText) {
|
|
171
|
+
return messagesText;
|
|
172
|
+
}
|
|
173
|
+
if (typeof value.description === "string" && value.description.trim().length > 0) {
|
|
174
|
+
return value.description.trim();
|
|
175
|
+
}
|
|
176
|
+
const state = typeof value.state === "string" ? value.state.trim() : "";
|
|
177
|
+
if (!state) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const normalizedState = state.replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
181
|
+
if (!normalizedState) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
return `${humanizeToolLabel(rawToolName)} ${normalizedState}.`;
|
|
185
|
+
}
|
|
186
|
+
function normalizeCodexLifecyclePayload(rawToolName, value) {
|
|
187
|
+
if (!isToolLifecycleResult(value)) {
|
|
188
|
+
return value;
|
|
189
|
+
}
|
|
190
|
+
const hasDisplayFriendlyField = DISPLAY_FRIENDLY_TOOL_FIELDS.some((field) => field in value);
|
|
191
|
+
if (hasDisplayFriendlyField) {
|
|
192
|
+
return value;
|
|
193
|
+
}
|
|
194
|
+
const text = buildToolLifecycleText(rawToolName, value);
|
|
195
|
+
if (!text) {
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
...value,
|
|
200
|
+
text
|
|
201
|
+
};
|
|
202
|
+
}
|
|
137
203
|
function normalizeCodexToolInput(value) {
|
|
138
204
|
return stripInternalToolMeta(value);
|
|
139
205
|
}
|
|
140
|
-
function normalizeCodexToolOutput(value) {
|
|
206
|
+
function normalizeCodexToolOutput(rawToolName, value) {
|
|
141
207
|
const sanitized = stripInternalToolMeta(value);
|
|
142
|
-
|
|
143
|
-
|
|
208
|
+
const normalizedLifecyclePayload = normalizeCodexLifecyclePayload(rawToolName, sanitized);
|
|
209
|
+
if (isTerminalReferenceOnlyPayload(normalizedLifecyclePayload)) {
|
|
210
|
+
return void 0;
|
|
144
211
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return sanitized;
|
|
212
|
+
if (!isRecord(normalizedLifecyclePayload)) {
|
|
213
|
+
return normalizedLifecyclePayload;
|
|
148
214
|
}
|
|
149
|
-
const
|
|
215
|
+
const hasDisplayFriendlyField = DISPLAY_FRIENDLY_TOOL_FIELDS.some((field) => field in normalizedLifecyclePayload);
|
|
216
|
+
if (hasDisplayFriendlyField || !("content" in normalizedLifecyclePayload)) {
|
|
217
|
+
return normalizedLifecyclePayload;
|
|
218
|
+
}
|
|
219
|
+
const flattenedText = extractNestedTextContent(normalizedLifecyclePayload.content);
|
|
150
220
|
if (!flattenedText) {
|
|
151
|
-
return
|
|
221
|
+
return normalizedLifecyclePayload;
|
|
152
222
|
}
|
|
153
|
-
const { content: _content, ...rest } =
|
|
223
|
+
const { content: _content, ...rest } = normalizedLifecyclePayload;
|
|
154
224
|
return {
|
|
155
225
|
...rest,
|
|
156
226
|
text: flattenedText
|
|
@@ -220,11 +290,14 @@ function prepareToolInput(provider, rawToolName, value) {
|
|
|
220
290
|
}
|
|
221
291
|
function prepareToolOutput(provider, rawToolName, value) {
|
|
222
292
|
const enriched = attachToolMeta(provider, rawToolName, value);
|
|
223
|
-
const normalized = provider === "codex" ? normalizeCodexToolOutput(enriched) : enriched;
|
|
293
|
+
const normalized = provider === "codex" ? normalizeCodexToolOutput(rawToolName, enriched) : enriched;
|
|
224
294
|
return truncateProviderOutputValue(normalized, "tool output");
|
|
225
295
|
}
|
|
226
296
|
function hasDisplayPayload(value) {
|
|
227
297
|
const sanitized = stripInternalToolMeta(value);
|
|
298
|
+
if (isTerminalReferenceOnlyPayload(sanitized)) {
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
228
301
|
if (sanitized === void 0 || sanitized === null) {
|
|
229
302
|
return false;
|
|
230
303
|
}
|
|
@@ -240,7 +313,10 @@ function hasDisplayPayload(value) {
|
|
|
240
313
|
return true;
|
|
241
314
|
}
|
|
242
315
|
function shouldDropContentlessFetchTrace(rawToolName, payload) {
|
|
243
|
-
return
|
|
316
|
+
return resolveCanonicalToolNameV2(rawToolName) === "WebFetch" && !hasDisplayPayload(payload);
|
|
317
|
+
}
|
|
318
|
+
function shouldSuppressContentlessTerminalResult(rawToolName, payload, isError) {
|
|
319
|
+
return !isError && resolveCanonicalToolNameV2(rawToolName) === "Bash" && !hasDisplayPayload(payload);
|
|
244
320
|
}
|
|
245
321
|
function forwardAgentMessageToProviderSession(msg, options) {
|
|
246
322
|
const createId = options.createId ?? randomUUID;
|
|
@@ -262,12 +338,15 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
262
338
|
return true;
|
|
263
339
|
}
|
|
264
340
|
case "tool-result": {
|
|
265
|
-
resolveCanonicalToolNameV2(msg.toolName);
|
|
341
|
+
const canonicalToolName = resolveCanonicalToolNameV2(msg.toolName);
|
|
266
342
|
const output = prepareToolOutput(options.provider, msg.toolName, msg.result);
|
|
267
343
|
const isError = inferToolResultError(msg.result);
|
|
268
344
|
if (!isError && shouldDropContentlessFetchTrace(msg.toolName, output)) {
|
|
269
345
|
return true;
|
|
270
346
|
}
|
|
347
|
+
if (shouldSuppressContentlessTerminalResult(canonicalToolName, output, isError)) {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
271
350
|
options.send({
|
|
272
351
|
type: toolResultType,
|
|
273
352
|
callId: msg.callId,
|
|
@@ -288,9 +367,13 @@ function forwardAgentMessageToProviderSession(msg, options) {
|
|
|
288
367
|
return true;
|
|
289
368
|
}
|
|
290
369
|
case "terminal-output": {
|
|
370
|
+
const preview = renderTerminalOutputPreview(msg.data);
|
|
371
|
+
if (!preview) {
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
291
374
|
options.send({
|
|
292
375
|
type: "terminal-output",
|
|
293
|
-
data:
|
|
376
|
+
data: preview,
|
|
294
377
|
callId: msg.callId ?? createId()
|
|
295
378
|
});
|
|
296
379
|
return true;
|
|
@@ -2403,4 +2486,4 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy) {
|
|
|
2403
2486
|
});
|
|
2404
2487
|
}
|
|
2405
2488
|
|
|
2406
|
-
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,
|
|
2489
|
+
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, renderTerminalOutputPreview as j, inferToolResultError as k, launchRuntimeHandleWithFactoryResult as l, forwardAgentMessageToProviderSession as m, resolveHappyOrgQueuedTurn as r, syncControlledByUserState as s, waitForResponseCompleteWithAbort as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { l as logger, h as backoff, j as delay, k as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-
|
|
2
|
+
import { l as logger, h as backoff, j as delay, k as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-CMJhY7of.mjs';
|
|
3
3
|
import 'cross-spawn';
|
|
4
4
|
import '@agentclientprotocol/sdk';
|
|
5
|
-
import {
|
|
5
|
+
import { n as getProjectPath, F as Future, o as claudeLocal, E as ExitCodeError, q as trimIdent, u as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, w as claudeCheckSession, x as projectPath, y as mapToClaudeMode, P as PushableAsyncIterable, z as query, A as AbortError, e as stopCaffeinate, p as publishSessionRegistration, B as getEnvironmentInfo, a as createSessionMetadata, C as startCaffeinate, b as closeProviderSession } from './index-4t8rMnvz.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-CCsorkyV.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, j as
|
|
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 renderTerminalOutputPreview, 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-CLFQ8bQP.mjs';
|
|
29
29
|
import 'socket.io-client';
|
|
30
30
|
import 'expo-server-sdk';
|
|
31
31
|
import { isDeepStrictEqual } from 'node:util';
|
|
@@ -1234,7 +1234,10 @@ async function claudeAcpRemoteLauncher(session) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
case "terminal-output": {
|
|
1236
1236
|
emitPendingThinkingMessage();
|
|
1237
|
-
const output =
|
|
1237
|
+
const output = renderTerminalOutputPreview(msg.data);
|
|
1238
|
+
if (!output) {
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1238
1241
|
messageBuffer.addMessage(output, "result");
|
|
1239
1242
|
forwardAgentMessage({
|
|
1240
1243
|
...msg,
|
|
@@ -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-CexMNqai.cjs');
|
|
5
5
|
require('cross-spawn');
|
|
6
6
|
require('@agentclientprotocol/sdk');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-CQ2Yq72y.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-CywTx_Df.cjs');
|
|
29
29
|
var types = require('./types-DVk3crez.cjs');
|
|
30
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
30
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-C1PIogKI.cjs');
|
|
31
31
|
require('socket.io-client');
|
|
32
32
|
require('expo-server-sdk');
|
|
33
33
|
var node_util = require('node:util');
|
|
@@ -1236,7 +1236,10 @@ async function claudeAcpRemoteLauncher(session) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
case "terminal-output": {
|
|
1238
1238
|
emitPendingThinkingMessage();
|
|
1239
|
-
const output = registerKillSessionHandler.
|
|
1239
|
+
const output = registerKillSessionHandler.renderTerminalOutputPreview(msg.data);
|
|
1240
|
+
if (!output) {
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1240
1243
|
messageBuffer.addMessage(output, "result");
|
|
1241
1244
|
forwardAgentMessage({
|
|
1242
1245
|
...msg,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as preserveSessionRuntimeMetadata, l as logger, b as connectionState, A as ApiClient } from './api-
|
|
2
|
-
import { B as BasePermissionHandler, h as hashObject, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, c as registerKillSessionHandler, l as launchRuntimeHandleWithFactoryResult, j as
|
|
3
|
-
import { f as formatDisplayMessage, v as validateCodexAcpSpawn, h as createCodexBackend, t as truncateDisplayMessage, b as closeProviderSession, e as stopCaffeinate, i as readManagedSessionTag, j as resolveManagedSessionTag } from './index-
|
|
1
|
+
import { p as preserveSessionRuntimeMetadata, l as logger, b as connectionState, A as ApiClient } from './api-CMJhY7of.mjs';
|
|
2
|
+
import { B as BasePermissionHandler, h as hashObject, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, c as registerKillSessionHandler, l as launchRuntimeHandleWithFactoryResult, j as renderTerminalOutputPreview, k as inferToolResultError, m as forwardAgentMessageToProviderSession, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, r as resolveHappyOrgQueuedTurn, s as syncControlledByUserState } from './registerKillSessionHandler-CLFQ8bQP.mjs';
|
|
3
|
+
import { f as formatDisplayMessage, v as validateCodexAcpSpawn, h as createCodexBackend, t as truncateDisplayMessage, b as closeProviderSession, e as stopCaffeinate, i as readManagedSessionTag, j as resolveManagedSessionTag } from './index-4t8rMnvz.mjs';
|
|
4
4
|
import 'cross-spawn';
|
|
5
5
|
import '@agentclientprotocol/sdk';
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
@@ -24,8 +24,8 @@ 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-
|
|
28
|
-
import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-
|
|
27
|
+
import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-CCsorkyV.mjs';
|
|
28
|
+
import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-CotgApeZ.mjs';
|
|
29
29
|
import 'zod';
|
|
30
30
|
import 'socket.io-client';
|
|
31
31
|
import 'expo-server-sdk';
|
|
@@ -959,7 +959,10 @@ async function codexRemoteLauncher(session) {
|
|
|
959
959
|
return;
|
|
960
960
|
}
|
|
961
961
|
case "terminal-output": {
|
|
962
|
-
const terminalOutput =
|
|
962
|
+
const terminalOutput = renderTerminalOutputPreview(msg.data);
|
|
963
|
+
if (!terminalOutput) {
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
963
966
|
messageBuffer.addMessage(terminalOutput, "result");
|
|
964
967
|
forwardAgentMessage({
|
|
965
968
|
...msg,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var persistence = require('./api-
|
|
4
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
5
|
-
var index = require('./index-
|
|
3
|
+
var persistence = require('./api-CexMNqai.cjs');
|
|
4
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-C1PIogKI.cjs');
|
|
5
|
+
var index = require('./index-CQ2Yq72y.cjs');
|
|
6
6
|
require('cross-spawn');
|
|
7
7
|
require('@agentclientprotocol/sdk');
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
@@ -26,8 +26,8 @@ require('tweetnacl');
|
|
|
26
26
|
require('open');
|
|
27
27
|
var React = require('react');
|
|
28
28
|
var ink = require('ink');
|
|
29
|
-
var ProviderSelectionHandler = require('./ProviderSelectionHandler-
|
|
30
|
-
var BaseReasoningProcessor = require('./BaseReasoningProcessor-
|
|
29
|
+
var ProviderSelectionHandler = require('./ProviderSelectionHandler-CywTx_Df.cjs');
|
|
30
|
+
var BaseReasoningProcessor = require('./BaseReasoningProcessor-Do2r_eVW.cjs');
|
|
31
31
|
require('zod');
|
|
32
32
|
require('socket.io-client');
|
|
33
33
|
require('expo-server-sdk');
|
|
@@ -961,7 +961,10 @@ async function codexRemoteLauncher(session) {
|
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
963
|
case "terminal-output": {
|
|
964
|
-
const terminalOutput = registerKillSessionHandler.
|
|
964
|
+
const terminalOutput = registerKillSessionHandler.renderTerminalOutputPreview(msg.data);
|
|
965
|
+
if (!terminalOutput) {
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
965
968
|
messageBuffer.addMessage(terminalOutput, "result");
|
|
966
969
|
forwardAgentMessage({
|
|
967
970
|
...msg,
|
|
@@ -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 persistence = require('./api-
|
|
7
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
8
|
-
var index = require('./index-
|
|
9
|
-
var BaseReasoningProcessor = require('./BaseReasoningProcessor-
|
|
6
|
+
var persistence = require('./api-CexMNqai.cjs');
|
|
7
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-C1PIogKI.cjs');
|
|
8
|
+
var index = require('./index-CQ2Yq72y.cjs');
|
|
9
|
+
var BaseReasoningProcessor = require('./BaseReasoningProcessor-Do2r_eVW.cjs');
|
|
10
10
|
require('cross-spawn');
|
|
11
11
|
require('@agentclientprotocol/sdk');
|
|
12
12
|
require('ps-list');
|
|
@@ -1011,7 +1011,10 @@ Guide: https://goo.gle/gemini-cli-auth-docs#workspace-gca`;
|
|
|
1011
1011
|
forwardAgentMessage(msg);
|
|
1012
1012
|
break;
|
|
1013
1013
|
case "terminal-output": {
|
|
1014
|
-
const terminalOutput = registerKillSessionHandler.
|
|
1014
|
+
const terminalOutput = registerKillSessionHandler.renderTerminalOutputPreview(msg.data);
|
|
1015
|
+
if (!terminalOutput) {
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1015
1018
|
messageBuffer.addMessage(terminalOutput, "result");
|
|
1016
1019
|
forwardAgentMessage({
|
|
1017
1020
|
...msg,
|
|
@@ -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-
|
|
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, c as registerKillSessionHandler, d as MessageBuffer, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, l as launchRuntimeHandleWithFactoryResult, j as
|
|
6
|
-
import { g as getInitialGeminiModel, r as readGeminiLocalConfig, G as GEMINI_MODEL_ENV, b as closeProviderSession, s as saveGeminiModelToConfig, d as createGeminiBackend, e as stopCaffeinate } from './index-
|
|
7
|
-
import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-
|
|
4
|
+
import { l as logger, b as connectionState, A as ApiClient } from './api-CMJhY7of.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, c as registerKillSessionHandler, d as MessageBuffer, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurnWithBusinessAck, l as launchRuntimeHandleWithFactoryResult, j as renderTerminalOutputPreview, k as inferToolResultError, m as forwardAgentMessageToProviderSession } from './registerKillSessionHandler-CLFQ8bQP.mjs';
|
|
6
|
+
import { g as getInitialGeminiModel, r as readGeminiLocalConfig, G as GEMINI_MODEL_ENV, b as closeProviderSession, s as saveGeminiModelToConfig, d as createGeminiBackend, e as stopCaffeinate } from './index-4t8rMnvz.mjs';
|
|
7
|
+
import { B as BaseReasoningProcessor, b as bootstrapManagedProviderSession } from './BaseReasoningProcessor-CotgApeZ.mjs';
|
|
8
8
|
import 'cross-spawn';
|
|
9
9
|
import '@agentclientprotocol/sdk';
|
|
10
10
|
import 'ps-list';
|
|
@@ -1009,7 +1009,10 @@ Guide: https://goo.gle/gemini-cli-auth-docs#workspace-gca`;
|
|
|
1009
1009
|
forwardAgentMessage(msg);
|
|
1010
1010
|
break;
|
|
1011
1011
|
case "terminal-output": {
|
|
1012
|
-
const terminalOutput =
|
|
1012
|
+
const terminalOutput = renderTerminalOutputPreview(msg.data);
|
|
1013
|
+
if (!terminalOutput) {
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1013
1016
|
messageBuffer.addMessage(terminalOutput, "result");
|
|
1014
1017
|
forwardAgentMessage({
|
|
1015
1018
|
...msg,
|