@productbrain/mcp 0.0.1-beta.14895 → 0.0.1-beta.14908

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.
@@ -45,6 +45,7 @@ import {
45
45
  requireWriteAccess,
46
46
  retryIsFutile,
47
47
  returnedRefusal,
48
+ runCollectingReplyLines,
48
49
  runWithCommandId,
49
50
  runWithSeatedSession,
50
51
  runWithToolContext,
@@ -53,7 +54,7 @@ import {
53
54
  startAgentSession,
54
55
  startTimingLine,
55
56
  withAcceptPrompt
56
- } from "./chunk-B4FRHJNW.js";
57
+ } from "./chunk-IFJHH4SQ.js";
57
58
 
58
59
  // src/server.ts
59
60
  import { McpServer as McpServer2 } from "@modelcontextprotocol/server";
@@ -12338,15 +12339,19 @@ function acceptSessionIdOnEveryTool(server) {
12338
12339
  if (typeof sessionId === "string" && sessionId.length > 0 && !(name === "session" && args.action === "start")) {
12339
12340
  const seated = await validateOrRefuse(sessionId);
12340
12341
  if ("refused" in seated) return seated.refused;
12341
- const result2 = await runWithSeatedSession(seated.lc, () => cb(args, extra));
12342
+ const result2 = withReplyLines(await runCollectingReplyLines(() => runWithSeatedSession(seated.lc, () => cb(args, extra))));
12342
12343
  if (!seated.renewedFrom) return result2;
12343
12344
  return { ...result2, content: [{ type: "text", text: sessionRenewedNotice(seated.renewedFrom, seated.lc.agentSessionId) }, ...result2.content] };
12344
12345
  }
12345
- return cb(args, extra);
12346
+ if (name === "session" && args.action === "start") return cb(args, extra);
12347
+ return withReplyLines(await runCollectingReplyLines(() => cb(args, extra)));
12346
12348
  })
12347
12349
  );
12348
12350
  return server;
12349
12351
  }
12352
+ function withReplyLines({ result: result2, lines }) {
12353
+ return lines.length === 0 || !result2?.content ? result2 : { ...result2, content: [{ type: "text", text: lines.join("\n") }, ...result2.content] };
12354
+ }
12350
12355
  async function validateOrRefuse(sessionId) {
12351
12356
  try {
12352
12357
  return await validateCallerSession(sessionId);
@@ -12402,4 +12407,4 @@ export {
12402
12407
  SERVER_VERSION,
12403
12408
  createProductBrainServer
12404
12409
  };
12405
- //# sourceMappingURL=chunk-OAK72CUA.js.map
12410
+ //# sourceMappingURL=chunk-Z72YK5TB.js.map