@productbrain/mcp 0.0.1-beta.1919 → 0.0.1-beta.1934

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.
@@ -4,6 +4,7 @@ import {
4
4
  getAgentSessionId,
5
5
  getApiKeyScope,
6
6
  getAuditLog,
7
+ getConversationId,
7
8
  getRequestApiKey,
8
9
  getWorkspaceContext,
9
10
  getWorkspaceId,
@@ -37,7 +38,7 @@ import {
37
38
  trackSessionCaptureRate,
38
39
  trackWriteBackHintServed,
39
40
  trackZeroCaptureAuditFired
40
- } from "./chunk-6JNK5DIZ.js";
41
+ } from "./chunk-VFSXDXLC.js";
41
42
 
42
43
  // src/server.ts
43
44
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -10666,7 +10667,11 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
10666
10667
  let priorSessions = [];
10667
10668
  let recoveryBlock = null;
10668
10669
  try {
10669
- const sessionsResult = await kernelQuery("agent.recentSessions", { limit: 3 });
10670
+ const recentConversationId = getConversationId();
10671
+ const sessionsResult = await kernelQuery(
10672
+ "agent.recentSessions",
10673
+ recentConversationId ? { limit: 3, conversationId: recentConversationId } : { limit: 3 }
10674
+ );
10670
10675
  priorSessions = sessionsResult?.sessions ?? [];
10671
10676
  recoveryBlock = sessionsResult?.recoveryBlock ?? null;
10672
10677
  } catch {
@@ -12102,7 +12107,16 @@ function reportOrientWrapperBytes(toolResult, truncated, tier, taskProvided) {
12102
12107
  try {
12103
12108
  const fullToolOutput = JSON.stringify({ content: toolResult.content ?? [] });
12104
12109
  const bytes = Buffer.byteLength(fullToolOutput, "utf8");
12105
- void kernelMutation("agent.reportOrientMetric", { bytes, truncated, tier, taskProvided }).catch(() => {
12110
+ const sessionId = getAgentSessionId();
12111
+ const conversationId = getConversationId();
12112
+ void kernelMutation("agent.reportOrientMetric", {
12113
+ bytes,
12114
+ truncated,
12115
+ tier,
12116
+ taskProvided,
12117
+ ...sessionId ? { sessionId } : {},
12118
+ ...conversationId ? { conversationId } : {}
12119
+ }).catch(() => {
12106
12120
  });
12107
12121
  } catch {
12108
12122
  }
@@ -12205,6 +12219,10 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
12205
12219
  if (task) orientArgs.task = task;
12206
12220
  if (scope) orientArgs.scope = scope;
12207
12221
  if (callTier) orientArgs.tier = callTier;
12222
+ orientArgs.renderMode = "json";
12223
+ if (agentSessionId) orientArgs.sessionId = agentSessionId;
12224
+ const orientConversationId = getConversationId();
12225
+ if (orientConversationId) orientArgs.conversationId = orientConversationId;
12208
12226
  orientView = await kernelQuery("chain.getOrientView", orientArgs);
12209
12227
  } catch {
12210
12228
  }
@@ -14773,4 +14791,4 @@ export {
14773
14791
  createProductBrainServer,
14774
14792
  initFeatureFlags
14775
14793
  };
14776
- //# sourceMappingURL=chunk-ZKW7JZUF.js.map
14794
+ //# sourceMappingURL=chunk-P65NSWZE.js.map