@productbrain/mcp 0.0.1-beta.196 → 0.0.1-beta.199

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.
@@ -11003,15 +11003,12 @@ function formatWhatNeedsAttentionBrief(wna) {
11003
11003
  const blocked = wna.blockedBets ?? [];
11004
11004
  const critical = wna.criticalPathBets ?? [];
11005
11005
  const outcomeBlockers = wna.overdueOutcomeBlockers ?? [];
11006
- if (overdue.length === 0 && blocked.length === 0 && critical.length === 0 && outcomeBlockers.length === 0)
11007
- return [];
11006
+ if (overdue.length === 0 && blocked.length === 0 && critical.length === 0 && outcomeBlockers.length === 0) return [];
11008
11007
  const bullets = [
11009
11008
  ...overdue.slice(0, 2).map((id) => `\`${id}\` (overdue)`),
11010
11009
  ...blocked.slice(0, 2).map((id) => `\`${id}\` (blocked)`),
11011
11010
  ...critical.slice(0, 1).map((id) => `\`${id}\` (critical path)`),
11012
- ...outcomeBlockers.length > 0 ? [
11013
- `${outcomeBlockers.length} bet${outcomeBlockers.length > 1 ? "s" : ""} with overdue outcome verification`
11014
- ] : []
11011
+ ...outcomeBlockers.length > 0 ? [`${outcomeBlockers.length} bet${outcomeBlockers.length > 1 ? "s" : ""} with overdue outcome verification`] : []
11015
11012
  ].slice(0, 3);
11016
11013
  if (bullets.length === 0) return [];
11017
11014
  const lines = ["**What needs attention:**", ...bullets.map((b) => `- ${b}`), ""];
@@ -13482,7 +13479,10 @@ var VALID_TASK_DOMAINS = [
13482
13479
  "general"
13483
13480
  ];
13484
13481
  var orientSchema = z22.object({
13485
- mode: z22.enum(["full", "brief"]).optional().default("full").describe("full = full context (default). brief = compact summary for mid-session re-orientation."),
13482
+ mode: z22.enum(["full", "brief"]).optional().default("full").describe("full = full context (default). brief = compact summary for mid-session re-orientation. Prefer using the `tier` param for depth control."),
13483
+ tier: z22.enum(["summary", "standard", "full"]).optional().describe(
13484
+ "Payload depth. summary = ~10 KB compact. standard = ~256 KB default. full = complete payload (large). Defaults to standard."
13485
+ ),
13486
13486
  task: z22.string().optional().describe("Natural-language task description for task-scoped context. When provided, orient returns scored, relevant entries for the task."),
13487
13487
  scope: z22.enum(VALID_TASK_DOMAINS).optional().describe(`Optional domain scope to filter governance to entries relevant for this domain. Valid values: ${VALID_TASK_DOMAINS.join(", ")}.`)
13488
13488
  });
@@ -13510,12 +13510,13 @@ function registerOrientTool(server) {
13510
13510
  "orient",
13511
13511
  {
13512
13512
  title: "Orient \u2014 Start Here",
13513
- description: "The single entry point for starting a session. Returns workspace context with a single recommended next action for low-readiness workspaces, or a standup-style briefing for established workspaces.\n\nUse this FIRST. One call to orient replaces 3\u20135 individual tool calls.\n\nCompleting orientation unlocks write tools for the active session.\n\n**mode:** `full` (default) returns full context. `brief` returns only vision, bet/tension counts, readiness, active bet names, and last-session summary \u2014 use for mid-session re-orientation.\n\n**task:** Optional natural-language task description. When provided, returns task-scoped context (scored, relevant entries) in addition to standard orient sections.\n\n**scope:** Optional domain scope. Filters governance entries to those relevant for the specified domain. Authority roots include strategy, product, product-design, engineering, architecture, data, governance, and go-to-market. Child scopes such as product-design/ux, engineering/frontend, data/analytics, and governance/principles are accepted. Legacy internal scopes remain accepted.",
13513
+ description: "The single entry point for starting a session. Returns workspace context with a single recommended next action for low-readiness workspaces, or a standup-style briefing for established workspaces.\n\nUse this FIRST. One call to orient replaces 3\u20135 individual tool calls.\n\nCompleting orientation unlocks write tools for the active session.\n\n**tier:** Controls payload depth. `standard` (default, ~256 KB) is the recommended default. `summary` (~10 KB) for quick mid-session re-orientation. `full` for complete payload when deep context is needed.\n\n**mode:** `full` (default) returns full context. `brief` returns compact summary \u2014 mapped to tier=summary internally. Prefer `tier` for explicit depth control.\n\n**task:** Optional natural-language task description. When provided, returns task-scoped context (scored, relevant entries) in addition to standard orient sections.\n\n**scope:** Optional domain scope. Filters governance entries to those relevant for the specified domain. Authority roots include strategy, product, product-design, engineering, architecture, data, governance, and go-to-market. Child scopes such as product-design/ux, engineering/frontend, data/analytics, and governance/principles are accepted. Legacy internal scopes remain accepted.",
13514
13514
  inputSchema: orientSchema,
13515
13515
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
13516
13516
  },
13517
- thinWrapper(async ({ mode = "full", task, scope }) => {
13517
+ thinWrapper(async ({ mode = "full", tier, task, scope }) => {
13518
13518
  const errors = [];
13519
+ const effectiveTier = tier ?? (mode === "brief" ? "summary" : "standard");
13519
13520
  if (scope && !task) {
13520
13521
  errors.push("--scope requires --task to filter governance. Scope was ignored.");
13521
13522
  }
@@ -13562,6 +13563,7 @@ function registerOrientTool(server) {
13562
13563
  if (scope) orientArgs.scope = scope;
13563
13564
  if (sessionEntryIds.length > 0) orientArgs.sessionEntryIds = sessionEntryIds;
13564
13565
  if (lastSessionOnly.length > 0) orientArgs.lastSessionEntryIds = lastSessionOnly;
13566
+ orientArgs.tier = effectiveTier;
13565
13567
  orientEntries = await kernelQuery("chain.getOrientEntries", orientArgs);
13566
13568
  } catch {
13567
13569
  }
@@ -13764,6 +13766,16 @@ function registerOrientTool(server) {
13764
13766
  lines.push("---");
13765
13767
  lines.push("_No active agent session. Call `session action=start` to begin._");
13766
13768
  }
13769
+ const briefTruncated = orientEntries?._budget?.truncated ?? orientEntries?._truncated ?? false;
13770
+ if (briefTruncated) {
13771
+ const reasons = orientEntries?._budget?.truncationReasons;
13772
+ lines.push("");
13773
+ if (reasons && reasons.length > 0) {
13774
+ lines.push(`_Context truncated to fit tier budget: ${reasons.join(", ")}. Use tier=full for complete payload._`);
13775
+ } else {
13776
+ lines.push("_Context truncated to fit tier budget. Use tier=full for complete payload._");
13777
+ }
13778
+ }
13767
13779
  if (errors.length > 0) {
13768
13780
  lines.push("");
13769
13781
  for (const err of errors) lines.push(`- ${err}`);
@@ -13784,7 +13796,7 @@ function registerOrientTool(server) {
13784
13796
  }
13785
13797
  )
13786
13798
  };
13787
- reportOrientWrapperBytes(briefResult, orientEntries?._truncated === true);
13799
+ reportOrientWrapperBytes(briefResult, briefTruncated);
13788
13800
  return briefResult;
13789
13801
  }
13790
13802
  const orientStage = readiness?.stage ?? "seeded";
@@ -14153,6 +14165,16 @@ function registerOrientTool(server) {
14153
14165
  lines.push("---");
14154
14166
  lines.push("_No active agent session. Call `session action=start` to begin a tracked session._");
14155
14167
  }
14168
+ const fullTruncated = orientEntries?._budget?.truncated ?? orientEntries?._truncated ?? false;
14169
+ if (fullTruncated) {
14170
+ const reasons = orientEntries?._budget?.truncationReasons;
14171
+ lines.push("");
14172
+ if (reasons && reasons.length > 0) {
14173
+ lines.push(`_Context truncated to fit tier budget: ${reasons.join(", ")}. Use tier=full for complete payload._`);
14174
+ } else {
14175
+ lines.push("_Context truncated to fit tier budget. Use tier=full for complete payload._");
14176
+ }
14177
+ }
14156
14178
  const fullResult = {
14157
14179
  content: [{ type: "text", text: lines.join("\n") }],
14158
14180
  structuredContent: success(
@@ -14170,7 +14192,7 @@ function registerOrientTool(server) {
14170
14192
  }
14171
14193
  )
14172
14194
  };
14173
- reportOrientWrapperBytes(fullResult, orientEntries?._truncated === true);
14195
+ reportOrientWrapperBytes(fullResult, fullTruncated);
14174
14196
  return fullResult;
14175
14197
  })
14176
14198
  );
@@ -15922,4 +15944,4 @@ export {
15922
15944
  createProductBrainServer,
15923
15945
  initFeatureFlags
15924
15946
  };
15925
- //# sourceMappingURL=chunk-26IS4THT.js.map
15947
+ //# sourceMappingURL=chunk-4J2IMFS7.js.map