@productbrain/mcp 0.0.1-beta.10249 → 0.0.1-beta.10270

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.
@@ -43,7 +43,7 @@ import {
43
43
  trackQualityVerdict,
44
44
  trackSessionCaptureRate,
45
45
  trackZeroCaptureAuditFired
46
- } from "./chunk-BS4ZQRGV.js";
46
+ } from "./chunk-FKPBLV33.js";
47
47
 
48
48
  // src/server.ts
49
49
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -10864,11 +10864,10 @@ async function handleClose() {
10864
10864
  } catch {
10865
10865
  }
10866
10866
  }
10867
- await closeAgentSession();
10867
+ const closed = await closeAgentSession();
10868
10868
  clearSessionGaps();
10869
- const created = session?.entriesCreated?.length ?? 0;
10870
- const modified = session?.entriesModified?.length ?? 0;
10871
- const relations = session?.relationsCreated ?? 0;
10869
+ if (!closed) throw new Error("No active agent session to close.");
10870
+ const { created, modified, relationsCreated: relations, capturesTruncated, modifiedTruncated, capLine } = closed;
10872
10871
  const wsCtx = await getWorkspaceContext();
10873
10872
  if (wsCtx) {
10874
10873
  trackSessionCaptureRate(wsCtx.workspaceId, {
@@ -10884,17 +10883,15 @@ async function handleClose() {
10884
10883
  ];
10885
10884
  const gates = session?.gateFailures ?? 0;
10886
10885
  const warnings = session?.contradictionWarnings ?? 0;
10887
- if (session) {
10888
- lines.push(
10889
- `| Metric | Count |`,
10890
- `|--------|-------|`,
10891
- `| Entries created | ${created} |`,
10892
- `| Entries modified | ${modified} |`,
10893
- `| Relations created | ${relations} |`,
10894
- `| Gate failures | ${gates} |`,
10895
- `| Contradiction warnings | ${warnings} |`
10896
- );
10897
- }
10886
+ lines.push(
10887
+ `| Metric | Count |`,
10888
+ `|--------|-------|`,
10889
+ `| Entries created | ${created} |`,
10890
+ `| Entries modified | ${modified} |`,
10891
+ `| Relations created | ${relations} |`,
10892
+ ...session ? [`| Gate failures | ${gates} |`, `| Contradiction warnings | ${warnings} |`] : []
10893
+ );
10894
+ if (capLine) lines.push("", capLine);
10898
10895
  let rituals = null;
10899
10896
  try {
10900
10897
  rituals = await kernelCall("chain.getRitualsSurface", {});
@@ -10911,6 +10908,9 @@ async function handleClose() {
10911
10908
  entriesCreated: created,
10912
10909
  entriesModified: modified,
10913
10910
  relationsCreated: relations,
10911
+ capturesTruncated,
10912
+ modifiedTruncated,
10913
+ ...capLine ? { capLine } : {},
10914
10914
  gateFailures: gates,
10915
10915
  contradictionWarnings: warnings,
10916
10916
  wrapupNudge: wrapupNudge.length > 0,
@@ -12941,4 +12941,4 @@ export {
12941
12941
  createProductBrainServer,
12942
12942
  initFeatureFlags
12943
12943
  };
12944
- //# sourceMappingURL=chunk-UAELJM5L.js.map
12944
+ //# sourceMappingURL=chunk-VMPJCYSC.js.map