@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.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  stream,
8
8
  EventStream,
9
9
  GGAIError,
10
+ environmentSecrets,
10
11
  isHardBillingMessage,
11
12
  redactValue,
12
13
  sliceHead,
@@ -92,6 +93,11 @@ function clampOutputTokens(key, requested) {
92
93
  // src/agent-loop.ts
93
94
  var DEFAULT_MAX_TURNS = 300;
94
95
  var DEFAULT_TOOL_TIMEOUT_MS = 3e5;
96
+ var _toolRedaction;
97
+ function toolRedactionOptions() {
98
+ _toolRedaction ??= { secrets: environmentSecrets(process.env) };
99
+ return _toolRedaction;
100
+ }
95
101
  var _diagFn = null;
96
102
  function setStreamDiagnostic(fn) {
97
103
  _diagFn = fn;
@@ -1350,8 +1356,8 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1350
1356
  };
1351
1357
  const raw = await tool.execute(parsed, ctx);
1352
1358
  const normalized = normalizeToolResult(raw);
1353
- resultContent = redactValue(normalized.content);
1354
- details = redactValue(normalized.details);
1359
+ resultContent = redactValue(normalized.content, toolRedactionOptions());
1360
+ details = redactValue(normalized.details, toolRedactionOptions());
1355
1361
  for (const key of options.invalidToolArgumentCounts.keys()) {
1356
1362
  if (key.startsWith(`${toolCall.name}:`)) options.invalidToolArgumentCounts.delete(key);
1357
1363
  }
@@ -1380,12 +1386,15 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1380
1386
  );
1381
1387
  }
1382
1388
  } else {
1383
- resultContent = redactValue(err instanceof Error ? err.message : String(err));
1389
+ resultContent = redactValue(
1390
+ err instanceof Error ? err.message : String(err),
1391
+ toolRedactionOptions()
1392
+ );
1384
1393
  }
1385
1394
  }
1386
1395
  }
1387
- resultContent = redactValue(resultContent);
1388
- details = redactValue(details);
1396
+ resultContent = redactValue(resultContent, toolRedactionOptions());
1397
+ details = redactValue(details, toolRedactionOptions());
1389
1398
  const durationMs = Date.now() - startTime;
1390
1399
  pushEvent({
1391
1400
  type: "tool_call_end",