@productbrain/mcp 0.0.1-beta.15664 → 0.0.1-beta.15693

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.
@@ -335,9 +335,14 @@ function formatGrantsGivenLine(grants) {
335
335
  function wayInSentence(seat, surface) {
336
336
  const role = sanitizeRuleListField(seat.roleRef);
337
337
  const team = sanitizeRuleListField(seat.teamRef);
338
- const [close, start] = surface === "cli" ? ["pb session close", `pb session start --role ${role} --team ${team}`] : ["session action=close", `session action=start role=${role} team=${team}`];
338
+ const [close, start] = [sessionCloseCommand(surface), sessionStartCommand(seat, surface)];
339
339
  return `You hold ${briefingLine(seat.roleName)} (${role}) in ${briefingLine(seat.teamName)} (${team}); close this session (${close}) and start one as it: ${start}, then retry.`;
340
340
  }
341
+ var sessionCloseCommand = (surface) => surface === "cli" ? "pb session close" : 'session action=close sessionId="<id>"';
342
+ function sessionStartCommand(seat, surface) {
343
+ const [role, team] = [sanitizeRuleListField(seat.roleRef), sanitizeRuleListField(seat.teamRef)];
344
+ return surface === "cli" ? `pb session start --role ${role} --team ${team}` : `session action=start role=${role} team=${team}`;
345
+ }
341
346
  var GOVERNANCE_HERE_LINES = [
342
347
  "How governance works here:",
343
348
  [
@@ -1186,7 +1191,17 @@ function authorityRecovery(refusal) {
1186
1191
  if (seat && typeof seat.roleRef === "string" && typeof seat.roleName === "string" && typeof seat.teamRef === "string" && typeof seat.teamName === "string") {
1187
1192
  return wayInSentence(seat, "mcp");
1188
1193
  }
1189
- return typeof refusal?.requiredAction === "string" ? refusal.requiredAction : void 0;
1194
+ const said = typeof refusal?.requiredAction === "string" ? refusal.requiredAction : void 0;
1195
+ const next = refusalNextLine(refusal);
1196
+ return said && next ? `${said}
1197
+ ${next}` : said ?? next ?? void 0;
1198
+ }
1199
+ function refusalNextLine(refusal) {
1200
+ const seat = refusal?.startAs;
1201
+ const start = typeof seat?.roleRef === "string" && typeof seat.teamRef === "string" ? `${refusal?.closeFirst === true ? `\`${sessionCloseCommand("mcp")}\`, then ` : ""}\`${sessionStartCommand({ roleRef: seat.roleRef, teamRef: seat.teamRef }, "mcp")}\`` : null;
1202
+ const read = typeof refusal?.readNext === "string" ? `\`context action=get entryId="${refusal.readNext}"${start ? ' sessionId="<new id>"' : ""}\`` : null;
1203
+ const steps = [start, read].filter(Boolean);
1204
+ return steps.length > 0 ? `Next: ${steps.join(", then ")}.` : null;
1190
1205
  }
1191
1206
  function askNextLine(refusal) {
1192
1207
  const seat = refusal?.routeTarget;
@@ -2026,4 +2041,4 @@ export {
2026
2041
  appUrl,
2027
2042
  apiKeysUrl
2028
2043
  };
2029
- //# sourceMappingURL=chunk-ER2HTDIM.js.map
2044
+ //# sourceMappingURL=chunk-AFTQ7UO6.js.map