agent-inspect 6.13.0 → 6.14.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.
@@ -4346,6 +4346,7 @@ function buildEvidenceManifest(parts) {
4346
4346
  verificationPolicy: parts.verificationPolicy ?? parts.redactionProfile
4347
4347
  },
4348
4348
  assessment,
4349
+ ...parts.semantics !== void 0 ? { semantics: { ...parts.semantics } } : {},
4349
4350
  files: buildEvidenceFileEntries(parts.files)
4350
4351
  };
4351
4352
  }
@@ -5986,7 +5987,8 @@ function buildEvidenceCiPackage(input3) {
5986
5987
  sourceStatus: input3.sourceStatus,
5987
5988
  files: packaged,
5988
5989
  createdAt,
5989
- note: EVIDENCE_ASSESSMENT_NOTE
5990
+ note: EVIDENCE_ASSESSMENT_NOTE,
5991
+ ...input3.semantics !== void 0 ? { semantics: input3.semantics } : {}
5990
5992
  });
5991
5993
  return {
5992
5994
  "evidence.html": evidenceHtml,
@@ -6616,6 +6618,28 @@ var init_logical_events = __esm({
6616
6618
  });
6617
6619
 
6618
6620
  // packages/core/src/checks/trace-facts.ts
6621
+ function summarizeSemanticParity(events) {
6622
+ const projection = projectLogicalEvents(events);
6623
+ const logical = projection.logicalEvents;
6624
+ const finishedTools = logical.filter(
6625
+ (event) => event.kind === "TOOL" && event.status !== "running"
6626
+ );
6627
+ const finishedToolNames = Object.freeze(
6628
+ finishedTools.map((event) => resolveCanonicalToolName(event)).sort((a, b) => a.localeCompare(b))
6629
+ );
6630
+ return {
6631
+ rawEventCount: events.length,
6632
+ logicalEventCount: logical.length,
6633
+ runningLogicalCount: logical.filter((event) => event.status === "running").length,
6634
+ finishedToolNames,
6635
+ finishedToolCount: finishedTools.length,
6636
+ pairedCount: logical.filter((event) => event.projection.paired).length,
6637
+ parentRemapCount: projection.diagnostics.filter(
6638
+ (item) => item.code === "AI_LOGICAL_PARENT_REMAPPED"
6639
+ ).length,
6640
+ diagnostics: projection.diagnostics
6641
+ };
6642
+ }
6619
6643
  var init_trace_facts = __esm({
6620
6644
  "packages/core/src/checks/trace-facts.ts"() {
6621
6645
  init_logical_events();
@@ -12169,7 +12193,7 @@ var init_src = __esm({
12169
12193
  });
12170
12194
 
12171
12195
  // package.json
12172
- var version = "6.13.0";
12196
+ var version = "6.14.0";
12173
12197
 
12174
12198
  // packages/cli/src/list.ts
12175
12199
  init_advanced();
@@ -20854,6 +20878,7 @@ async function artifactsCommand(target, options = {}, stdin = process.stdin) {
20854
20878
  findings: check.findings.length
20855
20879
  }))
20856
20880
  });
