@productbrain/mcp 0.0.1-beta.12016 → 0.0.1-beta.12023

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.
@@ -574,6 +574,26 @@ function entryDataLines(data) {
574
574
  return [...purpose ? [`**Purpose:** ${purpose}`] : [], "", ...rest.map(([key, val]) => `**${key}:** ${typeof val === "string" ? val : JSON.stringify(val)}`)];
575
575
  }
576
576
 
577
+ // src/lib/statusCategories.ts
578
+ var STATUS_CATEGORIES = ["draft", "current", "past", "discarded"];
579
+ var STATUS_CATEGORY_SET = new Set(STATUS_CATEGORIES);
580
+ var TRUST_ACCEPTED_WORDS = ["accepted", "active", "current"];
581
+ function isTrustAccepted(status2) {
582
+ return TRUST_ACCEPTED_WORDS.includes(status2);
583
+ }
584
+ var TRUST_ARCHIVED_WORDS = ["archived", "deprecated", "past", "discarded"];
585
+ var TRUST_STATUS_LABELS = {
586
+ draft: "Draft",
587
+ current: "Current",
588
+ // the live word every accept now stores
589
+ accepted: "Accepted",
590
+ archived: "Archived",
591
+ active: "Accepted",
592
+ deprecated: "Archived"
593
+ };
594
+ var ENTRY_STATUS_READ_WORDS = ["draft", ...TRUST_ACCEPTED_WORDS, ...TRUST_ARCHIVED_WORDS];
595
+ var ENTRY_STATUS_WRITE_WORDS = ["draft", "archived"];
596
+
577
597
  // src/gap-store.ts
578
598
  var SESSIONLESS_KEY = "__sessionless__";
579
599
  var sessionGaps = /* @__PURE__ */ new Map();
@@ -701,17 +721,6 @@ import { z as z7 } from "zod/v3";
701
721
  // src/tools/smart-capture.ts
702
722
  import { z as z5 } from "zod/v3";
703
723
 
704
- // src/lib/statusCategories.ts
705
- var STATUS_CATEGORIES = ["draft", "current", "past", "discarded"];
706
- var STATUS_CATEGORY_SET = new Set(STATUS_CATEGORIES);
707
- var TRUST_ACCEPTED_WORDS = ["accepted", "active", "current"];
708
- function isTrustAccepted(status2) {
709
- return TRUST_ACCEPTED_WORDS.includes(status2);
710
- }
711
- var TRUST_ARCHIVED_WORDS = ["archived", "deprecated", "past", "discarded"];
712
- var ENTRY_STATUS_READ_WORDS = ["draft", ...TRUST_ACCEPTED_WORDS, ...TRUST_ARCHIVED_WORDS];
713
- var ENTRY_STATUS_WRITE_WORDS = ["draft", "archived"];
714
-
715
724
  // src/lib/captureTimeoutOutcome.ts
