@productbrain/mcp 0.0.1-beta.15087 → 0.0.1-beta.15106

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.
@@ -56,7 +56,7 @@ import {
56
56
  startAgentSession,
57
57
  startTimingLine,
58
58
  withAcceptPrompt
59
- } from "./chunk-QVMIF4N7.js";
59
+ } from "./chunk-XUQDKSGJ.js";
60
60
 
61
61
  // src/server.ts
62
62
  import { McpServer as McpServer2 } from "@modelcontextprotocol/server";
@@ -4350,6 +4350,7 @@ var roleSchema = z18.object({
4350
4350
  onMyAuthority: z18.boolean().optional().describe(
4351
4351
  "'seat', Team Lead only: as the team's Team Lead, seat a second Team Lead who holds the seat on your authority until you unseat them."
4352
4352
  ),
4353
+ replace: z18.string().max(200).optional().describe("'seat', Team Lead only: the holder you replace as the lead above. They are unseated in the same write."),
4353
4354
  childId: z18.string().max(200).optional().describe("'release_move' / 'accept_move' / 'refuse_move': the role or team that moves, by chain id or entry id."),
4354
4355
  why: z18.string().max(1e3).optional().describe("'refuse_move': why the move is refused; it becomes a tension for the old team's Team Lead."),
4355
4356
  fromRoleId: z18.string().max(200).optional().describe("'move_work': the role whose open work moves, by chain id or entry id."),
@@ -4363,7 +4364,8 @@ var seatVariant = z18.object({
4363
4364
  person: z18.string().max(200).optional(),
4364
4365
  newPersonName: z18.string().max(120).optional(),
4365
4366
  teamId: z18.string().max(200).optional(),
4366
- onMyAuthority: z18.boolean().optional()
4367
+ onMyAuthority: z18.boolean().optional(),
4368
+ replace: z18.string().max(200).optional()
4367
4369
  });
4368
4370
  var unseatVariant = z18.object({
4369
4371
  action: z18.literal("unseat"),
@@ -4391,8 +4393,8 @@ var roleActionUnion = z18.discriminatedUnion("action", [
4391
4393
  ]);
4392
4394
  var ROLE_ACTION_SPECS = {
4393
4395
  seat: {
4394
- params: ["roleId", "person", "newPersonName", "teamId", "onMyAuthority"],
4395
- description: "roleId is required, plus exactly one of person or newPersonName; teamId and onMyAuthority only for Team Lead."
4396
+ params: ["roleId", "person", "newPersonName", "teamId", "onMyAuthority", "replace"],
4397
+ description: "roleId is required, plus exactly one of person or newPersonName; teamId and onMyAuthority only for Team Lead. replace is optional."
4396
4398
  },
4397
4399
  unseat: { params: ["roleId", "person", "teamId"], description: "roleId and person are required; teamId only for Team Lead." },
4398
4400
  release_move: { params: ["childId", "teamId"], description: "childId and teamId (the team it moves to) are required." },
@@ -4457,7 +4459,8 @@ async function runSeatAction(action, fn, params) {
4457
4459
  newPersonName: params.newPersonName,
4458
4460
  teamRef: params.teamId,
4459
4461
  sessionId,
4460
- ...params.onMyAuthority ? { onMyAuthority: true } : {}
4462
+ ...params.onMyAuthority ? { onMyAuthority: true } : {},
4463
+ ...params.replace !== void 0 ? { replacePersonRef: params.replace } : {}
4461
4464
  });
4462
4465
  const result2 = raw.refusal ? { ...raw, refusal: { ...raw.refusal, requiredAction: authorityRecovery(raw.refusal) } } : raw;
4463
4466
  const message = formatSeatSentence(action, result2, sanitizeSingleLineField);
@@ -4476,8 +4479,8 @@ async function runSeatAction(action, fn, params) {
4476
4479
  return roleErrorResult(err, action, params);
4477
4480
  }
4478
4481
  }
4479
- function handleRoleSeat(roleId, person, newPersonName, teamId, onMyAuthority) {
4480
- return runSeatAction("seat", "organisation.seatInRole", { roleId, person, newPersonName, teamId, onMyAuthority });
4482
+ function handleRoleSeat(roleId, person, newPersonName, teamId, onMyAuthority, replace) {
4483
+ return runSeatAction("seat", "organisation.seatInRole", { roleId, person, newPersonName, teamId, onMyAuthority, replace });
4481
4484
  }
4482
4485
  function handleRoleUnseat(roleId, person, teamId) {
4483
4486
  return runSeatAction("unseat", "organisation.unseatFromRole", { roleId, person, teamId });
@@ -4541,7 +4544,7 @@ function roleErrorResult(err, action, params = {}) {
4541
4544
  }
4542
4545
  function registerRoleTools(server) {
4543
4546
  const roleHandlers = {
4544
- seat: (data) => handleRoleSeat(data.roleId, data.person, data.newPersonName, data.teamId, data.onMyAuthority),
4547
+ seat: (data) => handleRoleSeat(data.roleId, data.person, data.newPersonName, data.teamId, data.onMyAuthority, data.replace),
4545
4548
  unseat: (data) => handleRoleUnseat(data.roleId, data.person, data.teamId),
4546
4549
  release_move: (data) => handleMove("release_move", data),
4547
4550
  accept_move: (data) => handleMove("accept_move", data),
@@ -4552,7 +4555,7 @@ function registerRoleTools(server) {
4552
4555
  "role",
4553
4556
  {
4554
4557
  title: "Role",
4555
- description: "Workspace roles \u2014 who holds a role, where it sits and what it owns. Six actions:\n\n- **seat**: put a person in this role, by person id or email, or by `newPersonName` for someone with no login yet (a placeholder person, created once per exact name). The role's home team is used; name `teamId` only for Team Lead. A held role refuses a second holder and names the holder; the person keeps their other roles in the team. Needs the team's Team Lead. With `onMyAuthority`, the team's Team Lead seats a second Team Lead on their own authority; unseating them revokes it.\n- **unseat**: take this role from a person; their other roles in the team stay. The last active Team Lead of a team is refused. Invite a person, or take them out of a team, with the `people` tool.\n- **release_move** / **accept_move** / **refuse_move**: move a role or team (`childId`) to a team whose Team Lead is another seat. Acting as Team Lead of its current team, release it toward `teamId`; acting as Team Lead of that team, accept it, or refuse it with `why` (it stays, and a tension goes to its current team's Team Lead).\n- **move_work**: move every open item `fromRoleId` owns (drafts, current entries, open questions) to `toRoleId`, each checked as a one-entry ownership change; an item the receiver may not own goes to the nearest Team Lead of the old role's home team, and past items stay as history. Each call moves a capped number and says how many remain; call again to finish. `dryRun` lists the open items (name, kind, status, summary), 200 a page with how many of how many are listed, decides no destination and changes nothing; pass `page` for the next.\n\nRead what a role owns with `context action=accountable`.",
4558
+ description: "Workspace roles \u2014 who holds a role, where it sits and what it owns. Six actions:\n\n- **seat**: put a person in this role, by person id or email, or by `newPersonName` for someone with no login yet (a placeholder person, created once per exact name). The role's home team is used; name `teamId` only for Team Lead. A held role refuses a second holder and names the holder; the person keeps their other roles in the team. Needs the team's Team Lead. With `replace`, the lead above replaces a team's Team Lead in one write. The lead directly above a team also decides who leads it. With `onMyAuthority`, the team's Team Lead seats a second Team Lead on their own authority; unseating them revokes it.\n- **unseat**: take this role from a person; their other roles in the team stay. The last active Team Lead of a team is refused. Invite a person, or take them out of a team, with the `people` tool.\n- **release_move** / **accept_move** / **refuse_move**: move a role or team (`childId`) to a team whose Team Lead is another seat. Acting as Team Lead of its current team, release it toward `teamId`; acting as Team Lead of that team, accept it, or refuse it with `why` (it stays, and a tension goes to its current team's Team Lead).\n- **move_work**: move every open item `fromRoleId` owns (drafts, current entries, open questions) to `toRoleId`, each checked as a one-entry ownership change; an item the receiver may not own goes to the nearest Team Lead of the old role's home team, and past items stay as history. Each call moves a capped number and says how many remain; call again to finish. `dryRun` lists the open items (name, kind, status, summary), 200 a page with how many of how many are listed, decides no destination and changes nothing; pass `page` for the next.\n\nRead what a role owns with `context action=accountable`.",
4556
4559
  inputSchema: roleSchema,
4557
4560
  // The hints describe the whole tool, so they say the most it can do: unseat removes a role and can
4558
4561
  // delete a membership row (destructive), and a repeated seat still writes history and audit rows
@@ -12443,4 +12446,4 @@ export {
12443
12446
  SERVER_VERSION,
12444
12447
  createProductBrainServer
12445
12448
  };
12446
- //# sourceMappingURL=chunk-VXPEYEI4.js.map
12449
+ //# sourceMappingURL=chunk-D5NXUAQB.js.map