@productbrain/mcp 0.0.1-beta.197 → 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.
@@ -13479,7 +13479,10 @@ var VALID_TASK_DOMAINS = [
13479
13479
  "general"
13480
13480
  ];
13481
13481
  var orientSchema = z22.object({
13482
- 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
+ ),
13483
13486
  task: z22.string().optional().describe("Natural-language task description for task-scoped context. When provided, orient returns scored, relevant entries for the task."),
13484
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(", ")}.`)
13485
13488
  });
@@ -13507,12 +13510,13 @@ function registerOrientTool(server) {
13507
13510
  "orient",
13508
13511
  {
13509
13512
  title: "Orient \u2014 Start Here",
13510
- 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.",
13511
13514
  inputSchema: orientSchema,
13512
13515
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
13513
13516
  },
13514
- thinWrapper(async ({ mode = "full", task, scope }) => {
13517
+ thinWrapper(async ({ mode = "full", tier, task, scope }) => {
13515
13518
  const errors = [];
13519
+ const effectiveTier = tier ?? (mode === "brief" ? "summary" : "standard");
13516
13520
  if (scope && !task) {
13517
13521
  errors.push("--scope requires --task to filter governance. Scope was ignored.");
13518
13522
  }
@@ -13559,6 +13563,7 @@ function registerOrientTool(server) {
13559
13563
  if (scope) orientArgs.scope = scope;
13560
13564
  if (sessionEntryIds.length > 0) orientArgs.sessionEntryIds = sessionEntryIds;
13561
13565
  if (lastSessionOnly.length > 0) orientArgs.lastSessionEntryIds = lastSessionOnly;
13566
+ orientArgs.tier = effectiveTier;
13562
13567
  orientEntries = await kernelQuery("chain.getOrientEntries", orientArgs);
13563
13568
  } catch {
13564
13569
  }
@@ -13761,6 +13766,16 @@ function registerOrientTool(server) {
13761
13766
  lines.push("---");
13762
13767
  lines.push("_No active agent session. Call `session action=start` to begin._");
13763
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
+ }
13764
13779
  if (errors.length > 0) {
13765
13780
  lines.push("");
13766
13781
  for (const err of errors) lines.push(`- ${err}`);
@@ -13781,7 +13796,7 @@ function registerOrientTool(server) {
13781
13796
  }
13782
13797
  )
13783
13798
  };
13784
- reportOrientWrapperBytes(briefResult, orientEntries?._truncated === true);
13799
+ reportOrientWrapperBytes(briefResult, briefTruncated);
13785
13800
  return briefResult;
13786
13801
  }
13787
13802
  const orientStage = readiness?.stage ?? "seeded";
@@ -14150,6 +14165,16 @@ function registerOrientTool(server) {
14150
14165
  lines.push("---");
14151
14166
  lines.push("_No active agent session. Call `session action=start` to begin a tracked session._");
14152
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
+ }
14153
14178
  const fullResult = {
14154
14179
  content: [{ type: "text", text: lines.join("\n") }],
14155
14180
  structuredContent: success(
@@ -14167,7 +14192,7 @@ function registerOrientTool(server) {
14167
14192
  }
14168
14193
  )
14169
14194
  };
14170
- reportOrientWrapperBytes(fullResult, orientEntries?._truncated === true);
14195
+ reportOrientWrapperBytes(fullResult, fullTruncated);
14171
14196
  return fullResult;
14172
14197
  })
14173
14198
  );
@@ -15919,4 +15944,4 @@ export {
15919
15944
  createProductBrainServer,
15920
15945
  initFeatureFlags
15921
15946
  };
15922
- //# sourceMappingURL=chunk-EL6FYD2Q.js.map
15947
+ //# sourceMappingURL=chunk-4J2IMFS7.js.map