@sentry/junior 0.96.0 → 0.97.1

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 (135) hide show
  1. package/dist/{agent-hooks-5URSMY3O.js → agent-hooks-XSUIVRQS.js} +8 -6
  2. package/dist/{reporting → api}/conversations/activity.d.ts +1 -1
  3. package/dist/api/conversations/detail-projection.d.ts +10 -0
  4. package/dist/api/conversations/detail.d.ts +3 -0
  5. package/dist/api/conversations/detail.query.d.ts +3 -0
  6. package/dist/api/conversations/list.d.ts +3 -0
  7. package/dist/api/conversations/list.query.d.ts +94 -0
  8. package/dist/api/conversations/projection.d.ts +14 -0
  9. package/dist/api/conversations/schema.d.ts +683 -0
  10. package/dist/{reporting → api}/conversations/shared.d.ts +1 -5
  11. package/dist/api/conversations/stats.d.ts +3 -0
  12. package/dist/api/conversations/stats.query.d.ts +3 -0
  13. package/dist/api/conversations/subagent.d.ts +3 -0
  14. package/dist/{reporting → api}/conversations/transcript.d.ts +4 -4
  15. package/dist/api/people/list.d.ts +1 -2
  16. package/dist/api/people/list.query.d.ts +3 -4
  17. package/dist/api/people/profile.d.ts +1 -2
  18. package/dist/api/people/profile.query.d.ts +3 -4
  19. package/dist/api/people/schema.d.ts +193 -0
  20. package/dist/api/people/shared.d.ts +31 -9
  21. package/dist/api/schema.d.ts +20 -0
  22. package/dist/api/schema.js +50 -0
  23. package/dist/api-reference.d.ts +4 -3
  24. package/dist/api.d.ts +3 -0
  25. package/dist/api.js +156 -0
  26. package/dist/app.d.ts +1 -4
  27. package/dist/app.js +101 -367
  28. package/dist/build/virtual-config.d.ts +2 -2
  29. package/dist/{catalog-runtime-MSMAYYIK.js → catalog-runtime-PFHVMHDR.js} +3 -2
  30. package/dist/chat/agent/resume.d.ts +3 -1
  31. package/dist/chat/agent/tools.d.ts +2 -1
  32. package/dist/chat/config.d.ts +1 -8
  33. package/dist/chat/conversations/history.d.ts +241 -27
  34. package/dist/chat/conversations/legacy-advisor-session.d.ts +7 -0
  35. package/dist/chat/conversations/legacy-import.d.ts +2 -2
  36. package/dist/chat/conversations/projection.d.ts +19 -3
  37. package/dist/chat/conversations/sql/legacy-history-import.d.ts +1 -1
  38. package/dist/chat/conversations/sql/store.d.ts +15 -9
  39. package/dist/chat/conversations/store.d.ts +9 -4
  40. package/dist/chat/model-profile.d.ts +14 -0
  41. package/dist/chat/pi/transcript.d.ts +5 -3
  42. package/dist/chat/resource-events/store.d.ts +2 -2
  43. package/dist/chat/services/context-compaction.d.ts +15 -0
  44. package/dist/chat/services/turn-result.d.ts +1 -0
  45. package/dist/chat/services/turn-session-record.d.ts +6 -6
  46. package/dist/chat/state/turn-session.d.ts +16 -5
  47. package/dist/chat/task-execution/store.d.ts +2 -2
  48. package/dist/chat/tools/handoff/tool.d.ts +45 -0
  49. package/dist/chat/tools/types.d.ts +7 -2
  50. package/dist/chat/usage.d.ts +25 -25
  51. package/dist/{chunk-RITD7E5L.js → chunk-35BNLDOJ.js} +338 -577
  52. package/dist/{chunk-PMNN6ST4.js → chunk-3ECW2K2O.js} +7 -2
  53. package/dist/{chunk-5C6XTTFI.js → chunk-3F4OPKGF.js} +89 -55
  54. package/dist/chunk-3V7OFJZC.js +264 -0
  55. package/dist/chunk-4ZNGQH7C.js +25 -0
  56. package/dist/{chunk-S5KZ5LPG.js → chunk-5HLDPVYS.js} +14 -447
  57. package/dist/{chunk-DZENG5ML.js → chunk-6U26PYI5.js} +24 -14
  58. package/dist/chunk-AUUCAFDE.js +546 -0
  59. package/dist/{chunk-6APU57E6.js → chunk-B3IT5END.js} +41 -260
  60. package/dist/chunk-CEA3A3UA.js +86 -0
  61. package/dist/{chunk-YDT7SNCN.js → chunk-D5KZYS4T.js} +1 -1
  62. package/dist/{chunk-YDVEH3SB.js → chunk-EEZCY5WX.js} +78 -28
  63. package/dist/{chunk-2NAZZPPS.js → chunk-EOWXRY5E.js} +1 -1
  64. package/dist/{chunk-GQ3GK22G.js → chunk-FBHZJFHI.js} +2 -2
  65. package/dist/{chunk-CZEX6KIQ.js → chunk-G3E7SCME.js} +0 -23
  66. package/dist/chunk-GUAP3H7O.js +319 -0
  67. package/dist/{chunk-BYZWPRJA.js → chunk-H66UCBPW.js} +6 -4
  68. package/dist/{chunk-L7CDEIVJ.js → chunk-LMJPRYHP.js} +4 -2
  69. package/dist/chunk-LUAE4MGW.js +199 -0
  70. package/dist/{chunk-GY34VGP5.js → chunk-LVA4I4H7.js} +3 -1
  71. package/dist/chunk-LVUKF5CE.js +63 -0
  72. package/dist/{chunk-AAZXTVJT.js → chunk-NG2AV7IB.js} +2 -72
  73. package/dist/chunk-ON6YKIQ7.js +260 -0
  74. package/dist/chunk-PDO5BLNM.js +22 -0
  75. package/dist/chunk-QNVHH5PU.js +20 -0
  76. package/dist/{chunk-P3YFQLEN.js → chunk-T533JLM3.js} +8 -10
  77. package/dist/chunk-UAMKJPDF.js +11 -0
  78. package/dist/chunk-VFH4ZKZT.js +66 -0
  79. package/dist/{chunk-UKHVMPX5.js → chunk-WGXMTFNU.js} +15 -17
  80. package/dist/{chunk-MNTINMWR.js → chunk-WJOSZOON.js} +184 -300
  81. package/dist/chunk-WTYEKPXU.js +451 -0
  82. package/dist/{chunk-IYM2SIVG.js → chunk-XIRPQQVE.js} +605 -363
  83. package/dist/cli/chat.js +24 -21
  84. package/dist/cli/check.js +4 -3
  85. package/dist/cli/init.js +12 -0
  86. package/dist/cli/plugins.js +12 -9
  87. package/dist/cli/snapshot-warmup.js +8 -6
  88. package/dist/cli/upgrade.js +265 -137
  89. package/dist/db/db.d.ts +4 -0
  90. package/dist/db/schema/conversations.d.ts +128 -0
  91. package/dist/db/schema.d.ts +129 -60
  92. package/dist/{db-2D6RMG67.js → db-BWXYIKFQ.js} +3 -3
  93. package/dist/detail-GA6NXWQJ.js +43 -0
  94. package/dist/discovery-RMHYSRL7.js +43 -0
  95. package/dist/handlers/health.d.ts +3 -0
  96. package/dist/instrumentation.js +1 -1
  97. package/dist/{legacy-import-VZ2MEGP7.js → legacy-import-3NQJVGQL.js} +4 -4
  98. package/dist/{api/people/list.js → list-A3WFRIYX.js} +26 -16
  99. package/dist/list-UXJI5Q5X.js +27 -0
  100. package/dist/nitro.d.ts +1 -1
  101. package/dist/nitro.js +2 -1
  102. package/dist/plugin-conversations-DDNGC35A.js +36 -0
  103. package/dist/{api/people/profile.js → profile-4RYDXWTF.js} +33 -18
  104. package/dist/reporting/plugin-conversations.d.ts +3 -0
  105. package/dist/reporting-schema.d.ts +140 -0
  106. package/dist/reporting.d.ts +12 -81
  107. package/dist/{runner-JZBRQP4F.js → runner-JALSYH2P.js} +17 -12
  108. package/dist/skills-MAZXZ2KE.js +26 -0
  109. package/dist/stats-XKXH3PTY.js +217 -0
  110. package/dist/subagent-TZ55XY37.js +48 -0
  111. package/dist/usage-schema.d.ts +25 -0
  112. package/dist/{validation-6XOOQGME.js → validation-FMEAEKCY.js} +4 -3
  113. package/migrations/0000_initial.sql +115 -0
  114. package/migrations/0001_conversation_metrics.sql +4 -0
  115. package/migrations/README.md +12 -30
  116. package/migrations/meta/0000_snapshot.json +1 -33
  117. package/migrations/meta/0001_snapshot.json +972 -0
  118. package/migrations/meta/_journal.json +9 -2
  119. package/package.json +13 -17
  120. package/dist/api/people/types.d.ts +0 -85
  121. package/dist/chat/advisor-request.d.ts +0 -4
  122. package/dist/chat/conversations/sql/migrations.d.ts +0 -22
  123. package/dist/chat/tools/advisor/session-store.d.ts +0 -9
  124. package/dist/chat/tools/advisor/tool.d.ts +0 -72
  125. package/dist/chunk-RAIB6WSG.js +0 -142
  126. package/dist/chunk-WM6KHPBQ.js +0 -48
  127. package/dist/db/schema/migrations.d.ts +0 -58
  128. package/dist/reporting/conversations/context.d.ts +0 -8
  129. package/dist/reporting/conversations/details.d.ts +0 -6
  130. package/dist/reporting/conversations/index.d.ts +0 -4
  131. package/dist/reporting/conversations/statistics.d.ts +0 -4
  132. package/dist/reporting/conversations/summaries.d.ts +0 -20
  133. package/dist/reporting/conversations/types.d.ts +0 -191
  134. package/dist/reporting/conversations.d.ts +0 -1
  135. package/dist/reporting.js +0 -1155
