@kingsoftcloud/agentkit-harness-ui 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingsoftcloud/agentkit-harness-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Reusable React task-process UI for AgentKit Native: an explicitly versioned event protocol, a pure state reducer, and an accessible timeline. No Studio/DSH/Python imports; React is a peer dependency.",
@@ -94,5 +94,8 @@
94
94
  "publishConfig": {
95
95
  "access": "public",
96
96
  "registry": "https://registry.npmjs.org"
97
+ },
98
+ "dependencies": {
99
+ "@kingsoftcloud/agentkit-harness-core": "0.0.4"
97
100
  }
98
101
  }
package/src/renderers.mjs CHANGED
@@ -94,7 +94,9 @@ function toolShell(item, opts, { icon, summary, body, canToggle = true, defaultO
94
94
  const streaming = toolIsLive(item);
95
95
  if (provisional) { canToggle = false; summaryAction = undefined; actions = []; }
96
96
  const error = status === ToolStatus.Failed && item.error ? redactError(item.error) : null;
97
- if (error && !canToggle) { canToggle = true; defaultOpen = false; }
97
+ // Plain static read failures are already fully visible inline. Structured
98
+ // failures retain a disclosure for the original bounded diagnostic evidence.
99
+ if (error && !canToggle && toolErrorSummary(item.error, opts) !== error) { canToggle = true; defaultOpen = false; }
98
100
  const open = resolveOpen(item, opts, defaultOpen == null ? streaming : defaultOpen, canToggle);
99
101
  const summaryKids = [];
100
102
  if (icon && opts.showToolIcon !== false) summaryKids.push(icon);
@@ -1,3 +1,4 @@
1
+ import { redactDiagnosticText } from '@kingsoftcloud/agentkit-harness-core/error-presentation';
1
2
  // @kingsoftcloud/agentkit-harness-ui — tool call detail blocks
2
3
  //
3
4
  // One stable bounded detail block per call identity. Presentation consumes
@@ -201,7 +202,7 @@ export function redactError(error, opts = {}) {
201
202
  const value = String(error || "");
202
203
  // The error color/placement already expresses the type; keep the message
203
204
  // itself, bounded. Strip common secret patterns defensively.
204
- const cleaned = value.replace(/(token|secret|password|api[_-]?key|authorization)\s*[=:]\s*\S+/gi, "$1=[redacted]");
205
+ const cleaned = redactDiagnosticText(value, 8192);
205
206
  return truncateText(cleaned, { maxLines: 3, maxChars });
206
207
  }
207
208