@kenkaiiii/gg-agent 5.63.0 → 5.64.0
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/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -120,6 +120,11 @@ function clampOutputTokens(key, requested) {
|
|
|
120
120
|
// src/agent-loop.ts
|
|
121
121
|
var DEFAULT_MAX_TURNS = 300;
|
|
122
122
|
var DEFAULT_TOOL_TIMEOUT_MS = 3e5;
|
|
123
|
+
var _toolRedaction;
|
|
124
|
+
function toolRedactionOptions() {
|
|
125
|
+
_toolRedaction ??= { secrets: (0, import_gg_ai.environmentSecrets)(process.env) };
|
|
126
|
+
return _toolRedaction;
|
|
127
|
+
}
|
|
123
128
|
var _diagFn = null;
|
|
124
129
|
function setStreamDiagnostic(fn) {
|
|
125
130
|
_diagFn = fn;
|
|
@@ -1378,8 +1383,8 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
|
|
|
1378
1383
|
};
|
|
1379
1384
|
const raw = await tool.execute(parsed, ctx);
|
|
1380
1385
|
const normalized = normalizeToolResult(raw);
|
|
1381
|
-
resultContent = (0, import_gg_ai.redactValue)(normalized.content);
|
|
1382
|
-
details = (0, import_gg_ai.redactValue)(normalized.details);
|
|
1386
|
+
resultContent = (0, import_gg_ai.redactValue)(normalized.content, toolRedactionOptions());
|
|
1387
|
+
details = (0, import_gg_ai.redactValue)(normalized.details, toolRedactionOptions());
|
|
1383
1388
|
for (const key of options.invalidToolArgumentCounts.keys()) {
|
|
1384
1389
|
if (key.startsWith(`${toolCall.name}:`)) options.invalidToolArgumentCounts.delete(key);
|
|
1385
1390
|
}
|
|
@@ -1408,12 +1413,15 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
|
|
|
1408
1413
|
);
|
|
1409
1414
|
}
|
|
1410
1415
|
} else {
|
|
1411
|
-
resultContent = (0, import_gg_ai.redactValue)(
|
|
1416
|
+
resultContent = (0, import_gg_ai.redactValue)(
|
|
1417
|
+
err instanceof Error ? err.message : String(err),
|
|
1418
|
+
toolRedactionOptions()
|
|
1419
|
+
);
|
|
1412
1420
|
}
|
|
1413
1421
|
}
|
|
1414
1422
|
}
|
|
1415
|
-
resultContent = (0, import_gg_ai.redactValue)(resultContent);
|
|
1416
|
-
details = (0, import_gg_ai.redactValue)(details);
|
|
1423
|
+
resultContent = (0, import_gg_ai.redactValue)(resultContent, toolRedactionOptions());
|
|
1424
|
+
details = (0, import_gg_ai.redactValue)(details, toolRedactionOptions());
|
|
1417
1425
|
const durationMs = Date.now() - startTime;
|
|
1418
1426
|
pushEvent({
|
|
1419
1427
|
type: "tool_call_end",
|