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