@productbrain/mcp 0.0.1-beta.1440 → 0.0.1-beta.1463

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.
@@ -616,10 +616,6 @@ async function isGoverned(slug) {
616
616
  const col = await getCollectionBySlug(slug);
617
617
  return !!col?.governed;
618
618
  }
619
- async function getByNavGroup(navGroup) {
620
- const cols = await getCollections();
621
- return cols.filter((c) => c.navGroup === navGroup);
622
- }
623
619
  async function isWorkPlanningCollection(slug) {
624
620
  const col = await getCollectionBySlug(slug);
625
621
  const layer = col?.thinkingLayer;
@@ -10324,6 +10320,11 @@ var startPbSchema = z17.object({
10324
10320
  task: z17.string().optional().describe(
10325
10321
  "What you're about to work on (e.g. 'implementing auth middleware'). Grounded/connected workspaces: filters governance to show relevant principles, standards, and business rules. Blank/seeded workspaces: ignored (setup flow takes over)."
10326
10322
  )
10323
+ // TEN-2431: no `scope` param. start_pb's governance matches orient's RENDERED governance,
10324
+ // which is scope-BLIND (orient never renders the domain-scoped startup.bindingGovernance).
10325
+ // Domain-scoping the rendered surface is deferred to TEN-2429 (it must change BOTH orient
10326
+ // and start_pb together; INS-1864), so exposing a `scope` here would imply a scoping
10327
+ // capability that does not exist and would diverge start_pb from orient.
10327
10328
  });
10328
10329
  var PB_SETUP_SKILL_ENTRY_ID = "SKILL-pb-setup";
10329
10330
  async function tryMarkOriented(agentSessionId, coherenceSnapshot) {
@@ -10473,6 +10474,27 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
10473
10474
  activeBets = (betsEntries ?? []).filter((e) => isActiveNowBet(e)).map((e) => ({ name: e.name, entryId: e.entryId ?? null })).slice(0, 8);
10474
10475
  } catch {
10475
10476
  }
10477
+ let governanceEntries = { principles: [], standards: [], businessRules: [] };
10478
+ if (task) {
10479
+ try {
10480
+ const view = await kernelQuery("chain.getBindingGovernanceView", { task });
10481
+ const bg = view?.bindingGovernance;
10482
+ if (bg) {
10483
+ const mapGovEntry = (e) => ({
10484
+ entryId: e.entryId ?? void 0,
10485
+ name: e.name,
10486
+ description: typeof e.preview === "string" ? e.preview : void 0,
10487
+ tier: typeof e.tier === "number" ? e.tier : void 0
10488
+ });
10489
+ governanceEntries = {
10490
+ principles: (bg.principles ?? []).map(mapGovEntry),
10491
+ standards: (bg.standards ?? []).map(mapGovEntry),
10492
+ businessRules: (bg.businessRules ?? []).map(mapGovEntry)
10493
+ };
10494
+ }
10495
+ } catch {
10496
+ }
10497
+ }
10476
10498
  if (task) {
10477
10499
  if (activeBets.length > 0) {
10478
10500
  lines.push("");
@@ -10484,33 +10506,7 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
10484
10506
  }
10485
10507
  lines.push("");
10486
10508
  }
10487
- let wsPrinciples = [];
10488
- let wsStandards = [];
10489
- let wsBusinessRules = [];
10490
- try {
10491
- const govCollections = await getByNavGroup("governance");
10492
- const govSlugs = govCollections.map((c) => c.slug);
10493
- for (const slug of govSlugs) {
10494
- const entries = await kernelQuery("chain.listEntries", { collectionSlug: slug });
10495
- const active = (entries ?? []).filter((e) => e.status === "active");
10496
- const colDef = govCollections.find((c) => c.slug === slug);
10497
- const ck = colDef?.defaultCanonicalKey;
10498
- if (ck === "principle") wsPrinciples = [...wsPrinciples, ...active];
10499
- else if (ck === "standard") wsStandards = [...wsStandards, ...active];
10500
- else if (ck === "business_rule") wsBusinessRules = [...wsBusinessRules, ...active];
10501
- }
10502
- } catch {
10503
- }
10504
- const mapGovEntry = (e) => ({
10505
- entryId: e.entryId,
10506
- name: e.name,
10507
- description: typeof e.data?.description === "string" ? e.data.description : typeof e.description === "string" ? e.description : void 0
10508
- });
10509
- lines.push(...buildOperatingProtocol({
10510
- principles: wsPrinciples.map(mapGovEntry),
10511
- standards: wsStandards.map(mapGovEntry),
10512
- businessRules: wsBusinessRules.map(mapGovEntry)
10513
- }, task));
10509
+ lines.push(...buildOperatingProtocol(governanceEntries, task));
10514
10510
  if (coherence) {
10515
10511
  lines.push(...coherence.lines);
10516
10512
  }
@@ -14476,4 +14472,4 @@ export {
14476
14472
  createProductBrainServer,
14477
14473
  initFeatureFlags
14478
14474
  };
14479
- //# sourceMappingURL=chunk-LIOYSWBH.js.map
14475
+ //# sourceMappingURL=chunk-T566VC4F.js.map