@agent-inspect/mcp-server 6.31.32 → 6.31.34
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/{chunk-RAPCVULK.mjs → chunk-LRBX7VWN.mjs} +88 -17
- package/dist/chunk-LRBX7VWN.mjs.map +1 -0
- package/dist/cli.cjs +86 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +86 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-RAPCVULK.mjs.map +0 -1
|
@@ -216,8 +216,9 @@ var HIGH_CONFIDENCE_CREDENTIAL_PATTERNS = [
|
|
|
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
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
|
-
|
|
219
|
+
// packages/redact/src/index.ts + packages/core/src/checks DEFAULT_SECRET_PATTERNS (#520/#528).
|
|
220
|
+
// Use non-alnum lookarounds so underscore-adjacent forms (acct_sk_live_…, …_eu) match.
|
|
221
|
+
/(?<![A-Za-z0-9])(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}(?![A-Za-z0-9])/,
|
|
221
222
|
/\bxox[abposr]-[A-Za-z0-9-]{10,}\b/,
|
|
222
223
|
/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b/,
|
|
223
224
|
/\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/,
|
|
@@ -3415,10 +3416,11 @@ var SAFE_USAGE_LEAF_KEYS = /* @__PURE__ */ new Set([
|
|
|
3415
3416
|
var DEFAULT_SECRET_PATTERNS = [
|
|
3416
3417
|
{ id: "bearer-token", pattern: /Bearer\s+[A-Za-z0-9._~+/-]{12,}=*/ },
|
|
3417
3418
|
{ id: "openai-key", pattern: /sk-[A-Za-z0-9_-]{16,}/ },
|
|
3418
|
-
// Stripe + Slack: keep in sync with packages/redact + credential-value-patterns (#520).
|
|
3419
|
+
// Stripe + Slack: keep in sync with packages/redact + credential-value-patterns (#520/#528).
|
|
3420
|
+
// Non-alnum lookarounds so underscore-adjacent forms (acct_sk_live_…, …_eu) match.
|
|
3419
3421
|
{
|
|
3420
3422
|
id: "stripe-key",
|
|
3421
|
-
pattern:
|
|
3423
|
+
pattern: /(?<![A-Za-z0-9])(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}(?![A-Za-z0-9])/
|
|
3422
3424
|
},
|
|
3423
3425
|
{ id: "slack-token", pattern: /\bxox[abposr]-[A-Za-z0-9-]{10,}\b/ },
|
|
3424
3426
|
{ id: "aws-access-key", pattern: /AKIA[0-9A-Z]{16}/ },
|
|
@@ -3602,6 +3604,11 @@ function compareFindings(eventById) {
|
|
|
3602
3604
|
if (STATUS_RANK[a.status] !== STATUS_RANK[b.status]) {
|
|
3603
3605
|
return STATUS_RANK[a.status] - STATUS_RANK[b.status];
|
|
3604
3606
|
}
|
|
3607
|
+
if (a.ruleId === "tool.usage") {
|
|
3608
|
+
const aHasEvent = a.evidence[0]?.eventId !== void 0;
|
|
3609
|
+
const bHasEvent = b.evidence[0]?.eventId !== void 0;
|
|
3610
|
+
if (aHasEvent !== bHasEvent) return aHasEvent ? -1 : 1;
|
|
3611
|
+
}
|
|
3605
3612
|
const byRun = compareStrings(a.evidence[0]?.runId, b.evidence[0]?.runId);
|
|
3606
3613
|
if (byRun !== 0) return byRun;
|
|
3607
3614
|
const byTime = eventTimestamp(a, eventById).localeCompare(eventTimestamp(b, eventById));
|
|
@@ -3685,6 +3692,43 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
|
|
|
3685
3692
|
...meta?.action !== void 0 ? { action: meta.action } : {}
|
|
3686
3693
|
};
|
|
3687
3694
|
}
|
|
3695
|
+
function formatToolNameForMessage(name) {
|
|
3696
|
+
const details = [];
|
|
3697
|
+
for (let index = 0; index < name.length; ) {
|
|
3698
|
+
const codePoint = name.codePointAt(index);
|
|
3699
|
+
const width = codePoint > 65535 ? 2 : 1;
|
|
3700
|
+
if (codePoint > 127) {
|
|
3701
|
+
details.push(
|
|
3702
|
+
`U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`
|
|
3703
|
+
);
|
|
3704
|
+
}
|
|
3705
|
+
index += width;
|
|
3706
|
+
}
|
|
3707
|
+
if (details.length === 0) return name;
|
|
3708
|
+
return `"${name}" (contains ${details.join("; ")})`;
|
|
3709
|
+
}
|
|
3710
|
+
function describeRunningEvent(event) {
|
|
3711
|
+
if (event.kind === "TOOL") {
|
|
3712
|
+
return `tool ${formatToolNameForMessage(resolveCanonicalToolName(event))}`;
|
|
3713
|
+
}
|
|
3714
|
+
if (event.kind === "LLM") {
|
|
3715
|
+
return `llm ${stepEndpointName(event)}`;
|
|
3716
|
+
}
|
|
3717
|
+
return `${event.kind} ${event.name}`;
|
|
3718
|
+
}
|
|
3719
|
+
function incompleteRunningMessage(prefix, running) {
|
|
3720
|
+
const labels = running.map(describeRunningEvent);
|
|
3721
|
+
if (labels.length === 1) {
|
|
3722
|
+
return `${prefix}: ${labels[0]} never completed.`;
|
|
3723
|
+
}
|
|
3724
|
+
return `${prefix}: ${labels.join("; ")}.`;
|
|
3725
|
+
}
|
|
3726
|
+
function stepEndpointName(event, kind) {
|
|
3727
|
+
for (const prefix of ["llm:", "generation:", "transcription:", "speech:"]) {
|
|
3728
|
+
if (event.name.startsWith(prefix)) return event.name.slice(prefix.length);
|
|
3729
|
+
}
|
|
3730
|
+
return event.name;
|
|
3731
|
+
}
|
|
3688
3732
|
function semanticEvents(context) {
|
|
3689
3733
|
return context.logicalEvents ?? context.events;
|
|
3690
3734
|
}
|
|
@@ -3813,10 +3857,13 @@ function createRunStatusRule(options = {}) {
|
|
|
3813
3857
|
findings.push(
|
|
3814
3858
|
failFinding(
|
|
3815
3859
|
"run.status",
|
|
3816
|
-
"Run contains incomplete running events
|
|
3860
|
+
incompleteRunningMessage("Run contains incomplete running events", running),
|
|
3817
3861
|
running.map((event) => eventEvidence(event)),
|
|
3818
3862
|
"no running events",
|
|
3819
|
-
|
|
3863
|
+
{
|
|
3864
|
+
count: running.length,
|
|
3865
|
+
unfinished: running.map(describeRunningEvent)
|
|
3866
|
+
}
|
|
3820
3867
|
)
|
|
3821
3868
|
);
|
|
3822
3869
|
}
|
|
@@ -7520,11 +7567,25 @@ function attemptIdOf(event) {
|
|
|
7520
7567
|
}
|
|
7521
7568
|
return void 0;
|
|
7522
7569
|
}
|
|
7570
|
+
function operationIdOf(event) {
|
|
7571
|
+
const direct = event.attributes?.operationId;
|
|
7572
|
+
if (typeof direct === "string" && direct.trim() !== "") return direct;
|
|
7573
|
+
const meta = event.attributes?.metadata;
|
|
7574
|
+
if (meta && typeof meta === "object" && !Array.isArray(meta)) {
|
|
7575
|
+
const nested = meta.operationId;
|
|
7576
|
+
if (typeof nested === "string" && nested.trim() !== "") return nested;
|
|
7577
|
+
}
|
|
7578
|
+
return void 0;
|
|
7579
|
+
}
|
|
7523
7580
|
function lifecycleKey(event) {
|
|
7524
7581
|
if (event.kind === "RUN") return `run:${event.runId}`;
|
|
7525
7582
|
const stepId = stepIdOf2(event);
|
|
7526
|
-
if (stepId
|
|
7527
|
-
|
|
7583
|
+
if (stepId === void 0) return `event:${event.eventId}`;
|
|
7584
|
+
const attemptId = attemptIdOf(event);
|
|
7585
|
+
if (attemptId !== void 0) return `step:${stepId}:attempt:${attemptId}`;
|
|
7586
|
+
const operationId = operationIdOf(event);
|
|
7587
|
+
if (operationId !== void 0) return `step:${stepId}:op:${operationId}`;
|
|
7588
|
+
return `step:${stepId}`;
|
|
7528
7589
|
}
|
|
7529
7590
|
function isTerminal(status) {
|
|
7530
7591
|
return status === "ok" || status === "error";
|
|
@@ -7575,6 +7636,12 @@ function joinSiblingGroup(group) {
|
|
|
7575
7636
|
const others = group.filter(
|
|
7576
7637
|
(n) => !isTerminal(n.event.status) && n.event.status !== "running"
|
|
7577
7638
|
);
|
|
7639
|
+
const operationIds = new Set(
|
|
7640
|
+
group.map((n) => operationIdOf(n.event)).filter((id) => id !== void 0)
|
|
7641
|
+
);
|
|
7642
|
+
if (operationIds.size > 1) {
|
|
7643
|
+
return group;
|
|
7644
|
+
}
|
|
7578
7645
|
const terminalStatuses = new Set(terminals.map((n) => n.event.status));
|
|
7579
7646
|
if (terminalStatuses.size > 1) {
|
|
7580
7647
|
return group;
|
|
@@ -7586,19 +7653,22 @@ function joinSiblingGroup(group) {
|
|
|
7586
7653
|
const out = [];
|
|
7587
7654
|
for (const terminal of terminals) {
|
|
7588
7655
|
const terminalAttempt = attemptIdOf(terminal.event);
|
|
7656
|
+
const terminalOp = operationIdOf(terminal.event);
|
|
7589
7657
|
const terminalTs = eventTime(terminal.event);
|
|
7590
|
-
const
|
|
7658
|
+
const candidates = runnings.filter((r) => {
|
|
7591
7659
|
if (usedRunning.has(r.event.eventId)) return false;
|
|
7592
7660
|
if (eventTime(r.event) > terminalTs) return false;
|
|
7661
|
+
const runningOp = operationIdOf(r.event);
|
|
7662
|
+
if (terminalOp !== void 0 && runningOp !== void 0 && terminalOp !== runningOp) {
|
|
7663
|
+
return false;
|
|
7664
|
+
}
|
|
7593
7665
|
const runningAttempt = attemptIdOf(r.event);
|
|
7594
7666
|
if (terminalAttempt !== void 0) {
|
|
7595
7667
|
return runningAttempt === terminalAttempt;
|
|
7596
7668
|
}
|
|
7597
|
-
|
|
7598
|
-
return true;
|
|
7599
|
-
}
|
|
7600
|
-
return true;
|
|
7669
|
+
return runningAttempt === void 0;
|
|
7601
7670
|
});
|
|
7671
|
+
const candidate = candidates.length === 1 ? candidates[0] : void 0;
|
|
7602
7672
|
if (candidate) {
|
|
7603
7673
|
usedRunning.add(candidate.event.eventId);
|
|
7604
7674
|
out.push(joinOnePair(candidate, terminal));
|
|
@@ -8771,10 +8841,11 @@ var credentialDetectors = [
|
|
|
8771
8841
|
severity: "error"
|
|
8772
8842
|
}),
|
|
8773
8843
|
// Stripe secret/restricted keys (underscore form). Keep in sync with
|
|
8774
|
-
// packages/core/src/safety/credential-value-patterns.ts + checks DEFAULT_SECRET_PATTERNS (#520).
|
|
8844
|
+
// packages/core/src/safety/credential-value-patterns.ts + checks DEFAULT_SECRET_PATTERNS (#520/#528).
|
|
8845
|
+
// Non-alnum lookarounds so underscore-adjacent forms (acct_sk_live_…, …_eu) match.
|
|
8775
8846
|
patternDetector({
|
|
8776
8847
|
id: "value.stripeSecretKey",
|
|
8777
|
-
pattern:
|
|
8848
|
+
pattern: /(?<![A-Za-z0-9])(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}(?![A-Za-z0-9])/,
|
|
8778
8849
|
severity: "error"
|
|
8779
8850
|
}),
|
|
8780
8851
|
patternDetector({
|
|
@@ -9994,5 +10065,5 @@ async function runReadOnlyMcpServer(options = {}) {
|
|
|
9994
10065
|
}
|
|
9995
10066
|
|
|
9996
10067
|
export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
|
|
9997
|
-
//# sourceMappingURL=chunk-
|
|
9998
|
-
//# sourceMappingURL=chunk-
|
|
10068
|
+
//# sourceMappingURL=chunk-LRBX7VWN.mjs.map
|
|
10069
|
+
//# sourceMappingURL=chunk-LRBX7VWN.mjs.map
|