@sentry/junior 0.57.0 → 0.58.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 (54) hide show
  1. package/dist/app.js +1301 -1278
  2. package/dist/chat/agent-dispatch/types.d.ts +0 -1
  3. package/dist/chat/conversation-privacy.d.ts +23 -0
  4. package/dist/chat/logging.d.ts +2 -0
  5. package/dist/chat/mcp/tool-manager.d.ts +18 -5
  6. package/dist/chat/mcp/tool-name.d.ts +2 -0
  7. package/dist/chat/pi/client.d.ts +2 -0
  8. package/dist/chat/pi/derived-state.d.ts +5 -0
  9. package/dist/chat/pi/traced-stream.d.ts +5 -1
  10. package/dist/chat/prompt.d.ts +3 -9
  11. package/dist/chat/respond-helpers.d.ts +5 -3
  12. package/dist/chat/respond.d.ts +1 -0
  13. package/dist/chat/runtime/conversation-message.d.ts +10 -0
  14. package/dist/chat/runtime/processing-reaction.d.ts +2 -4
  15. package/dist/chat/runtime/reply-executor.d.ts +13 -16
  16. package/dist/chat/runtime/slack-runtime.d.ts +19 -32
  17. package/dist/chat/runtime/thread-state.d.ts +1 -1
  18. package/dist/chat/runtime/turn-input.d.ts +29 -0
  19. package/dist/chat/runtime/turn-preparation.d.ts +4 -24
  20. package/dist/chat/runtime/turn.d.ts +2 -3
  21. package/dist/chat/sentry-links.d.ts +4 -0
  22. package/dist/chat/services/context-compaction.d.ts +3 -4
  23. package/dist/chat/services/pending-auth.d.ts +1 -1
  24. package/dist/chat/services/subscribed-reply-policy.d.ts +2 -13
  25. package/dist/chat/services/timeout-resume.d.ts +1 -2
  26. package/dist/chat/services/turn-session-record.d.ts +82 -0
  27. package/dist/chat/slack/assistant-thread/title.d.ts +4 -1
  28. package/dist/chat/state/artifacts.d.ts +1 -0
  29. package/dist/chat/state/conversation.d.ts +0 -1
  30. package/dist/chat/state/session-log.d.ts +117 -0
  31. package/dist/chat/state/ttl.d.ts +2 -0
  32. package/dist/chat/state/turn-session.d.ts +89 -0
  33. package/dist/chat/tools/advisor/tool.d.ts +2 -0
  34. package/dist/chat/tools/agent-tools.d.ts +2 -1
  35. package/dist/chat/tools/skill/call-mcp-tool.d.ts +7 -3
  36. package/dist/chat/tools/skill/search-mcp-tools.d.ts +15 -3
  37. package/dist/chat/tools/types.d.ts +0 -1
  38. package/dist/{chunk-AA5TIFN5.js → chunk-FKEKRBUB.js} +267 -735
  39. package/dist/{chunk-TTUY467K.js → chunk-H652GMDH.js} +30 -14
  40. package/dist/chunk-I4FDGMFI.js +950 -0
  41. package/dist/{chunk-D3G3YOU4.js → chunk-ITOW4DED.js} +1 -1
  42. package/dist/chunk-QDGD5WVN.js +708 -0
  43. package/dist/cli/check.js +2 -2
  44. package/dist/cli/init.js +0 -1
  45. package/dist/cli/snapshot-warmup.js +5 -3
  46. package/dist/instrumentation.js +3 -0
  47. package/dist/reporting.d.ts +113 -0
  48. package/dist/reporting.js +390 -0
  49. package/package.json +25 -11
  50. package/dist/chat/services/turn-checkpoint.d.ts +0 -74
  51. package/dist/chat/state/pi-session-message-store.d.ts +0 -15
  52. package/dist/chat/state/turn-session-store.d.ts +0 -49
  53. package/dist/handlers/diagnostics-dashboard.d.ts +0 -2
  54. package/dist/handlers/diagnostics.d.ts +0 -2
