@productbrain/mcp 0.0.1-beta.7557 → 0.0.1-beta.7566

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.
@@ -385,23 +385,17 @@ function formatOwnerLine(owner, options = {}) {
385
385
  switch (owner.kind) {
386
386
  case "one":
387
387
  return `${label} ${owner.role.name} in ${owner.team.name}`;
388
- case "default":
389
- return `${label} Team Lead, ${owner.team.name} (default \u2014 nobody assigned)`;
390
- case "unavailable":
391
- return `${label} none \u2014 no Team Lead available`;
388
+ case "none":
389
+ return `${label} none`;
392
390
  case "many":
393
391
  return `${label} conflicting \u2014 ${owner.count}${owner.truncated ? "+" : ""} owners recorded`;
394
392
  case "dangling": {
395
393
  const named = owner.team && owner.role ? `${owner.role.name} in ${owner.team.name} is archived` : owner.role ? `role ${owner.role.name} is archived` : owner.team ? `team ${owner.team.name} is archived` : "the owning team or role is archived";
396
394
  return ids ? `${label} couldn't be resolved \u2014 ${named} (team ${owner.teamId}, role ${owner.roleId})` : `${label} couldn't be resolved \u2014 ${named}`;
397
395
  }
398
- case "overflow": {
399
- const reason = "couldn't be resolved \u2014 this team is too large to check";
400
- return ids ? `${label} ${reason} (team ${owner.teamId})` : `${label} ${reason}`;
401
- }
402
396
  default: {
403
397
  const _exhaustive = owner;
404
- return _exhaustive;
398
+ throw new Error(`Unknown owner state "${String(owner.kind)}" \u2014 this client is older than the server; upgrade @productbrain/cli / @productbrain/mcp`);
405
399
  }
406
400
  }
407
401
  }
@@ -463,18 +457,17 @@ var ownerTeam = z2.object({ id: z2.string(), name: z2.string() });
463
457
  var ownerRole = z2.object({ id: z2.string(), name: z2.string() });
464
458
  var ownerOutputShape = z2.discriminatedUnion("kind", [
465
459
  z2.object({ kind: z2.literal("one"), team: ownerTeam, role: ownerRole }),
466
- z2.object({ kind: z2.literal("default"), team: ownerTeam }),
467
- z2.object({ kind: z2.literal("unavailable") }),
460
+ // DEC-1793 (RULE-632): a working record with no ownership row — no synthetic Team Lead or
461
+ // overflow guess invented for it (the `default`/`overflow`/`unavailable` kinds this shape used
462
+ // to carry are deleted).
463
+ z2.object({ kind: z2.literal("none") }),
468
464
  // Review round 2: count is capped at OWNERSHIP_DISPLAY_CAP; truncated is true when a row past
469
465
  // that cap exists, so 3+ duplicates are never silently reported as exactly 2.
470
466
  z2.object({ kind: z2.literal("many"), count: z2.number(), truncated: z2.boolean() }),
471
467
  // WP-753 O5b fix round 1 (item 1), nested round 3 (item 6): team/role optional — present only
472
468
  // when entryOwnershipRead.ts could name the archived/dead target without leaking a foreign
473
- // workspace's name. Nested (not flat teamName/roleName) to match the `one`/`default` kinds.
474
- z2.object({ kind: z2.literal("dangling"), teamId: z2.string(), roleId: z2.string(), team: ownerTeam.pick({ name: true }).optional(), role: ownerRole.pick({ name: true }).optional() }),
475
- // PRRT_kwDORS4ils6igqYN (round 2): the routed team's membership scan overflowed the cap — an
476
- // active Team Lead may still exist; distinct from `unavailable` (asserts none does).
477
- z2.object({ kind: z2.literal("overflow"), teamId: z2.string() })
469
+ // workspace's name. Nested (not flat teamName/roleName) to match the `one` kind.
470
+ z2.object({ kind: z2.literal("dangling"), teamId: z2.string(), roleId: z2.string(), team: ownerTeam.pick({ name: true }).optional(), role: ownerRole.pick({ name: true }).optional() })
478
471
  ]);
479
472
  function parseOwnerOutput(raw) {
480
473
  if (!raw) return void 0;
@@ -482,7 +475,7 @@ function parseOwnerOutput(raw) {
482
475
  return result2.success ? result2.data : void 0;
483
476
  }
484
477
  function formatOwnerLine2(owner) {
485
- const sanitized = owner.kind === "one" ? { ...owner, team: { name: sanitizeSingleLineField(owner.team.name) }, role: { name: sanitizeSingleLineField(owner.role.name) } } : owner.kind === "default" ? { ...owner, team: { name: sanitizeSingleLineField(owner.team.name) } } : owner.kind === "dangling" ? { ...owner, ...owner.team ? { team: { name: sanitizeSingleLineField(owner.team.name) } } : {}, ...owner.role ? { role: { name: sanitizeSingleLineField(owner.role.name) } } : {} } : owner;
478
+ const sanitized = owner.kind === "one" ? { ...owner, team: { name: sanitizeSingleLineField(owner.team.name) }, role: { name: sanitizeSingleLineField(owner.role.name) } } : owner.kind === "dangling" ? { ...owner, ...owner.team ? { team: { name: sanitizeSingleLineField(owner.team.name) } } : {}, ...owner.role ? { role: { name: sanitizeSingleLineField(owner.role.name) } } : {} } : owner;
486
479
  return formatOwnerLine(sanitized, { label: "**Owner:**" });
487
480
  }
488
481
  function extractPreview(data, maxLen) {
@@ -14922,4 +14915,4 @@ export {
14922
14915
  createProductBrainServer,
14923
14916
  initFeatureFlags
14924
14917
  };
14925
- //# sourceMappingURL=chunk-WRYAYGPR.js.map
14918
+ //# sourceMappingURL=chunk-G3ZUQXT4.js.map