20881
+ const parity = summarizeSemanticParity(read.events);
20857
20882
  const evidencePackage = buildEvidenceCiPackage({
20858
20883
  generatorVersion: version,
20859
20884
  runIds,
@@ -20862,7 +20887,18 @@ async function artifactsCommand(target, options = {}, stdin = process.stdin) {
20862
20887
  redactionProfile: "strict",
20863
20888
  assessmentStatus: toEvidenceStatus(status),
20864
20889
  checkResultsJson,
20865
- summaryText: renderMarkdown(trace, check, diff)
20890
+ summaryText: renderMarkdown(trace, check, diff),
20891
+ semantics: {
20892
+ projectionVersion: "logical-lifecycle-0.1",
20893
+ rawEventCount: parity.rawEventCount,
20894
+ logicalEventCount: parity.logicalEventCount,
20895
+ runningLogicalCount: parity.runningLogicalCount,
20896
+ finishedToolCount: parity.finishedToolCount,
20897
+ finishedToolNames: [...parity.finishedToolNames],
20898
+ pairedCount: parity.pairedCount,
20899
+ parentRemapCount: parity.parentRemapCount,
20900
+ contractStatus: check.status === "pass" ? "pass" : check.status === "fail" ? "fail" : "error"
20901
+ }
20866
20902
  });
20867
20903
  await writeArtifact(outputDir, "evidence.html", evidencePackage["evidence.html"], files);
20868
20904
  await writeArtifact(outputDir, "evidence.json", evidencePackage["evidence.json"], files);
@@ -21949,11 +21985,11 @@ var TRACE_DIR = ".agent-inspect";
21949
21985
  var GITKEEP = ".agent-inspect/.gitkeep";
21950
21986
  function normalizeFramework(value) {
21951
21987
  const raw = (value ?? "custom").trim();
21952
- if (raw === "ai-sdk" || raw === "openai-agents" || raw === "langchain" || raw === "custom") {
21988
+ if (raw === "ai-sdk" || raw === "openai-agents" || raw === "langchain" || raw === "langgraph" || raw === "custom") {
21953
21989
  return raw;
21954
21990
  }
21955
21991
  throw new Error(
21956
- "Unsupported --framework value. Use ai-sdk, openai-agents, langchain, or custom."
21992
+ "Unsupported --framework value. Use ai-sdk, openai-agents, langchain, langgraph, or custom."
21957
21993
  );
21958
21994
  }
21959
21995
  function configTemplate(framework) {
@@ -22026,6 +22062,30 @@ async function main() {
22026
22062
  console.log("Trace written to .agent-inspect/");
22027
22063
  }
22028
22064
 
22065
+ main().catch((error) => {
22066
+ console.error(error);
22067
+ process.exitCode = 1;
22068
+ });
22069
+ `;
22070
+ case "langgraph":
22071
+ return `/**
22072
+ * LangGraph onboarding starter \u2014 no provider keys.
22073
+ * Prefer @agent-inspect/langchain callbacks with your StateGraph in app code.
22074
+ * This demo writes a bridged tool lifecycle you can check/gate locally.
22075
+ */
22076
+ import { inspectRun, step } from "agent-inspect";
22077
+
22078
+ async function main() {
22079
+ await inspectRun("langgraph-demo", async () => {
22080
+ await step("chain:agent", async () => {
22081
+ await step.tool("lookup_orders", async () => ({ orders: 0 }));
22082
+ return { ok: true };
22083
+ });
22084
+ }, { traceDir: ".agent-inspect", silent: true });
22085
+ console.log("Trace written to .agent-inspect/");
22086
+ console.log("Next: npx agent-inspect check <run-id> --required-tool lookup_orders");
22087
+ }
22088
+
22029
22089
  main().catch((error) => {
22030
22090
  console.error(error);
22031
22091
  process.exitCode = 1;
@@ -22181,7 +22241,8 @@ var OPTIONAL_PACKAGES = {
22181
22241
  custom: [],
22182
22242
  "ai-sdk": ["@agent-inspect/ai-sdk"],
22183
22243
  "openai-agents": ["@agent-inspect/openai-agents"],
22184
- langchain: ["@agent-inspect/langchain"]
22244
+ langchain: ["@agent-inspect/langchain"],
22245
+ langgraph: ["@agent-inspect/langchain"]
22185
22246
  };
22186
22247
  function nodeVersionCheck() {
22187
22248
  const major = Number(process3__default.default.versions.node.split(".")[0]);
@@ -24011,6 +24072,7 @@ function createCliProgram() {
24011
24072
  "ai-sdk",
24012
24073
  "openai-agents",
24013
24074
  "langchain",
24075
+ "langgraph",
24014
24076
  "custom"
24015
24077
  ])
24016
24078
  ).addOption(new commander.Option("--ci <provider>", "optional CI snippet").choices(["github"])).option("--dry-run", "print planned files without writing").option("--yes", "non-interactive; skip existing files").option("--json", "print deterministic JSON plan/result").action((opts) => {
@@ -24021,6 +24083,7 @@ function createCliProgram() {
24021
24083
  "ai-sdk",
24022
24084
  "openai-agents",
24023
24085
  "langchain",
24086
+ "langgraph",
24024
24087
  "custom"
24025
24088
  ])
24026
24089
  ).action((opts) => {