@@ -9,13 +9,11 @@ import {
9
9
  getPersistedThreadState,
10
10
  markTurnCompleted,
11
11
  mergeArtifactsState
12
- } from "./chunk-UKHVMPX5.js";
13
- import {
14
- coerceThreadConversationState
15
- } from "./chunk-RAIB6WSG.js";
12
+ } from "./chunk-WGXMTFNU.js";
16
13
  import {
14
+ coerceThreadConversationState,
17
15
  getAgentTurnSessionRecord
18
- } from "./chunk-MNTINMWR.js";
16
+ } from "./chunk-WJOSZOON.js";
19
17
  import {
20
18
  generateConversationId,
21
19
  hydrateConversationMessages,
@@ -23,19 +21,19 @@ import {
23
21
  normalizeConversationText,
24
22
  updateConversationStats,
25
23
  upsertConversationMessage
26
- } from "./chunk-5C6XTTFI.js";
24
+ } from "./chunk-3F4OPKGF.js";
27
25
  import {
28
26
  createPluginEmbedder,
29
27
  createPluginModel,
30
28
  getPlugins
31
- } from "./chunk-S5KZ5LPG.js";
29
+ } from "./chunk-5HLDPVYS.js";
32
30
  import {
33
31
  createPluginLogger,
34
32
  createPluginState
35
- } from "./chunk-2NAZZPPS.js";
33
+ } from "./chunk-EOWXRY5E.js";
36
34
  import {
37
35
  getDb
38
- } from "./chunk-RITD7E5L.js";
36
+ } from "./chunk-35BNLDOJ.js";
39
37
  import {
40
38
  GEN_AI_PROVIDER_NAME,
41
39
  botConfig,
@@ -46,7 +44,7 @@ import {
46
44
  isToolResultMessage,
47
45
  normalizeToolNameFromResult,
48
46
  stripRuntimeTurnContext
49
- } from "./chunk-YDVEH3SB.js";
47
+ } from "./chunk-EEZCY5WX.js";
50
48
  import {
51
49
  buildTurnFailureResponse
52
50
  } from "./chunk-I35CTGPO.js";
