@agent-inspect/mcp-server 6.31.31 → 6.31.33

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.
@@ -215,6 +215,10 @@ var HIGH_CONFIDENCE_CREDENTIAL_PATTERNS = [
215
215
  /\b[a-z0-9_.-]+=[^;\s]+(?:;\s*[a-z0-9_.-]+=[^;\s]+)+/i,
216
216
  /\beyJ[a-zA-Z0-9_-]{8,}\.[a-zA-Z0-9_-]{8,}\.[a-zA-Z0-9_-]{8,}\b/,
217
217
  /\b(?:sk-(?:proj-)?[a-zA-Z0-9_-]{16,}|sk-ant-[a-zA-Z0-9_-]{16,}|AIza[0-9A-Za-z_-]{20,})\b/,
218
+ // Stripe secret / restricted keys use underscores (not sk-). Keep in sync with
219
+ // packages/redact/src/index.ts + packages/core/src/checks DEFAULT_SECRET_PATTERNS (#520).
220
+ /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}\b/,
221
+ /\bxox[abposr]-[A-Za-z0-9-]{10,}\b/,
218
222
  /\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b/,
219
223
  /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/,
220
224
  /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*-----END [A-Z ]*PRIVATE KEY-----/,
@@ -3411,6 +3415,12 @@ var SAFE_USAGE_LEAF_KEYS = /* @__PURE__ */ new Set([
3411
3415
  var DEFAULT_SECRET_PATTERNS = [
3412
3416
  { id: "bearer-token", pattern: /Bearer\s+[A-Za-z0-9._~+/-]{12,}=*/ },
3413
3417
  { id: "openai-key", pattern: /sk-[A-Za-z0-9_-]{16,}/ },
3418
+ // Stripe + Slack: keep in sync with packages/redact + credential-value-patterns (#520).
3419
+ {
3420
+ id: "stripe-key",
3421
+ pattern: /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}\b/
3422
+ },
3423
+ { id: "slack-token", pattern: /\bxox[abposr]-[A-Za-z0-9-]{10,}\b/ },
3414
3424
  { id: "aws-access-key", pattern: /AKIA[0-9A-Z]{16}/ },
3415
3425
  { id: "github-token", pattern: /gh[opsu]_[A-Za-z0-9_]{20,}/ },
3416
3426
  // Keep in sync with packages/redact/src/key-value-secret.ts (KEY_VALUE_SECRET_PATTERN_SOURCE).
@@ -3592,6 +3602,11 @@ function compareFindings(eventById) {
3592
3602
  if (STATUS_RANK[a.status] !== STATUS_RANK[b.status]) {
3593
3603
  return STATUS_RANK[a.status] - STATUS_RANK[b.status];
3594
3604
  }
3605
+ if (a.ruleId === "tool.usage") {
3606
+ const aHasEvent = a.evidence[0]?.eventId !== void 0;
3607
+ const bHasEvent = b.evidence[0]?.eventId !== void 0;
3608
+ if (aHasEvent !== bHasEvent) return aHasEvent ? -1 : 1;
3609
+ }
3595
3610
  const byRun = compareStrings(a.evidence[0]?.runId, b.evidence[0]?.runId);
3596
3611
  if (byRun !== 0) return byRun;
3597
3612
  const byTime = eventTimestamp(a, eventById).localeCompare(eventTimestamp(b, eventById));
@@ -3675,6 +3690,43 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
3675
3690
  ...meta?.action !== void 0 ? { action: meta.action } : {}
3676
3691
  };
3677
3692
  }
3693
+ function formatToolNameForMessage(name) {
3694
+ const details = [];
3695
+ for (let index = 0; index < name.length; ) {
3696
+ const codePoint = name.codePointAt(index);
3697
+ const width = codePoint > 65535 ? 2 : 1;
3698
+ if (codePoint > 127) {
3699
+ details.push(
3700
+ `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`
3701
+ );
3702
+ }
3703
+ index += width;
3704
+ }
3705
+ if (details.length === 0) return name;
3706
+ return `"${name}" (contains ${details.join("; ")})`;
3707
+ }
3708
+ function describeRunningEvent(event) {
3709
+ if (event.kind === "TOOL") {
3710
+ return `tool ${formatToolNameForMessage(resolveCanonicalToolName(event))}`;
3711
+ }
3712
+ if (event.kind === "LLM") {
3713
+ return `llm ${stepEndpointName(event)}`;
3714
+ }
3715
+ return `${event.kind} ${event.name}`;
3716
+ }
3717
+ function incompleteRunningMessage(prefix, running) {
3718
+ const labels = running.map(describeRunningEvent);
3719
+ if (labels.length === 1) {
3720
+ return `${prefix}: ${labels[0]} never completed.`;
3721
+ }
3722
+ return `${prefix}: ${labels.join("; ")}.`;
3723
+ }
3724
+ function stepEndpointName(event, kind) {
3725
+ for (const prefix of ["llm:", "generation:", "transcription:", "speech:"]) {
3726
+ if (event.name.startsWith(prefix)) return event.name.slice(prefix.length);
3727
+ }
3728
+ return event.name;
3729
+ }
3678
3730
  function semanticEvents(context) {
3679
3731
  return context.logicalEvents ?? context.events;
3680
3732
  }
@@ -3803,10 +3855,13 @@ function createRunStatusRule(options = {}) {
3803
3855
  findings.push(
3804
3856
  failFinding(
3805
3857
  "run.status",
3806
- "Run contains incomplete running events.",
3858
+ incompleteRunningMessage("Run contains incomplete running events", running),
3807
3859
  running.map((event) => eventEvidence(event)),
3808
3860
  "no running events",
3809
- running.length
3861
+ {
3862
+ count: running.length,
3863
+ unfinished: running.map(describeRunningEvent)
3864
+ }
3810
3865
  )
3811
3866
  );
3812
3867
  }
@@ -8760,6 +8815,18 @@ var credentialDetectors = [
8760
8815
  pattern: /\b(?:sk-(?:proj-)?[a-zA-Z0-9_-]{16,}|sk-ant-[a-zA-Z0-9_-]{16,}|AIza[0-9A-Za-z_-]{20,})\b/,
8761
8816
  severity: "error"
8762
8817
  }),
8818
+ // Stripe secret/restricted keys (underscore form). Keep in sync with
8819
+ // packages/core/src/safety/credential-value-patterns.ts + checks DEFAULT_SECRET_PATTERNS (#520).
8820
+ patternDetector({
8821
+ id: "value.stripeSecretKey",
8822
+ pattern: /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}\b/,
8823
+ severity: "error"
8824
+ }),
8825
+ patternDetector({
8826
+ id: "value.slackToken",
8827
+ pattern: /\bxox[abposr]-[A-Za-z0-9-]{10,}\b/,
8828
+ severity: "error"
8829
+ }),
8763
8830
  patternDetector({
8764
8831
  id: "value.githubToken",
8765
8832
  pattern: /\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b/,
@@ -9972,5 +10039,5 @@ async function runReadOnlyMcpServer(options = {}) {
9972
10039
  }
9973
10040
 
9974
10041
  export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
9975
- //# sourceMappingURL=chunk-W5KI3MNP.mjs.map
9976
- //# sourceMappingURL=chunk-W5KI3MNP.mjs.map
10042
+ //# sourceMappingURL=chunk-B7FCFNLA.mjs.map
10043
+ //# sourceMappingURL=chunk-B7FCFNLA.mjs.map