@agent-inspect/viewer 6.29.5 → 6.30.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 CHANGED
@@ -2356,8 +2356,26 @@ function createToolUsageRule(options) {
2356
2356
  const findings = [];
2357
2357
  for (const required of options.required ?? []) {
2358
2358
  if (!nameSet.has(required)) {
2359
+ const otherKinds = [
2360
+ ...new Set(
2361
+ context.events.filter((event) => {
2362
+ const kind = typeof event.kind === "string" ? event.kind.toUpperCase() : "";
2363
+ if (kind === "TOOL") return false;
2364
+ return resolveCanonicalToolName(event) === required || event.name === required || event.name === `tool:${required}` || event.name.endsWith(`:${required}`);
2365
+ }).map(
2366
+ (event) => typeof event.kind === "string" ? event.kind.toUpperCase() : "UNKNOWN"
2367
+ )
2368
+ )
2369
+ ].sort();
2370
+ const hint = otherKinds.length > 0 ? ` Required name appears under non-TOOL kind(s): ${otherKinds.join(", ")}. tools.required / requiredOrder match TOOL events only.` : "";
2359
2371
  findings.push(
2360
- failFinding("tool.usage", `Required tool ${required} did not appear.`, runEvidence(context.selectedRun), required, names)
2372
+ failFinding(
2373
+ "tool.usage",
2374
+ `Required tool ${required} did not appear.${hint}`,
2375
+ runEvidence(context.selectedRun),
2376
+ required,
2377
+ names
2378
+ )
2361
2379
  );
2362
2380
  }
2363
2381
  }