716
725
  function isGatewayTimeout(error) {
717
726
  return error?.name === "GatewayTimeoutError";
@@ -2707,7 +2716,15 @@ function registerEntriesTools(server) {
2707
2716
  "entries",
2708
2717
  {
2709
2718
  title: "Entries",
2710
- description: 'Write entries on the Chain: the entry lifecycle after capture. Reads live on `context`.\n\n- **update**: Change fields on an existing entry (publishes whenever the entry is not draft \u2014 includes archived, not just accepted/active; autoPublish is accepted but ignored).\n- **accept**: Accept a draft entry onto the Chain. Runs the contradiction preflight first.\n- **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.\n- **verify**: Mark verified (lightweight, no scan \u2014 see `quality action=verify-chain`).\n- **still-true**: confirm accuracy (the holder of the owning role; if that role is empty, the nearest seated Team Lead up the team tree).\n\nRead entries with the read-only `context` tool: `context action=get entryId="..."`, `context action=search query="..."`, `context action=preflight`.',
2719
+ description: `Write entries on the Chain: the entry lifecycle after capture. Reads live on \`context\`.
2720
+
2721
+ - **update**: Change fields on an existing entry (publishes whenever the entry is not draft \u2014 includes archived, not just ${TRUST_STATUS_LABELS.current.toLowerCase()} entries; autoPublish is accepted but ignored).
2722
+ - **accept**: Accept a draft entry onto the Chain. Runs the contradiction preflight first.
2723
+ - **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.
2724
+ - **verify**: Mark verified (lightweight, no scan \u2014 see \`quality action=verify-chain\`).
2725
+ - **still-true**: confirm accuracy (the holder of the owning role; if that role is empty, the nearest seated Team Lead up the team tree).
2726
+
2727
+ Read entries with the read-only \`context\` tool: \`context action=get entryId="..."\`, \`context action=search query="..."\`, \`context action=preflight\`.`,
2711
2728
  inputSchema: entriesSchema,
2712
2729
  // DEC-1894 / DEC-74: every look-up lives on the read-only `context` tool, so this
2713
2730
  // annotation tells hosts the truth about the writes left here.
@@ -2942,7 +2959,7 @@ async function handleList(collection, status2, tag, label) {
2942
2959
  });
2943
2960
  }
2944
2961
  if (entries.length === 0) {
2945
- const emptyMessage = `No entries match the given filters.${!status2 ? " Default list scope is accepted entries (active/accepted); use status='draft' to discover drafts." : ` Status filter: ${status2}.`}`;
2962
+ const emptyMessage = `No entries match the given filters.${!status2 ? ` Default list scope is ${TRUST_STATUS_LABELS.current.toLowerCase()} entries; use status='draft' to discover drafts.` : ` Status filter: ${status2}.`}`;
2946
2963
  return {
2947
2964
  content: [{ type: "text", text: emptyMessage }],
2948
2965
  structuredContent: success(
@@ -3376,7 +3393,7 @@ async function handleDelete(from, to, type) {
3376
3393
  import { z as z20 } from "zod/v3";
3377
3394
 
3378
3395
  // src/lib/readinessNotices.ts
3379
- var READINESS_PROVISIONAL_LINE = "Readiness is provisional: its sample omitted accepted entries. Counts are lower bounds, apparent gaps may already be covered.";
3396
+ var READINESS_PROVISIONAL_LINE = `The sample is incomplete: it left out ${TRUST_STATUS_LABELS.current.toLowerCase()} entries. Counts are lower bounds, apparent gaps may already be covered.`;
3380
3397
 
3381
3398
  // src/tools/documents.ts
3382
3399
  import { z as z14 } from "zod/v3";
@@ -4207,7 +4224,7 @@ function registerRoleTools(server) {
4207
4224
  var LOOKUP_ACTIONS = ["get", "batch", "history", "list", "search", "find", "people", "outcome", "readings", "accountable", "preflight"];
4208
4225
  var statusFilterSchema = z19.union([z19.string().max(200), z19.array(z19.enum(ENTRY_STATUS_READ_WORDS)).max(5)]);
4209
4226
  var preflightLinks = z19.array(z19.object({ type: z19.string().max(200), entryId: z19.string().max(200) })).max(50).optional();
4210
- var LOOKUP_ACTION_DESCRIBE = "'get': one entry in full by ID. 'batch': up to 20 entries by ID. 'history': audit trail for an entry. 'list': browse entries with filters (accepted by default). 'search': full-text search across entries. 'find': an entry's direct relations (direction: incoming|outgoing|both, default both). 'people': the workspace's members with name, email and status. 'outcome': a key result's derived view, its objective and sibling key results. 'readings': its readings, newest first. 'accountable': what a role owns and who holds it. 'preflight': a collection's requirements. ";
4227
+ var LOOKUP_ACTION_DESCRIBE = `'get': one entry in full by ID. 'batch': up to 20 entries by ID. 'history': audit trail for an entry. 'list': browse entries with filters (${TRUST_STATUS_LABELS.current.toLowerCase()} entries by default). 'search': full-text search across entries. 'find': an entry's direct relations (direction: incoming|outgoing|both, default both). 'people': the workspace's members with name, email and status. 'outcome': a key result's derived view, its objective and sibling key results. 'readings': its readings, newest first. 'accountable': what a role owns and who holds it. 'preflight': a collection's requirements. `;
4211
4228
  var LOOKUP_TOOL_LINES = "- **get**: Fetch a single entry by ID \u2014 full record with data, labels, relations, history.\n- **batch**: Fetch multiple entries (max 20) in one call. Same shape as get per entry.\n- **history**: Audit trail for an entry.\n- **list**: Browse entries with optional filters (collection, status, tag, label). Use collections action=list first to discover slugs.\n- **search**: Full-text search across entries. Scope by collection or filter by status.\n- **find**: An entry's direct relations, incoming and outgoing. NOT full-text search (use search).\n- **people**: The workspace's members: name, email, status, role. Max 200.\n- **outcome**: A key result's derived view (current, progress, pace, staleness, recorded completion) with its objective and up to 5 sibling key results.\n- **readings**: A key result's readings, newest first; superseded rows are marked with their replacement. Record one with `outcome action=record`.\n- **accountable**: What a role owns, reports on, and who holds it.\n- **preflight**: What an entry in a collection needs before you compose it. Saves nothing.\n";
4212
4229
  var lookupParams = {
4213
4230
  entryIds: z19.array(z19.string().max(200)).min(1).max(20).optional().describe("For 'batch': entry IDs, e.g. ['TYPE-strategy', 'STR-jljeg7']"),
@@ -4215,7 +4232,7 @@ var lookupParams = {
4215
4232
  query: z19.string().min(2).max(500).optional().describe("For 'search': search text (min 2 characters)."),
4216
4233
  // 'active'/'accepted'/'current' are the same trust level (DEC-1575/DEC-1788) — all enumerated, never one substituted.
4217
4234
  status: statusFilterSchema.optional().describe(
4218
- `For 'list': defaults to accepted entries (active/accepted/current); use status='draft' to discover drafts. One lifecycle or category value (${ENTRY_STATUS_READ_WORDS.join("|")}). For 'search': one value OR an array of up to 5 (e.g. ['active','accepted']).`
4235
+ `For 'list': defaults to ${TRUST_STATUS_LABELS.current.toLowerCase()} entries (active/accepted/current); use status='draft' to discover drafts. One lifecycle or category value (${ENTRY_STATUS_READ_WORDS.join("|")}). For 'search': one value OR an array of up to 5 (e.g. ['active','accepted']).`
4219
4236
  ),
4220
4237
  tag: z19.string().max(200).optional().describe("For 'list': filter by internal tag."),
4221
4238
  label: z19.string().max(200).optional().describe("For 'list': filter by label slug \u2014 matches entries across all collections."),
@@ -4269,7 +4286,10 @@ var LOOKUP_ACTION_SPECS = {
4269
4286
  get: { params: ["entryId"], description: "entryId is required." },
4270
4287
  batch: { params: ["entryIds"], description: "entryIds (1-20) is required." },
4271
4288
  history: { params: ["entryId"], description: "entryId is required." },
4272
- list: { params: ["collection", "status", "tag", "label"], description: "Browse accepted entries by default; status='draft' lists drafts; status is one word. All params optional." },
4289
+ list: {
4290
+ params: ["collection", "status", "tag", "label"],
4291
+ description: `Browse ${TRUST_STATUS_LABELS.current.toLowerCase()} entries by default; status='draft' lists drafts; status is one word. All params optional.`
4292
+ },
4273
4293
  search: { params: ["query", "collection", "status"], description: "Full-text search; query is required (min 2 chars)." },
4274
4294
  find: { params: ["entryId", "direction"], description: "entryId is required." },
4275
4295
  people: { params: [], description: "No params." },
@@ -9665,10 +9685,10 @@ async function runWrapupReview() {
9665
9685
  lines.push(`### Beyond Review Cap (${overflowDrafts.length + overflowCommitted.length})`, "");
9666
9686
  lines.push("_Past the per-session enrichment cap \u2014 listed by id and name only._", "");
9667
9687
  for (const e of overflowCommitted) {
9668
- lines.push(`- \`${e.entryId}\` \u2014 ${e.name} (accepted)`);
9688
+ lines.push(`- \`${e.entryId}\` \u2014 ${e.name} (${TRUST_STATUS_LABELS.current.toLowerCase()})`);
9669
9689
  }
9670
9690
  for (const e of overflowDrafts) {
9671
- lines.push(`- \`${e.entryId}\` \u2014 ${e.name} (draft)`);
9691
+ lines.push(`- \`${e.entryId}\` \u2014 ${e.name} (${TRUST_STATUS_LABELS.draft.toLowerCase()})`);
9672
9692
  }
9673
9693
  lines.push("");
9674
9694
  }
@@ -10490,10 +10510,10 @@ async function handleWorkspaceStatus() {
10490
10510
  ...result2.sampleTruncated ? [`_${READINESS_PROVISIONAL_LINE}_`] : [],
10491
10511
  "",
10492
10512
  "## Sampled counts",
10493
- `- **Entries:** ${stats.totalEntries} (${stats.activeCount} accepted/active, ${stats.draftCount} draft)`,
10513
+ `- **Entries:** ${stats.totalEntries} (${stats.activeCount} ${TRUST_STATUS_LABELS.current.toLowerCase()}, ${stats.draftCount} ${TRUST_STATUS_LABELS.draft.toLowerCase()})`,
10494
10514
  `- **Relations:** ${stats.totalRelations}`,
10495
10515
  `- **Collections:** ${stats.collectionCount}`,
10496
- `- **Orphaned:** ${stats.orphanedCount} accepted entries with no relations`,
10516
+ `- **Orphaned:** ${stats.orphanedCount} ${TRUST_STATUS_LABELS.current.toLowerCase()} entries with no relations`,
10497
10517
  ""
10498
10518
  ];
10499
10519
  if (gaps.length > 0 && !result2.sampleTruncated) {
@@ -10536,7 +10556,7 @@ async function handleWorkspaceStatus() {
10536
10556
  return {
10537
10557
  content: [{ type: "text", text: lines.join("\n") }],
10538
10558
  structuredContent: success(
10539
- `Brain: ${stats.activeCount} accepted/active entries in the sample, ${gaps.length} ${result2.sampleTruncated ? "potential gap(s); absence unverified" : "gap(s)"}.`,
10559
+ `Brain: ${stats.activeCount} ${TRUST_STATUS_LABELS.current.toLowerCase()} ${stats.activeCount === 1 ? "entry" : "entries"} in the sample, ${gaps.length} ${result2.sampleTruncated ? "potential gap(s); absence unverified" : "gap(s)"}.`,
10540
10560
  statusData
10541
10561
  )
10542
10562
  };
@@ -11807,4 +11827,4 @@ export {
11807
11827
  SERVER_VERSION,
11808
11828
  createProductBrainServer
11809
11829
  };
11810
- //# sourceMappingURL=chunk-C6XDBPFW.js.map
11830
+ //# sourceMappingURL=chunk-GYOQXZVO.js.map