@sentry/junior 0.37.0 → 0.38.0

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.
Files changed (2) hide show
  1. package/dist/app.js +36 -9
  2. package/package.json +2 -2
package/dist/app.js CHANGED
@@ -9493,7 +9493,13 @@ var MAX_ROUTER_CONTEXT_CHARS = 8e3;
9493
9493
  var ROUTER_CONTEXT_HEAD_CHARS = 3e3;
9494
9494
  var ROUTER_CONTEXT_TAIL_CHARS = 5e3;
9495
9495
  var TRUNCATION_MARKER = "\n\u2026[truncated]\u2026\n";
9496
- var TURN_THINKING_LEVELS = ["none", "low", "medium", "high"];
9496
+ var TURN_THINKING_LEVELS = [
9497
+ "none",
9498
+ "low",
9499
+ "medium",
9500
+ "high",
9501
+ "xhigh"
9502
+ ];
9497
9503
  var turnExecutionProfileSchema = z.object({
9498
9504
  thinking_level: z.enum(TURN_THINKING_LEVELS),
9499
9505
  confidence: z.number().min(0).max(1),
@@ -9504,7 +9510,8 @@ var THINKING_LEVEL_RANK = {
9504
9510
  none: 0,
9505
9511
  low: 1,
9506
9512
  medium: 2,
9507
- high: 3
9513
+ high: 3,
9514
+ xhigh: 4
9508
9515
  };
9509
9516
  function trimContextForRouter(text) {
9510
9517
  const trimmed = text?.trim();
@@ -9529,12 +9536,13 @@ function trimContextForRouter(text) {
9529
9536
  function buildClassifierSystemPrompt() {
9530
9537
  return [
9531
9538
  "You route assistant turns to the thinking level most likely to produce a complete, source-grounded answer.",
9532
- "Choose exactly one bucket: none, low, medium, or high.",
9539
+ "Choose exactly one bucket: none, low, medium, high, or xhigh.",
9533
9540
  "",
9534
9541
  "Use none only for greetings, acknowledgments, and turns that need no substantive assistant work.",
9535
9542
  "Use low rarely: only for deterministic one-step answers or transformations with no tools, no current/external facts, no thread-background interpretation, and no source verification.",
9536
9543
  "Use medium for normal assistant work: explanations, source-backed checks, thread follow-ups, tool choice, likely tool use, ambiguous asks, multi-step analysis, or anything where a confident but shallow answer would be risky.",
9537
- "Use high for code changes, debugging/root-cause analysis, research-heavy work, non-trivial drafting, or explicit requests to be thorough.",
9544
+ "Use high for research-heavy work, non-trivial drafting, or explicit requests to be thorough.",
9545
+ "Use xhigh for the most complex tasks: code changes, debugging/root-cause analysis, broad refactors, architecture decisions, multi-file implementation, or any task where deep reasoning across multiple systems or files is required.",
9538
9546
  "When unsure between two non-none buckets, choose the higher bucket. Do not use low as the default.",
9539
9547
  "",
9540
9548
  "Classify based on the substance of the task, not the length of the current message. When the current instruction is a short affirmation (for example: 'go', 'do it', 'yes please', 'proceed') and the thread-background contains a pending task, classify the pending task \u2014 not the affirmation.",
@@ -9676,6 +9684,8 @@ function toAgentThinkingLevel(level) {
9676
9684
  return "medium";
9677
9685
  case "high":
9678
9686
  return "high";
9687
+ case "xhigh":
9688
+ return "xhigh";
9679
9689
  }
9680
9690
  }
9681
9691
 
@@ -11460,17 +11470,34 @@ function escapeSlackMrkdwn(text) {
11460
11470
  return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
11461
11471
  }
11462
11472
  function formatSlackTokenCount(value) {
11463
- return new Intl.NumberFormat("en-US").format(value);
11473
+ if (value >= 1e6) {
11474
+ const millions = value / 1e6;
11475
+ return `${parseFloat(millions.toFixed(2))}m`;
11476
+ }
11477
+ if (value >= 1e3) {
11478
+ const thousands = value / 1e3;
11479
+ return `${parseFloat(thousands.toFixed(1))}k`;
11480
+ }
11481
+ return `${value}`;
11464
11482
  }
11465
11483
  function formatSlackDuration(durationMs) {
11466
11484
  if (durationMs < 1e3) {
11467
11485
  return `${durationMs}ms`;
11468
11486
  }
11469
- const durationSeconds = durationMs / 1e3;
11470
- if (durationSeconds < 10) {
11471
- return `${durationSeconds.toFixed(1).replace(/\.0$/, "")}s`;
11487
+ const totalSeconds = Math.round(durationMs / 1e3);
11488
+ if (totalSeconds < 10) {
11489
+ const precise = durationMs / 1e3;
11490
+ return `${precise.toFixed(1).replace(/\.0$/, "")}s`;
11491
+ }
11492
+ if (totalSeconds < 60) {
11493
+ return `${totalSeconds}s`;
11494
+ }
11495
+ const minutes = Math.floor(totalSeconds / 60);
11496
+ const seconds = totalSeconds % 60;
11497
+ if (seconds === 0) {
11498
+ return `${minutes}m`;
11472
11499
  }
11473
- return `${Math.round(durationSeconds)}s`;
11500
+ return `${minutes}m${seconds}s`;
11474
11501
  }
11475
11502
  function resolveTotalTokens(usage) {
11476
11503
  if (!usage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -35,7 +35,7 @@
35
35
  "ai": "^6.0.175",
36
36
  "bash-tool": "^1.3.16",
37
37
  "chat": "4.27.0",
38
- "hono": "^4.12.18",
38
+ "hono": "^4.12.6",
39
39
  "just-bash": "2.14.2",
40
40
  "node-html-markdown": "^2.0.0",
41
41
  "yaml": "^2.8.4",