@@ -7,17 +7,6 @@ import {
7
7
  pluginRoots
8
8
  } from "./chunk-5LUISFEY.js";
9
9
 
10
- // src/chat/logging.ts
11
- import { AsyncLocalStorage } from "async_hooks";
12
- import path from "path";
13
- import { styleText } from "util";
14
- import {
15
- ConfigError,
16
- configureSync,
17
- getConfig,
18
- getLogger
19
- } from "@logtape/logtape";
20
-
21
10
  // src/chat/coerce.ts
22
11
  function toOptionalString(value) {
23
12
  return typeof value === "string" && value.trim() ? value : void 0;
@@ -30,6 +19,15 @@ function isRecord(value) {
30
19
  }
31
20
 
32
21
  // src/chat/logging.ts
22
+ import { AsyncLocalStorage } from "async_hooks";
23
+ import path from "path";
24
+ import { styleText } from "util";
25
+ import {
26
+ ConfigError,
27
+ configureSync,
28
+ getConfig,
29
+ getLogger
30
+ } from "@logtape/logtape";
33
31
  var MAX_STRING_VALUE = 1200;
34
32
  var SECRETS_RE = [
35
33
  /\b(sk-[A-Za-z0-9_-]{20,})\b/g,
@@ -65,6 +63,20 @@ var LEGACY_KEY_MAP = {
65
63
  inferredSkill: "app.skill.name",
66
64
  inferredScore: "app.skill.score"
67
65
  };
66
+ function normalizeGenAiFinishReason(reason) {
67
+ return reason === "toolUse" ? "tool_use" : reason;
68
+ }
69
+ function normalizeGenAiFinishReasons(value) {
70
+ if (typeof value === "string" && value.trim()) {
71
+ return [normalizeGenAiFinishReason(value)];
72
+ }
73
+ if (!Array.isArray(value)) {
74
+ return value;
75
+ }
76
+ return value.map(
77
+ (reason) => typeof reason === "string" ? normalizeGenAiFinishReason(reason) : reason
78
+ );
79
+ }
68
80
  var contextStorage = new AsyncLocalStorage();
69
81
  var logRecordSinks = /* @__PURE__ */ new Set();
70
82
  var LOGTAPE_BODY_KEY = "__logtape_body";
@@ -338,7 +350,7 @@ function mergeAttributes(...maps) {
338
350
  for (const [rawKey, rawValue] of Object.entries(map)) {
339
351
  const key = normalizeAttributeKey(rawKey);
340
352
  const value = sanitizeValue(
341
- key === "gen_ai.response.finish_reasons" && typeof rawValue === "string" && rawValue.trim() ? [rawValue] : rawValue
353
+ key === "gen_ai.response.finish_reasons" ? normalizeGenAiFinishReasons(rawValue) : rawValue
342
354
  );
343
355
  if (value !== void 0) {
344
356
  merged[key] = value;
@@ -1021,9 +1033,12 @@ function toSpanAttributeValue(value) {
1021
1033
  function normalizeSpanAttributes(attributes) {
1022
1034
  const normalized = {};
1023
1035
  for (const [rawKey, value] of Object.entries(attributes)) {
1024
- const normalizedValue = toSpanAttributeValue(value);
1036
+ const key = normalizeAttributeKey(rawKey);
1037
+ const normalizedValue = toSpanAttributeValue(
1038
+ key === "gen_ai.response.finish_reasons" ? normalizeGenAiFinishReasons(value) : value
1039
+ );
1025
1040
  if (normalizedValue !== void 0) {
1026
- normalized[normalizeAttributeKey(rawKey)] = normalizedValue;
1041
+ normalized[key] = normalizedValue;
1027
1042
  }
1028
1043
  }
1029
1044
  return normalized;
@@ -3192,6 +3207,7 @@ export {
3192
3207
  toOptionalString,
3193
3208
  toOptionalNumber,
3194
3209
  isRecord,
3210
+ normalizeGenAiFinishReason,
3195
3211
  createChatSdkLogger,
3196
3212
  getLogContextAttributes,
3197
3213
  logInfo,