@productbrain/mcp 0.0.1-beta.5856 → 0.0.1-beta.5868

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.
@@ -10679,7 +10679,7 @@ var SHAPE_WORKFLOW_DESCRIPTOR = {
10679
10679
  facilitatorPreamble: `You are now in **Shaping Mode**. The shaping skill owns the facilitation loop end-to-end \u2014 read it for scoring rubrics, investigation patterns, and the capture flow.
10680
10680
 
10681
10681
  Use \`capture\` to create constellation entries (elements, risks, decisions, glossary terms) linked to the work package.
10682
- Use \`session action=commit-constellation\` to atomically accept the work package and all linked entries when the shape is complete.
10682
+ Use \`session action=commit-constellation\` to accept the work package and all linked entries when the shape is complete \u2014 sequentially, best-effort per entry; check failedIds and conflictIds.
10683
10683
  Use \`workflows action=checkpoint\` after each round to persist progress to the durable run.`,
10684
10684
  rounds: [
10685
10685
  {
@@ -10790,7 +10790,7 @@ Use \`workflows action=checkpoint\` after each round to persist progress to the
10790
10790
  label: "Capture & Accept",
10791
10791
  type: "close",
10792
10792
  instruction: "Capture the pitch to the Chain. Accept draft entries. Connect the constellation.",
10793
- facilitatorGuidance: "List all draft entries created during shaping (elements, risks, decisions, glossary terms). Ask the user to confirm: 'Ready to accept these onto the Chain?' Call `session action=commit-constellation` to atomically accept the work package and all linked entries. Then `relations action=suggest entryId='<betId>'` to discover connections. Create the top 3 suggested relations via `relations action=batch-create`. Thank the user. State: what was shaped, how many constellation entries captured, what the implementer inherits.",
10793
+ facilitatorGuidance: "List all draft entries created during shaping (elements, risks, decisions, glossary terms). Ask the user to confirm: 'Ready to accept these onto the Chain?' Call `session action=commit-constellation` to accept the work package and all linked entries \u2014 sequentially, best-effort per entry; check failedIds and conflictIds. Then `relations action=suggest entryId='<betId>'` to discover connections. Create the top 3 suggested relations via `relations action=batch-create`. Thank the user. State: what was shaped, how many constellation entries captured, what the implementer inherits.",
10794
10794
  outputSchema: {
10795
10795
  field: "capture",
10796
10796
  description: "Final capture summary \u2014 entries accepted, relations created",
@@ -16004,25 +16004,29 @@ import { fileURLToPath } from "url";
16004
16004
  import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
16005
16005
 
16006
16006
  // src/resources/agentCheatsheet.ts
16007
+ var DATA_HANDLING_SECTION = "### How PB Handles Your Data\n- **The reply is the source of truth**: every reply carries `ok`; on failure it carries `code` and guidance. Read the reply, never an expectation.\n- **Empty-workspace safe**: the orientation resource and this cheatsheet render on a workspace with no entries and no collections.\n- **Workspace-agnostic**: PB is one product used by many teams. Nothing in these instructions is specific to your workspace; your own principles, standards and rules arrive through `productbrain://orientation`.\n- **Served, not installed**: these instructions, `productbrain://orientation` and `productbrain://agent-cheatsheet` are served over MCP.";
16007
16008
  var AGENT_CHEATSHEET = `# Product Brain \u2014 Agent Cheatsheet
16008
16009
 
16009
- ## Core Tools (Serves 14 default compound tools; 2 more (chain, chain-review) behind PB_MODULES=gitchain \u2014 map retired, L29)
16010
- | Tool | Purpose | Key params |
16010
+ ## Core Tools (Serves 15 default compound tools; 2 more (chain, chain-review) behind PB_MODULES=gitchain)
16011
+ | Tool | Purpose | Actions |
16011
16012
  |---|---|---|
16012
16013
  | \`orient\` | Workspace context, governance, active work packages, session start | \`action\`: start, task, record-activation |
16013
- | \`capture\` | Create entry (draft), single or batch | \`collection\`, \`name\`, \`description\`, optional \`data\` / \`items[]\` |
16014
- | \`entries\` | List / get / batch / search / update / commit / history / move / verify | \`action\` + \`entryId\` / \`query\` / \`collection\` |
16015
- | \`relations\` | Create / batch-create / dismiss / delete / find / suggest links | \`action\` + \`from\`, \`to\`, \`type\` or \`entryId\` |
16016
- | \`context\` | Gather related knowledge, last-verified brief | \`action\` + \`entryId\` or \`task\` |
16017
- | \`collections\` | List / create / update collections, manage labels | \`action\` |
16018
- | \`quality\` | Score an entry, verify the Chain, audit a work package | \`action\`: check, re-evaluate, verify-chain, audit |
16014
+ | \`capture\` | Create entry | \`action\`: capture, batch |
16015
+ | \`entries\` | Read and write entries | \`action\`: list, get, batch, search, update, commit, history, move, verify, preflight |
16016
+ | \`relations\` | Link entries, dismiss suggestions and delete links, find and suggest | \`action\`: create, batch-create, dismiss, delete, find, suggest |
16017
+ | \`context\` | Gather related knowledge, last-verified brief | \`action\`: gather, build, neighborhood, changes, chain, cross-cut, incremental, brief, last-verified-brief |
16018
+ | \`collections\` | Browse, describe, audit and export collections; manage labels | \`action\`: list, update, describe, audit, export, label-* |
16019
+ | \`quality\` | Score an entry, verify the Chain, audit a work package, spine check | \`action\`: check, re-evaluate, verify-chain, audit, spine-check |
16019
16020
  | \`session\` | Start / close, wrapup, resume, constellation accept | \`action\`: start, close, status, wrapup-review, wrapup-commit, resume, commit-constellation |
16020
16021
  | \`workflows\` | Run workflows, checkpoint, load a skill | \`action\`: list, start, checkpoint, get-run, load-skill |
16021
16022
  | \`workspace\` | Check / whoami / status / self-test, usage, governance proposals | \`action\`: check, whoami, status, audit, self-test, usage, proposals-* |
16022
16023
  | \`feedback\` | Submit product feedback (any key, no session required); \`list\` reads back your own workspace's feedback (no gate); vendor triage: queue / note / group / status | \`action\`: submit, list, queue, note, group, status |
16023
16024
  | \`shape\` | Review / disposition write-shape (single-concern split) advisories | \`action\`: list, show, agree, dismiss |
16024
- | \`question\` | Routed questions \u2014 create/adopt, own, snooze, decline, answer, force-close | \`action\`: create, adopt, assign, snooze, decline, answer, force-close |
16025
+ | \`question\` | Routed questions \u2014 create/adopt, own, snooze, decline, answer, force-close, list | \`action\`: create, adopt, assign, snooze, decline, answer, force-close, list |
16025
16026
  | \`role\` | What a role is accountable for \u2014 owns, reports on, and (not yet computed) inherits via Team-Lead vacancy coverage | \`action\`: accountable |
16027
+ | \`outcome\` | Record an outcome measurement and read the ones already recorded | \`action\`: record, list, show |
16028
+
16029
+ This table lists actions only. See \`tools/list\` for each tool's input schema; a missing or invalid parameter is named in the call's own reply.
16026
16030
 
16027
16031
  ## Collection Prefixes
16028
16032
  GLO (glossary), BR (business-rules), PRI (principles), STD (standards),
@@ -16075,16 +16079,16 @@ function formatEntryMarkdown(entry) {
16075
16079
  function buildOrientationMarkdown(collections, standards, businessRules, principles) {
16076
16080
  const sections = ["# Product Brain \u2014 Orientation"];
16077
16081
  sections.push(
16078
- "## About Product Brain (PB)\nPB is a knowledge management system used by many product teams. This section describes how PB works \u2014 not your product.\n\n### How PB Organizes Its Tools\n- **Tools** = actions with side-effects or dynamic computation (capture, accept, search).\n- **Resources** = stable, read-only data (orientation, terminology, collection schemas).\n- **Prompts** = multi-step choreography (workflows, guided capture, deep dives).\n- Every tool, resource, and prompt works for ANY workspace \u2014 no bespoke logic.\n- Resource templates (URI params) serve workspace-specific data through generic patterns.\n- Compound tools with `action` enums keep the tool count minimal.\n\n### How PB Handles Your Data\n- **Draft-first**: all writes create drafts. SSOT requires explicit user confirmation.\n- **Empty-workspace safe**: every operation handles zero entries and fresh workspaces.\n- **Advisory, not blocking**: quality scores, contradiction checks, and coaching never prevent operations.\n- **Workspace-agnostic**: PB is a product for many teams \u2014 no workspace-specific logic.\n- **Self-documenting**: orient and server instructions teach agents how PB works."
16082
+ "## About Product Brain (PB)\nPB is a knowledge management system used by many product teams. This section describes how PB works \u2014 not your product.\n\n### How PB Organizes Its Tools\n- **Tools** = actions with side-effects or dynamic computation (capture, accept, search).\n- **Resources** = stable, read-only data (orientation, terminology, collection schemas).\n- **Prompts** = multi-step choreography (workflows, guided capture, deep dives).\n- Every tool, resource, and prompt works for ANY workspace \u2014 no bespoke logic.\n- Resource templates (URI params) serve workspace-specific data through generic patterns.\n- Compound tools with `action` enums keep the tool count minimal.\n\n" + DATA_HANDLING_SECTION
16079
16083
  );
16080
16084
  const wsRules = [];
16081
- for (const p of (principles ?? []).filter((e) => e.status === "active" || e.status === "verified")) {
16085
+ for (const p of principles ?? []) {
16082
16086
  wsRules.push({ id: p.entryId ?? "", name: p.name, severity: p.data?.severity ?? void 0, source: "principles" });
16083
16087
  }
16084
- for (const s of (standards ?? []).filter((e) => e.status === "active" || e.status === "verified")) {
16088
+ for (const s of standards ?? []) {
16085
16089
  wsRules.push({ id: s.entryId ?? "", name: s.name, severity: s.data?.severity ?? void 0, source: "standards" });
16086
16090
  }
16087
- for (const r of (businessRules ?? []).filter((e) => e.status === "active" || e.status === "verified")) {
16091
+ for (const r of businessRules ?? []) {
16088
16092
  wsRules.push({ id: r.entryId ?? "", name: r.name, severity: r.data?.severity ?? void 0, source: "business-rules" });
16089
16093
  }
16090
16094
  if (wsRules.length > 0) {
@@ -16136,7 +16140,7 @@ Check compliance: use the \`review-against-rules\` prompt (pass a domain).
16136
16140
  Draft a new rule: use the \`draft-rule-from-context\` prompt.`
16137
16141
  );
16138
16142
  sections.push(
16139
- "## Knowledge Graph\nEntries are connected via typed relations (`entryRelations` table). Relations are bidirectional and collection-agnostic \u2014 any entry can link to any other entry.\n\n**Recommended relation types** (extensible \u2014 any string accepted):\n- `governs` \u2014 a rule constrains behavior of a feature\n- `defines_term_for` \u2014 a glossary term is canonical vocabulary for a feature/area\n- `belongs_to` \u2014 a feature belongs to a product area or parent concept (WP-641 typed successors: `anchored_to`, `authority_domain`)\n- `informs` \u2014 a decision or insight informs a feature\n- `surfaces_tension_in` \u2014 a tension exists within a feature area\n- `related_to`, `depends_on`, `replaces`, `conflicts_with`, `references`, `confused_with`\n\nEach relation type is defined as a glossary entry (prefix `GT-REL-*`) to prevent terminology drift. **Workflow-owned, NOT generic:** `domain_routed_to` (a question routed to a domain) \u2014 use the `question` tool (`action=create`/`adopt`, `domain=<slug>`), never `relations action=create`; the generic door has no replace/re-judge logic, so a raw write can leave duplicate routing edges and a stale suggested owner.\n\n**Tools:**\n- `context action=gather` \u2014 get the full context around any entry (multi-hop graph traversal)\n- `relations action=suggest` \u2014 discover potential connections for an entry\n- `relations action=create` \u2014 create a typed link between two entries\n- `relations action=find` \u2014 list direct relations for an entry\n\n**Convention:** When creating or updating entries in governed collections, always use `relations action=suggest` to discover and create relevant relations."
16143
+ "## Knowledge Graph\nEntries are connected via typed relations (`entryRelations` table). Relations are bidirectional and collection-agnostic \u2014 any entry can link to any other entry.\n\n**Recommended relation types** (extensible \u2014 any string accepted):\n- `governs` \u2014 a rule constrains behavior of a feature\n- `defines_term_for` \u2014 a glossary term is canonical vocabulary for a feature/area\n- `belongs_to` \u2014 a feature belongs to a product area or parent concept (typed successors: `anchored_to`, `authority_domain`)\n- `informs` \u2014 a decision or insight informs a feature\n- `surfaces_tension_in` \u2014 a tension exists within a feature area\n- `related_to`, `depends_on`, `replaces`, `conflicts_with`, `references`, `confused_with`\n\nEach relation type is defined as a glossary entry (prefix `GT-REL-*`) to prevent terminology drift. **Workflow-owned, NOT generic:** `domain_routed_to` (a question routed to a domain) \u2014 use the `question` tool (`action=create`/`adopt`, `domain=<slug>`), never `relations action=create`; the generic door has no replace/re-judge logic, so a raw write can leave duplicate routing edges and a stale suggested owner.\n\n**Tools:**\n- `context action=gather` \u2014 get the full context around any entry (multi-hop graph traversal)\n- `relations action=suggest` \u2014 discover potential connections for an entry\n- `relations action=create` \u2014 create a typed link between two entries\n- `relations action=find` \u2014 list direct relations for an entry\n\n**Convention:** When creating or updating entries in governed collections, always use `relations action=suggest` to discover and create relevant relations."
16140
16144
  );
16141
16145
  sections.push(
16142
16146
  "## Creating Knowledge\n**Entries:** Use `capture` as the primary tool for creating new entries. It handles the full workflow in one call:\n1. Creates the entry with collection-aware defaults (auto-fills dates, infers domains, sets priority)\n2. Auto-links related entries from across the chain (up to 5 confident matches)\n3. Returns a quality scorecard (X/10) with actionable improvement suggestions\n\n**Smart profiles** exist for: `tensions`, `business-rules`, `glossary`, `decisions`, `features`, `audiences`, `strategy`, `standards`, `chains`.\nAll other collections use the `ENT-{random}` fallback profile.\n\n**Processes:** Use `chain action=create` with a template (e.g., `strategy-coherence`, `idm-proposal`). Fill links with `chain action=edit`.\n\n**Prompts** (invoke via MCP prompt protocol):\n- `name-check` \u2014 verify a name against glossary conventions\n- `draft-decision-record` \u2014 scaffold a decision entry\n- `review-against-rules` \u2014 check work against business rules for a domain\n- `draft-rule-from-context` \u2014 create a new business rule from context\n\nUse `quality action=check` to score existing entries retroactively.\nUse `entries action=update` for post-creation adjustments (status changes, field updates, deprecation)."
@@ -16700,16 +16704,7 @@ var INSTRUCTIONS = [
16700
16704
  "- Resource templates (URI params) provide workspace-specific data through generic patterns.",
16701
16705
  "- Tool count stays minimal: compound tools with `action` enums over many single-purpose tools.",
16702
16706
  "",
16703
- "### How PB Handles Your Data",
16704
- "- **Draft-first**: all writes create drafts. Nothing reaches SSOT without explicit user confirmation.",
16705
- "- **Empty-workspace safe**: every tool and resource handles zero entries, zero collections, and fresh workspaces.",
16706
- "- **Advisory, not blocking**: quality scores, contradiction checks, and coaching are informational. They never prevent an operation.",
16707
- "- **Workspace-agnostic**: PB is a product used by many teams. No workspace-specific logic in server code.",
16708
- "- **Self-documenting**: orient and server instructions teach agents how PB works. Cursor rules supplement but don't replace.",
16709
- "",
16710
- "### Tool Rename Notice (WP-484 S3, one release)",
16711
- "Serves 14 default compound tools (WP-559 adds `shape` \u2014 review/disposition for write-shape advisories; WP-638 S3 adds `question` \u2014 routed-question routing/ownership/lifecycle; WP-730 S2 adds `role` \u2014 role accountability); 2 more (chain, chain-review) behind PB_MODULES=gitchain.",
16712
- "Old standalone names are gone \u2014 no alias window (ASM-43: zero external consumers). Map: `start_pb`\u2192`orient action=start`, `record_activation`\u2192`orient action=record-activation`, `session-wrapup`\u2192`session action=wrapup-review|wrapup-commit`, `facilitate`\u2192`session action=resume|commit-constellation`, `update-entry`\u2192`entries action=update`, `commit-entry`\u2192`entries action=commit`, `get-history`\u2192`entries action=history`, `move-entry`\u2192`entries action=move`, `verify-entry`\u2192`entries action=verify`, `graph`\u2192`relations action=find|suggest`, `documents`\u2192`context action=last-verified-brief`, `labels`\u2192`collections action=label-*`, `verify`\u2192`quality action=verify-chain`, `audit`\u2192`quality action=audit`, `health`\u2192`workspace action=check|whoami|status|self-test`, `get-usage-summary`\u2192`workspace action=usage`, `governance-proposals`\u2192`workspace action=proposals-*`, `skills`\u2192`workflows action=load-skill`, `chain-version`\u2192`chain action=version.*`, `chain-branch`\u2192`chain-review action=branch.*`.",
16707
+ DATA_HANDLING_SECTION,
16713
16708
  "",
16714
16709
  "## Your Workspace Principles",
16715
16710
  "",
@@ -16730,7 +16725,7 @@ var INSTRUCTIONS = [
16730
16725
  ' 4. Drill in: use `entries action=get entryId="..."` for full details \u2014 data, labels, relations, history.',
16731
16726
  " 5. Context: use `context action=gather` with an entryId or a task description.",
16732
16727
  " 6. Capture: use `capture` to create entries \u2014 auto-links and scores in one call.",
16733
- " 7. Accept: use `entries action=commit` to promote drafts to SSOT \u2014 only when the user confirms.",
16728
+ " 7. Accept: use `entries action=commit` to send a draft for acceptance \u2014 read the reply's outcome/status field for what happened; read the capture reply first, since an entry that came back accepted needs no commit.",
16734
16729
  " 8. Connect: use `relations action=suggest` then `relations action=create` to build the graph.",
16735
16730
  " 9. Wrapup: call `session action=wrapup-review` before closing \u2014 reviews drafts, coaches quality, suggests links.",
16736
16731
  " 10. Close: call `session action=close` when done \u2014 records session activity. Auto-nudges if wrapup was skipped.",
@@ -16739,10 +16734,6 @@ var INSTRUCTIONS = [
16739
16734
  " - An active agent session \u2014 call `session action=start` first, then `orient action=start` for context. Call `orient action=task` mid-session for a refresh.",
16740
16735
  " - A readwrite API key scope",
16741
16736
  "",
16742
- "Accept-on-confirm: always capture as draft first and show the user what was captured.",
16743
- "Only call `entries action=commit` when the user explicitly confirms (e.g. 'accept', 'looks good', 'yes').",
16744
- "This builds trust \u2014 the Chain (main) is SSOT; nothing goes there without user consent.",
16745
- "",
16746
16737
  "Alignment-first: before proposing or building anything, check orient's Workspace Governance",
16747
16738
  "and Active work packages sections. These are constraints, not reference material.",
16748
16739
  "If the proposal conflicts with a principle, standard, or business rule \u2014 stop, flag the conflict,",
@@ -16921,4 +16912,4 @@ export {
16921
16912
  createProductBrainServer,
16922
16913
  initFeatureFlags
16923
16914
  };
16924
- //# sourceMappingURL=chunk-4SG5IWOJ.js.map
16915
+ //# sourceMappingURL=chunk-RH26YAVX.js.map