@@ -0,0 +1,11 @@
1
+ // src/api/schema.ts
2
+ import { z } from "zod";
3
+ var conversationParamsSchema = z.object({ conversationId: z.string().min(1) }).strict();
4
+ var subagentParamsSchema = conversationParamsSchema.extend({ subagentId: z.string().min(1) }).strict();
5
+ var personParamsSchema = z.object({ email: z.string().trim().min(1) }).strict();
6
+
7
+ export {
8
+ conversationParamsSchema,
9
+ subagentParamsSchema,
10
+ personParamsSchema
11
+ };
@@ -0,0 +1,66 @@
1
+ import {
2
+ actorIdentitySchema,
3
+ conversationStatsItemSchema,
4
+ conversationSummaryReportSchema
5
+ } from "./chunk-LUAE4MGW.js";
6
+
7
+ // src/api/people/schema.ts
8
+ import { z } from "zod";
9
+ var peopleConversationSummaryReportSchema = conversationSummaryReportSchema.omit({
10
+ cumulativeUsage: true,
11
+ sentryTraceUrl: true,
12
+ traceId: true
13
+ });
14
+ var peopleConversationStatsItemSchema = conversationStatsItemSchema.omit({ costUsd: true });
15
+ var actorActivityDayReportSchema = z.object({
16
+ active: z.number(),
17
+ conversations: z.number(),
18
+ date: z.string(),
19
+ durationMs: z.number(),
20
+ failed: z.number(),
21
+ hung: z.number(),
22
+ tokens: z.number().optional()
23
+ }).strict();
24
+ var actorTotalsReportSchema = z.object({
25
+ active: z.number(),
26
+ activeDays: z.number(),
27
+ conversations: z.number(),
28
+ durationMs: z.number(),
29
+ failed: z.number(),
30
+ hung: z.number(),
31
+ tokens: z.number().optional()
32
+ }).strict();
33
+ var identifiedActorSchema = actorIdentitySchema.extend({ email: z.string().min(1) }).strict();
34
+ var actorSummaryReportSchema = actorTotalsReportSchema.extend({
35
+ firstSeenAt: z.string(),
36
+ lastSeenAt: z.string(),
37
+ actor: identifiedActorSchema
38
+ }).strict();
39
+ var actorDirectoryReportSchema = z.object({
40
+ generatedAt: z.string(),
41
+ people: z.array(actorSummaryReportSchema),
42
+ sampleLimit: z.number(),
43
+ sampleSize: z.number(),
44
+ source: z.literal("conversation_index"),
45
+ truncated: z.boolean()
46
+ }).strict();
47
+ var actorProfileReportSchema = z.object({
48
+ activityDays: z.array(actorActivityDayReportSchema),
49
+ generatedAt: z.string(),
50
+ locations: z.array(peopleConversationStatsItemSchema),
51
+ recentConversations: z.array(peopleConversationSummaryReportSchema),
52
+ actor: identifiedActorSchema,
53
+ sampleLimit: z.number(),
54
+ sampleSize: z.number(),
55
+ source: z.literal("conversation_index"),
56
+ surfaces: z.array(peopleConversationStatsItemSchema),
57
+ totals: actorTotalsReportSchema,
58
+ truncated: z.boolean(),
59
+ windowEnd: z.string(),
60
+ windowStart: z.string()
61
+ }).strict();
62
+
63
+ export {
64
+ actorDirectoryReportSchema,
65
+ actorProfileReportSchema
66
+ };
@@ -1,24 +1,22 @@
1
1
  import {
2
- buildConversationStatePatch
3
- } from "./chunk-RAIB6WSG.js";
4
- import {
2
+ JUNIOR_THREAD_STATE_TTL_MS,
5
3
  abandonAgentTurnSessionRecord,
6
4
  addAgentTurnUsage,
5
+ buildConversationStatePatch,
7
6
  getAgentTurnSessionRecord,
8
7
  upsertAgentTurnSessionRecord
9
- } from "./chunk-MNTINMWR.js";
8
+ } from "./chunk-WJOSZOON.js";
10
9
  import {
11
- JUNIOR_THREAD_STATE_TTL_MS,
12
10
  persistConversationMessages
13
- } from "./chunk-5C6XTTFI.js";
11
+ } from "./chunk-3F4OPKGF.js";
14
12
  import {
15
13
  sleep
16
- } from "./chunk-CZEX6KIQ.js";
14
+ } from "./chunk-4ZNGQH7C.js";
17
15
  import {
18
16
  getPiMessageRole,
19
17
  getStateAdapter,
20
18
  trimTrailingAssistantMessages
21
- } from "./chunk-YDVEH3SB.js";
19
+ } from "./chunk-EEZCY5WX.js";
22
20
  import {
23
21
  getActiveTraceId,
24
22
  logException
@@ -124,7 +122,7 @@ function logSessionRecordError(error, eventName, args, attributes, message) {
124
122
  slackChannelId: args.logContext.channelId,
125
123
  runId: args.logContext.runId,
126
124
  assistantUserName: args.logContext.assistantUserName,
127
- modelId: args.logContext.modelId
125
+ modelId: args.modelId
128
126
  },
129
127
  {
130
128
  "app.ai.resume_conversation_id": args.conversationId,
@@ -190,7 +188,7 @@ async function persistRunningSessionRecord(args) {
190
188
  ...args.trailingMessageProvenance ? { trailingMessageProvenance: args.trailingMessageProvenance } : {},
191
189
  ...args.surface ?? latestSessionRecord?.surface ? { surface: args.surface ?? latestSessionRecord?.surface } : {},
192
190
  ...args.loadedSkillNames ? { loadedSkillNames: args.loadedSkillNames } : {},
193
- ...args.modelId ? { modelId: args.modelId } : {},
191
+ modelId: args.modelId,
194
192
  ...args.reasoningLevel ? { reasoningLevel: args.reasoningLevel } : {},
195
193
  ...args.actor ?? latestSessionRecord?.actor ? { actor: args.actor ?? latestSessionRecord?.actor } : {},
196
194
  ...getActiveTraceId() ?? latestSessionRecord?.traceId ? { traceId: getActiveTraceId() ?? latestSessionRecord?.traceId } : {},
@@ -226,7 +224,7 @@ async function persistCompletedSessionRecord(args) {
226
224
  "Completed session record requires a slice id from the caller or the latest stored record"
227
225
  );
228
226
  }
229
- const modelId = latestSessionRecord?.modelId ?? args.modelId ?? args.logContext.modelId;
227
+ const modelId = args.modelId;
230
228
  const reasoningLevel = args.reasoningLevel ?? latestSessionRecord?.reasoningLevel;
231
229
  const target = {
232
230
  ...args.channelName ?? latestSessionRecord?.channelName ? { channelName: args.channelName ?? latestSessionRecord?.channelName } : {},
@@ -250,7 +248,7 @@ async function persistCompletedSessionRecord(args) {
250
248
  ...args.loadedSkillNames ?? latestSessionRecord?.loadedSkillNames ? {
251
249
  loadedSkillNames: args.loadedSkillNames ?? latestSessionRecord?.loadedSkillNames
252
250
  } : {},
253
- ...modelId ? { modelId } : {},
251
+ modelId,
254
252
  ...reasoningLevel ? { reasoningLevel } : {},
255
253
  ...args.actor ?? latestSessionRecord?.actor ? { actor: args.actor ?? latestSessionRecord?.actor } : {},
256
254
  ...getActiveTraceId() ?? latestSessionRecord?.traceId ? { traceId: getActiveTraceId() ?? latestSessionRecord?.traceId } : {},
@@ -276,7 +274,7 @@ async function completeDeliveredTurn(args) {
276
274
  allMessages: args.messages,
277
275
  loadedSkillNames: args.loadedSkillNames,
278
276
  logContext: args.logContext,
279
- modelId: args.logContext.modelId,
277
+ modelId: args.modelId,
280
278
  actor: args.actor,
281
279
  reasoningLevel: args.reasoningLevel,
282
280
  surface: args.surface,
@@ -316,7 +314,7 @@ async function persistAuthPauseSessionRecord(args) {
316
314
  piMessages,
317
315
  ...args.surface ?? latestSessionRecord?.surface ? { surface: args.surface ?? latestSessionRecord?.surface } : {},
318
316
  ...args.loadedSkillNames ? { loadedSkillNames: args.loadedSkillNames } : {},
319
- ...args.modelId ?? latestSessionRecord?.modelId ? { modelId: args.modelId ?? latestSessionRecord?.modelId } : {},
317
+ modelId: args.modelId,
320
318
  ...args.reasoningLevel ?? latestSessionRecord?.reasoningLevel ? {
321
319
  reasoningLevel: args.reasoningLevel ?? latestSessionRecord?.reasoningLevel
322
320
  } : {},
@@ -380,7 +378,7 @@ async function persistTimeoutSessionRecord(args) {
380
378
  piMessages,
381
379
  ...args.surface ?? latestSessionRecord?.surface ? { surface: args.surface ?? latestSessionRecord?.surface } : {},
382
380
  ...args.loadedSkillNames ? { loadedSkillNames: args.loadedSkillNames } : {},
383
- ...args.modelId ?? latestSessionRecord?.modelId ? { modelId: args.modelId ?? latestSessionRecord?.modelId } : {},
381
+ modelId: args.modelId,
384
382
  ...args.reasoningLevel ?? latestSessionRecord?.reasoningLevel ? {
385
383
  reasoningLevel: args.reasoningLevel ?? latestSessionRecord?.reasoningLevel
386
384
  } : {},
@@ -404,7 +402,7 @@ async function persistTimeoutSessionRecord(args) {
404
402
  piMessages,
405
403
  ...args.surface ?? latestSessionRecord?.surface ? { surface: args.surface ?? latestSessionRecord?.surface } : {},
406
404
  ...args.loadedSkillNames ? { loadedSkillNames: args.loadedSkillNames } : {},
407
- ...args.modelId ?? latestSessionRecord?.modelId ? { modelId: args.modelId ?? latestSessionRecord?.modelId } : {},
405
+ modelId: args.modelId,
408
406
  ...args.reasoningLevel ?? latestSessionRecord?.reasoningLevel ? {
409
407
  reasoningLevel: args.reasoningLevel ?? latestSessionRecord?.reasoningLevel
410
408
  } : {},
@@ -460,7 +458,7 @@ async function persistYieldSessionRecord(args) {
460
458
  piMessages,
461
459
  ...args.surface ?? latestSessionRecord?.surface ? { surface: args.surface ?? latestSessionRecord?.surface } : {},
462
460
  ...args.loadedSkillNames ? { loadedSkillNames: args.loadedSkillNames } : {},
463
- ...args.modelId ?? latestSessionRecord?.modelId ? { modelId: args.modelId ?? latestSessionRecord?.modelId } : {},
461
+ modelId: args.modelId,
464
462
  ...args.reasoningLevel ?? latestSessionRecord?.reasoningLevel ? {
465
463
  reasoningLevel: args.reasoningLevel ?? latestSessionRecord?.reasoningLevel
466
464
  } : {},