@agent-inspect/mcp-server 6.31.30 → 6.31.32

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).
@@ -7500,6 +7510,16 @@ function stepIdOf2(event) {
7500
7510
  const value = event.attributes?.stepId;
7501
7511
  return typeof value === "string" && value.trim() !== "" ? value : void 0;
7502
7512
  }
7513
+ function attemptIdOf(event) {
7514
+ const direct = event.attributes?.attemptId;
7515
+ if (typeof direct === "string" && direct.trim() !== "") return direct;
7516
+ const meta = event.attributes?.metadata;
7517
+ if (meta && typeof meta === "object" && !Array.isArray(meta)) {
7518
+ const nested = meta.attemptId;
7519
+ if (typeof nested === "string" && nested.trim() !== "") return nested;
7520
+ }
7521
+ return void 0;
7522
+ }
7503
7523
  function lifecycleKey(event) {
7504
7524
  if (event.kind === "RUN") return `run:${event.runId}`;
7505
7525
  const stepId = stepIdOf2(event);
@@ -7509,6 +7529,9 @@ function lifecycleKey(event) {
7509
7529
  function isTerminal(status) {
7510
7530
  return status === "ok" || status === "error";
7511
7531
  }
7532
+ function eventTime(event) {
7533
+ return typeof event.timestamp === "number" ? event.timestamp : 0;
7534
+ }
7512
7535
  function cloneNode(node) {
7513
7536
  return {
7514
7537
  event: {
@@ -7519,37 +7542,87 @@ function cloneNode(node) {
7519
7542
  depth: node.depth
7520
7543
  };
7521
7544
  }
7545
+ function joinOnePair(start, terminal) {
7546
+ const childMap = /* @__PURE__ */ new Map();
7547
+ if (start) {
7548
+ for (const child of start.children) {
7549
+ childMap.set(child.event.eventId, child);
7550
+ }
7551
+ }
7552
+ for (const child of terminal.children) {
7553
+ childMap.set(child.event.eventId, child);
7554
+ }
7555
+ return {
7556
+ event: {
7557
+ ...terminal.event,
7558
+ name: start?.event.name ?? terminal.event.name,
7559
+ kind: start?.event.kind ?? terminal.event.kind,
7560
+ ...start && attemptIdOf(terminal.event) === void 0 && attemptIdOf(start.event) ? {
7561
+ attributes: {
7562
+ ...terminal.event.attributes,
7563
+ attemptId: attemptIdOf(start.event)
7564
+ }
7565
+ } : {}
7566
+ },
7567
+ children: presentSiblingNodes([...childMap.values()]),
7568
+ depth: terminal.depth
7569
+ };
7570
+ }
7522
7571
  function joinSiblingGroup(group) {
7523
7572
  if (group.length <= 1) return group;
7524
- const terminals = group.filter((n) => isTerminal(n.event.status));
7525
- const runnings = group.filter((n) => n.event.status === "running");
7573
+ const terminals = group.filter((n) => isTerminal(n.event.status)).sort((a, b) => eventTime(a.event) - eventTime(b.event));
7574
+ const runnings = group.filter((n) => n.event.status === "running").sort((a, b) => eventTime(a.event) - eventTime(b.event));
7575
+ const others = group.filter(
7576
+ (n) => !isTerminal(n.event.status) && n.event.status !== "running"
7577
+ );
7526
7578
  const terminalStatuses = new Set(terminals.map((n) => n.event.status));
7527
7579
  if (terminalStatuses.size > 1) {
7528
7580
  return group;
7529
7581
  }
7530
- if (terminals.length >= 1) {
7531
- const terminal = terminals[terminals.length - 1];
7532
- const start = runnings[0];
7533
- const childMap = /* @__PURE__ */ new Map();
7534
- for (const n of group) {
7535
- for (const child of n.children) {
7536
- childMap.set(child.event.eventId, child);
7582
+ if (terminals.length > 1 && terminals.every((t) => attemptIdOf(t.event) === void 0) && runnings.every((r) => attemptIdOf(r.event) === void 0)) {
7583
+ return group;
7584
+ }
7585
+ const usedRunning = /* @__PURE__ */ new Set();
7586
+ const out = [];
7587
+ for (const terminal of terminals) {
7588
+ const terminalAttempt = attemptIdOf(terminal.event);
7589
+ const terminalTs = eventTime(terminal.event);
7590
+ const candidate = runnings.find((r) => {
7591
+ if (usedRunning.has(r.event.eventId)) return false;
7592
+ if (eventTime(r.event) > terminalTs) return false;
7593
+ const runningAttempt = attemptIdOf(r.event);
7594
+ if (terminalAttempt !== void 0) {
7595
+ return runningAttempt === terminalAttempt;
7537
7596
  }
7538
- }
7539
- return [
7540
- {
7541
- event: {
7542
- ...terminal.event,
7543
- name: start?.event.name ?? terminal.event.name,
7544
- kind: start?.event.kind ?? terminal.event.kind,
7545
- ...start?.event.timestamp !== void 0 && terminal.event.durationMs === void 0 ? {} : {}
7546
- },
7547
- children: presentSiblingNodes([...childMap.values()]),
7548
- depth: terminal.depth
7597
+ if (runningAttempt !== void 0) {
7598
+ return true;
7549
7599
  }
7550
- ];
7600
+ return true;
7601
+ });
7602
+ if (candidate) {
7603
+ usedRunning.add(candidate.event.eventId);
7604
+ out.push(joinOnePair(candidate, terminal));
7605
+ } else {
7606
+ out.push({
7607
+ ...terminal,
7608
+ children: presentSiblingNodes(terminal.children)
7609
+ });
7610
+ }
7611
+ }
7612
+ for (const running of runnings) {
7613
+ if (usedRunning.has(running.event.eventId)) continue;
7614
+ out.push({
7615
+ ...running,
7616
+ children: presentSiblingNodes(running.children)
7617
+ });
7551
7618
  }
7552
- return group;
7619
+ for (const other of others) {
7620
+ out.push({
7621
+ ...other,
7622
+ children: presentSiblingNodes(other.children)
7623
+ });
7624
+ }
7625
+ return out;
7553
7626
  }
7554
7627
  function presentSiblingNodes(nodes) {
7555
7628
  const prepared = nodes.map((n) => ({
@@ -8697,6 +8770,18 @@ var credentialDetectors = [
8697
8770
  pattern: /\b(?:sk-(?:proj-)?[a-zA-Z0-9_-]{16,}|sk-ant-[a-zA-Z0-9_-]{16,}|AIza[0-9A-Za-z_-]{20,})\b/,
8698
8771
  severity: "error"
8699
8772
  }),
8773
+ // Stripe secret/restricted keys (underscore form). Keep in sync with
8774
+ // packages/core/src/safety/credential-value-patterns.ts + checks DEFAULT_SECRET_PATTERNS (#520).
8775
+ patternDetector({
8776
+ id: "value.stripeSecretKey",
8777
+ pattern: /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}\b/,
8778
+ severity: "error"
8779
+ }),
8780
+ patternDetector({
8781
+ id: "value.slackToken",
8782
+ pattern: /\bxox[abposr]-[A-Za-z0-9-]{10,}\b/,
8783
+ severity: "error"
8784
+ }),
8700
8785
  patternDetector({
8701
8786
  id: "value.githubToken",
8702
8787
  pattern: /\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b/,
@@ -9909,5 +9994,5 @@ async function runReadOnlyMcpServer(options = {}) {
9909
9994
  }
9910
9995
 
9911
9996
  export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
9912
- //# sourceMappingURL=chunk-PN5KPAGV.mjs.map
9913
- //# sourceMappingURL=chunk-PN5KPAGV.mjs.map
9997
+ //# sourceMappingURL=chunk-RAPCVULK.mjs.map
9998
+ //# sourceMappingURL=chunk-RAPCVULK.mjs.map