@sentry/junior 0.118.0 → 0.120.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 (56) hide show
  1. package/dist/{agent-hooks-J2FB7XD6.js → agent-hooks-5DDPWRYO.js} +8 -8
  2. package/dist/api/conversations/detail.d.ts +17 -0
  3. package/dist/api/conversations/event-list.d.ts +17 -0
  4. package/dist/api/schema/conversation.d.ts +68 -0
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +103 -82
  7. package/dist/app.js +24 -24
  8. package/dist/build/copy-build-content.d.ts +2 -2
  9. package/dist/{catalog-runtime-UHHLU53I.js → catalog-runtime-5KR5XBMJ.js} +7 -7
  10. package/dist/chat/discovery.d.ts +2 -0
  11. package/dist/chat/mcp/tool-manager.d.ts +14 -1
  12. package/dist/chat/plugins/types.d.ts +3 -9
  13. package/dist/chat/plugins/user-pages.d.ts +2 -1
  14. package/dist/chat/slack/tools/canvas/api.d.ts +2 -9
  15. package/dist/chat/slack/tools/canvas/markdown.d.ts +9 -0
  16. package/dist/{chunk-GT2ZUALJ.js → chunk-24B5R6OU.js} +92 -6
  17. package/dist/{chunk-L72GDKSN.js → chunk-6WX5SPI3.js} +1 -1
  18. package/dist/{chunk-3N3FMCKN.js → chunk-ALAKN7LR.js} +1 -1
  19. package/dist/{chunk-MLZFK4KP.js → chunk-ALYQOZG7.js} +1 -1
  20. package/dist/{chunk-6BGUAOYP.js → chunk-BHXW734F.js} +13 -7
  21. package/dist/{chunk-4LPPH7Y6.js → chunk-DJDGDJDF.js} +4 -4
  22. package/dist/{chunk-HWUBBHLK.js → chunk-DMKHRBI6.js} +4 -3
  23. package/dist/{chunk-QWCF4RAC.js → chunk-DWOH57FW.js} +1 -1
  24. package/dist/{chunk-7GADTCNS.js → chunk-EIVE6GL4.js} +3 -3
  25. package/dist/{chunk-6K2QE2UI.js → chunk-ERYVNWNE.js} +250 -37
  26. package/dist/{chunk-UXLYAVYL.js → chunk-GNNV3UTY.js} +1 -1
  27. package/dist/chunk-H4HBKISO.js +417 -0
  28. package/dist/{chunk-FXOYURO4.js → chunk-HDFGNU5E.js} +1 -0
  29. package/dist/{chunk-PJPKHGLG.js → chunk-JQWP6V22.js} +4 -11
  30. package/dist/{chunk-KC5EE27Y.js → chunk-M243JMZH.js} +2 -2
  31. package/dist/{chunk-7SM3P4XR.js → chunk-O2ULQJWR.js} +82 -1
  32. package/dist/{chunk-B3IT5END.js → chunk-OOUNJNMR.js} +16 -152
  33. package/dist/{chunk-HN6LFYG3.js → chunk-Q3RL6A4E.js} +2 -2
  34. package/dist/{chunk-3MUSSFMP.js → chunk-QOQPPRFS.js} +221 -14
  35. package/dist/{chunk-S6R23MFB.js → chunk-TKUCRFNX.js} +12 -225
  36. package/dist/{chunk-PWRFTDTY.js → chunk-VURFJVFH.js} +2 -2
  37. package/dist/{chunk-3LGCVRBQ.js → chunk-XAI2HNAY.js} +9 -5
  38. package/dist/{chunk-4SOQPUF4.js → chunk-YEAOUT5W.js} +1 -1
  39. package/dist/cli/chat.js +24 -24
  40. package/dist/cli/check.js +8 -8
  41. package/dist/cli/init.js +2 -2
  42. package/dist/cli/plugins.js +13 -13
  43. package/dist/cli/snapshot-create.js +11 -11
  44. package/dist/cli/upgrade.js +8 -8
  45. package/dist/{db-PMRHFSYL.js → db-T4ZY64PB.js} +6 -6
  46. package/dist/{discovery-RMHYSRL7.js → discovery-GUFTFBTL.js} +3 -1
  47. package/dist/instrumentation.js +3 -3
  48. package/dist/nitro.js +24 -7
  49. package/dist/{oauth-callback-server-QJUC7S4X.js → oauth-callback-server-LQ6DFI26.js} +17 -17
  50. package/dist/{runner-PZMV6JQW.js → runner-D3ZU6TJH.js} +10 -10
  51. package/dist/{skills-W4JETYSV.js → skills-JMXY7LIY.js} +8 -8
  52. package/dist/{validation-IJLNHZSU.js → validation-OEPJS7JX.js} +8 -8
  53. package/dist/version.js +1 -1
  54. package/package.json +8 -7
  55. package/skills/jr-rpc/SKILL.md +40 -0
  56. package/dist/chunk-3V7OFJZC.js +0 -264
@@ -11,20 +11,20 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-GT2ZUALJ.js";
15
- import "./chunk-KC5EE27Y.js";
14
+ } from "./chunk-24B5R6OU.js";
15
+ import "./chunk-M243JMZH.js";
16
16
  import "./chunk-GCGJGSQL.js";
17
- import "./chunk-3N3FMCKN.js";
18
- import "./chunk-PWRFTDTY.js";
17
+ import "./chunk-ALAKN7LR.js";
18
+ import "./chunk-VURFJVFH.js";
19
19
  import "./chunk-VFUK3X5B.js";
20
- import "./chunk-FXOYURO4.js";
20
+ import "./chunk-HDFGNU5E.js";
21
21
  import "./chunk-HZF5P5UN.js";
22
- import "./chunk-MLZFK4KP.js";
22
+ import "./chunk-ALYQOZG7.js";
23
23
  import "./chunk-OB42YVAE.js";
24
24
  import "./chunk-F3B2YJ76.js";
25
25
  import "./chunk-6GWA276C.js";
26
- import "./chunk-QWCF4RAC.js";
27
- import "./chunk-HWUBBHLK.js";
26
+ import "./chunk-DWOH57FW.js";
27
+ import "./chunk-DMKHRBI6.js";
28
28
  import "./chunk-MLKGABMK.js";
29
29
  export {
30
30
  PluginHookDeniedError,
@@ -105,6 +105,13 @@ declare const _default: import("../route").ApiRoute<import("zod").ZodObject<{
105
105
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
106
106
  type: import("zod").ZodLiteral<"message_handled">;
107
107
  messageId: import("zod").ZodString;
108
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
109
+ type: import("zod").ZodLiteral<"assistant_message">;
110
+ parts: import("zod").ZodArray<import("zod").ZodObject<{
111
+ type: import("zod").ZodLiteral<"reasoning">;
112
+ text: import("zod").ZodOptional<import("zod").ZodString>;
113
+ redacted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
114
+ }, import("zod/v4/core").$strict>>;
108
115
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
109
116
  type: import("zod").ZodLiteral<"tool_calls">;
110
117
  calls: import("zod").ZodArray<import("zod").ZodObject<{
@@ -120,6 +127,16 @@ declare const _default: import("../route").ApiRoute<import("zod").ZodObject<{
120
127
  input: import("zod").ZodOptional<import("zod").ZodUnknown>;
121
128
  output: import("zod").ZodOptional<import("zod").ZodUnknown>;
122
129
  }, import("zod/v4/core").$strict>>;
130
+ assistant: import("zod").ZodOptional<import("zod").ZodObject<{
131
+ parts: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
132
+ type: import("zod").ZodLiteral<"reasoning">;
133
+ text: import("zod").ZodOptional<import("zod").ZodString>;
134
+ redacted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
135
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
136
+ type: import("zod").ZodLiteral<"tool_call">;
137
+ toolCallId: import("zod").ZodString;
138
+ }, import("zod/v4/core").$strict>], "type">>;
139
+ }, import("zod/v4/core").$strict>>;
123
140
  }, import("zod/v4/core").$strict>, import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
124
141
  type: import("zod").ZodLiteral<"turn_lifecycle">;
125
142
  turnId: import("zod").ZodString;
@@ -22,6 +22,13 @@ declare const _default: import("../route").ApiRoute<import("zod").ZodObject<{
22
22
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
23
23
  type: import("zod").ZodLiteral<"message_handled">;
24
24
  messageId: import("zod").ZodString;
25
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
26
+ type: import("zod").ZodLiteral<"assistant_message">;
27
+ parts: import("zod").ZodArray<import("zod").ZodObject<{
28
+ type: import("zod").ZodLiteral<"reasoning">;
29
+ text: import("zod").ZodOptional<import("zod").ZodString>;
30
+ redacted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
31
+ }, import("zod/v4/core").$strict>>;
25
32
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
26
33
  type: import("zod").ZodLiteral<"tool_calls">;
27
34
  calls: import("zod").ZodArray<import("zod").ZodObject<{
@@ -37,6 +44,16 @@ declare const _default: import("../route").ApiRoute<import("zod").ZodObject<{
37
44
  input: import("zod").ZodOptional<import("zod").ZodUnknown>;
38
45
  output: import("zod").ZodOptional<import("zod").ZodUnknown>;
39
46
  }, import("zod/v4/core").$strict>>;
47
+ assistant: import("zod").ZodOptional<import("zod").ZodObject<{
48
+ parts: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
49
+ type: import("zod").ZodLiteral<"reasoning">;
50
+ text: import("zod").ZodOptional<import("zod").ZodString>;
51
+ redacted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
52
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
53
+ type: import("zod").ZodLiteral<"tool_call">;
54
+ toolCallId: import("zod").ZodString;
55
+ }, import("zod/v4/core").$strict>], "type">>;
56
+ }, import("zod/v4/core").$strict>>;
40
57
  }, import("zod/v4/core").$strict>, import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
41
58
  type: import("zod").ZodLiteral<"turn_lifecycle">;
42
59
  turnId: import("zod").ZodString;
@@ -121,6 +121,13 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
121
121
  }, z.core.$strict>, z.ZodObject<{
122
122
  type: z.ZodLiteral<"message_handled">;
123
123
  messageId: z.ZodString;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ type: z.ZodLiteral<"assistant_message">;
126
+ parts: z.ZodArray<z.ZodObject<{
127
+ type: z.ZodLiteral<"reasoning">;
128
+ text: z.ZodOptional<z.ZodString>;
129
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
130
+ }, z.core.$strict>>;
124
131
  }, z.core.$strict>, z.ZodObject<{
125
132
  type: z.ZodLiteral<"tool_calls">;
126
133
  calls: z.ZodArray<z.ZodObject<{
@@ -136,6 +143,16 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
136
143
  input: z.ZodOptional<z.ZodUnknown>;
137
144
  output: z.ZodOptional<z.ZodUnknown>;
138
145
  }, z.core.$strict>>;
146
+ assistant: z.ZodOptional<z.ZodObject<{
147
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
148
+ type: z.ZodLiteral<"reasoning">;
149
+ text: z.ZodOptional<z.ZodString>;
150
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ type: z.ZodLiteral<"tool_call">;
153
+ toolCallId: z.ZodString;
154
+ }, z.core.$strict>], "type">>;
155
+ }, z.core.$strict>>;
139
156
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
140
157
  type: z.ZodLiteral<"turn_lifecycle">;
141
158
  turnId: z.ZodString;
@@ -225,6 +242,13 @@ export declare const conversationReportEventSchema: z.ZodObject<{
225
242
  }, z.core.$strict>, z.ZodObject<{
226
243
  type: z.ZodLiteral<"message_handled">;
227
244
  messageId: z.ZodString;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ type: z.ZodLiteral<"assistant_message">;
247
+ parts: z.ZodArray<z.ZodObject<{
248
+ type: z.ZodLiteral<"reasoning">;
249
+ text: z.ZodOptional<z.ZodString>;
250
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
251
+ }, z.core.$strict>>;
228
252
  }, z.core.$strict>, z.ZodObject<{
229
253
  type: z.ZodLiteral<"tool_calls">;
230
254
  calls: z.ZodArray<z.ZodObject<{
@@ -240,6 +264,16 @@ export declare const conversationReportEventSchema: z.ZodObject<{
240
264
  input: z.ZodOptional<z.ZodUnknown>;
241
265
  output: z.ZodOptional<z.ZodUnknown>;
242
266
  }, z.core.$strict>>;
267
+ assistant: z.ZodOptional<z.ZodObject<{
268
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
269
+ type: z.ZodLiteral<"reasoning">;
270
+ text: z.ZodOptional<z.ZodString>;
271
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
272
+ }, z.core.$strict>, z.ZodObject<{
273
+ type: z.ZodLiteral<"tool_call">;
274
+ toolCallId: z.ZodString;
275
+ }, z.core.$strict>], "type">>;
276
+ }, z.core.$strict>>;
243
277
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
244
278
  type: z.ZodLiteral<"turn_lifecycle">;
245
279
  turnId: z.ZodString;
@@ -440,6 +474,13 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
440
474
  }, z.core.$strict>, z.ZodObject<{
441
475
  type: z.ZodLiteral<"message_handled">;
442
476
  messageId: z.ZodString;
477
+ }, z.core.$strict>, z.ZodObject<{
478
+ type: z.ZodLiteral<"assistant_message">;
479
+ parts: z.ZodArray<z.ZodObject<{
480
+ type: z.ZodLiteral<"reasoning">;
481
+ text: z.ZodOptional<z.ZodString>;
482
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
483
+ }, z.core.$strict>>;
443
484
  }, z.core.$strict>, z.ZodObject<{
444
485
  type: z.ZodLiteral<"tool_calls">;
445
486
  calls: z.ZodArray<z.ZodObject<{
@@ -455,6 +496,16 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
455
496
  input: z.ZodOptional<z.ZodUnknown>;
456
497
  output: z.ZodOptional<z.ZodUnknown>;
457
498
  }, z.core.$strict>>;
499
+ assistant: z.ZodOptional<z.ZodObject<{
500
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
501
+ type: z.ZodLiteral<"reasoning">;
502
+ text: z.ZodOptional<z.ZodString>;
503
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
504
+ }, z.core.$strict>, z.ZodObject<{
505
+ type: z.ZodLiteral<"tool_call">;
506
+ toolCallId: z.ZodString;
507
+ }, z.core.$strict>], "type">>;
508
+ }, z.core.$strict>>;
458
509
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
459
510
  type: z.ZodLiteral<"turn_lifecycle">;
460
511
  turnId: z.ZodString;
@@ -558,6 +609,13 @@ export declare const conversationEventPageSchema: z.ZodObject<{
558
609
  }, z.core.$strict>, z.ZodObject<{
559
610
  type: z.ZodLiteral<"message_handled">;
560
611
  messageId: z.ZodString;
612
+ }, z.core.$strict>, z.ZodObject<{
613
+ type: z.ZodLiteral<"assistant_message">;
614
+ parts: z.ZodArray<z.ZodObject<{
615
+ type: z.ZodLiteral<"reasoning">;
616
+ text: z.ZodOptional<z.ZodString>;
617
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
618
+ }, z.core.$strict>>;
561
619
  }, z.core.$strict>, z.ZodObject<{
562
620
  type: z.ZodLiteral<"tool_calls">;
563
621
  calls: z.ZodArray<z.ZodObject<{
@@ -573,6 +631,16 @@ export declare const conversationEventPageSchema: z.ZodObject<{
573
631
  input: z.ZodOptional<z.ZodUnknown>;
574
632
  output: z.ZodOptional<z.ZodUnknown>;
575
633
  }, z.core.$strict>>;
634
+ assistant: z.ZodOptional<z.ZodObject<{
635
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
636
+ type: z.ZodLiteral<"reasoning">;
637
+ text: z.ZodOptional<z.ZodString>;
638
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
639
+ }, z.core.$strict>, z.ZodObject<{
640
+ type: z.ZodLiteral<"tool_call">;
641
+ toolCallId: z.ZodString;
642
+ }, z.core.$strict>], "type">>;
643
+ }, z.core.$strict>>;
576
644
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
577
645
  type: z.ZodLiteral<"turn_lifecycle">;
578
646
  turnId: z.ZodString;
@@ -30,7 +30,7 @@ import {
30
30
  revokePersonalTokenResponseSchema,
31
31
  statSchema,
32
32
  statsReportSchema
33
- } from "../chunk-7SM3P4XR.js";
33
+ } from "../chunk-O2ULQJWR.js";
34
34
  import {
35
35
  healthReportSchema,
36
36
  pluginOperationalReportFeedSchema,
package/dist/api.js CHANGED
@@ -24,12 +24,12 @@ import {
24
24
  personalTokenParamsSchema,
25
25
  revokePersonalTokenResponseSchema,
26
26
  statsReportSchema
27
- } from "./chunk-7SM3P4XR.js";
27
+ } from "./chunk-O2ULQJWR.js";
28
28
  import {
29
29
  formatSlackConversationRedactedLabel,
30
30
  readHealthReport,
31
31
  resolveSlackConversationContextFromThreadId
32
- } from "./chunk-HN6LFYG3.js";
32
+ } from "./chunk-Q3RL6A4E.js";
33
33
  import {
34
34
  buildSentryConversationUrl
35
35
  } from "./chunk-4CODA7P5.js";
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-PE44LDDQ.js";
43
43
  import {
44
44
  readStats
45
- } from "./chunk-L72GDKSN.js";
45
+ } from "./chunk-6WX5SPI3.js";
46
46
  import {
47
47
  agentTurnUsageSchema,
48
48
  hasAgentTurnUsage
@@ -51,13 +51,14 @@ import "./chunk-PDO5BLNM.js";
51
51
  import {
52
52
  createPluginLogger,
53
53
  getPlugins,
54
- listConversationAnnotations
55
- } from "./chunk-GT2ZUALJ.js";
54
+ listConversationAnnotations,
55
+ readViewerActors
56
+ } from "./chunk-24B5R6OU.js";
56
57
  import {
57
58
  decodeStoredConversationEvent,
58
59
  getDb,
59
60
  getSqlExecutor
60
- } from "./chunk-KC5EE27Y.js";
61
+ } from "./chunk-M243JMZH.js";
61
62
  import {
62
63
  juniorApiTokens,
63
64
  juniorConversationEvents,
@@ -65,24 +66,22 @@ import {
65
66
  juniorIdentities,
66
67
  juniorUsers
67
68
  } from "./chunk-GCGJGSQL.js";
68
- import "./chunk-3N3FMCKN.js";
69
- import "./chunk-PWRFTDTY.js";
69
+ import "./chunk-ALAKN7LR.js";
70
+ import "./chunk-VURFJVFH.js";
70
71
  import {
71
72
  juniorDestinations
72
73
  } from "./chunk-VFUK3X5B.js";
73
74
  import {
74
75
  canExposeConversationPayload,
75
76
  parseSlackThreadId
76
- } from "./chunk-FXOYURO4.js";
77
+ } from "./chunk-HDFGNU5E.js";
77
78
  import "./chunk-HZF5P5UN.js";
78
- import {
79
- normalizeIdentityEmail
80
- } from "./chunk-MLZFK4KP.js";
79
+ import "./chunk-ALYQOZG7.js";
81
80
  import "./chunk-OB42YVAE.js";
82
81
  import "./chunk-F3B2YJ76.js";
83
82
  import "./chunk-6GWA276C.js";
84
- import "./chunk-QWCF4RAC.js";
85
- import "./chunk-HWUBBHLK.js";
83
+ import "./chunk-DWOH57FW.js";
84
+ import "./chunk-DMKHRBI6.js";
86
85
  import "./chunk-MLKGABMK.js";
87
86
 
88
87
  // src/api.ts
@@ -395,6 +394,11 @@ var reportingToolResultDetailsSchema = z2.object({
395
394
  status: z2.string().optional()
396
395
  }).passthrough();
397
396
  var reportingTextPartSchema = z2.object({ type: z2.literal("text"), text: z2.string() }).passthrough();
397
+ var reportingReasoningPartSchema = z2.object({
398
+ type: z2.literal("thinking"),
399
+ thinking: z2.string(),
400
+ redacted: z2.literal(true).optional()
401
+ }).passthrough();
398
402
  var reportingMediaPartSchema = z2.object({
399
403
  type: z2.enum(["image", "audio"]),
400
404
  mimeType: z2.string().min(1).optional()
@@ -435,6 +439,43 @@ function reportToolCalls(args) {
435
439
  });
436
440
  return calls.length > 0 ? { type: "tool_calls", calls } : void 0;
437
441
  }
442
+ function reportAssistantMessage(args) {
443
+ const message2 = reportingAssistantMessageSchema.safeParse(args.message);
444
+ if (!message2.success) return void 0;
445
+ const hasReasoning = message2.data.content.some((part) => {
446
+ const reasoning = reportingReasoningPartSchema.safeParse(part);
447
+ return reasoning.success && reasoning.data.redacted !== true && reasoning.data.thinking.trim().length > 0;
448
+ });
449
+ if (!hasReasoning) return reportToolCalls(args);
450
+ const reasoningParts = [];
451
+ const assistantParts = [];
452
+ for (const part of message2.data.content) {
453
+ const reasoning = reportingReasoningPartSchema.safeParse(part);
454
+ if (reasoning.success) {
455
+ if (reasoning.data.redacted !== true && reasoning.data.thinking.trim().length > 0) {
456
+ const projected = {
457
+ type: "reasoning",
458
+ ...args.canExposePayload ? { text: reasoning.data.thinking } : { redacted: true }
459
+ };
460
+ reasoningParts.push(projected);
461
+ assistantParts.push(projected);
462
+ }
463
+ continue;
464
+ }
465
+ const call = reportingToolCallPartSchema.safeParse(part);
466
+ if (call.success) {
467
+ assistantParts.push({
468
+ type: "tool_call",
469
+ toolCallId: call.data.id
470
+ });
471
+ }
472
+ }
473
+ const toolCalls = reportToolCalls(args);
474
+ if (toolCalls?.type === "tool_calls") {
475
+ return { ...toolCalls, assistant: { parts: assistantParts } };
476
+ }
477
+ return reasoningParts.length > 0 ? { type: "assistant_message", parts: reasoningParts } : void 0;
478
+ }
438
479
  function reportToolResult(args) {
439
480
  const message2 = reportingToolResultMessageSchema.safeParse(args.message);
440
481
  if (!message2.success) return void 0;
@@ -576,7 +617,7 @@ function projectConversationReportEventPage(args) {
576
617
  };
577
618
  const result = reportingToolResultMessageSchema.safeParse(event.data);
578
619
  const start = result.success ? toolStarts.get(result.data.toolCallId) : void 0;
579
- data = reportToolCalls(reportArgs) ?? reportToolResult({
620
+ data = reportAssistantMessage(reportArgs) ?? reportToolResult({
580
621
  canExposePayload: args.canExposePayload,
581
622
  message: event.data,
582
623
  ...start && start.seq < event.seq ? { start } : {}
@@ -1699,7 +1740,7 @@ function readDescriptionText(home) {
1699
1740
  }
1700
1741
  }
1701
1742
  async function readSkillReports() {
1702
- const { discoverSkills } = await import("./skills-W4JETYSV.js");
1743
+ const { discoverSkills } = await import("./skills-JMXY7LIY.js");
1703
1744
  const skills = await discoverSkills();
1704
1745
  return skillReportsSchema.parse(
1705
1746
  skills.map((skill) => ({
@@ -1709,7 +1750,7 @@ async function readSkillReports() {
1709
1750
  );
1710
1751
  }
1711
1752
  async function readPlugins() {
1712
- const { pluginCatalogRuntime } = await import("./catalog-runtime-UHHLU53I.js");
1753
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-5KR5XBMJ.js");
1713
1754
  return pluginsSchema.parse(
1714
1755
  pluginCatalogRuntime.getProviders().map((plugin) => ({
1715
1756
  configKeys: plugin.manifest.configKeys ?? [],
@@ -1721,8 +1762,8 @@ async function readPlugins() {
1721
1762
  }
1722
1763
  async function readRuntimeInfoReport() {
1723
1764
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
1724
- import("./discovery-RMHYSRL7.js"),
1725
- import("./catalog-runtime-UHHLU53I.js"),
1765
+ import("./discovery-GUFTFBTL.js"),
1766
+ import("./catalog-runtime-5KR5XBMJ.js"),
1726
1767
  readPlugins(),
1727
1768
  readSkillReports()
1728
1769
  ]);
@@ -1738,7 +1779,7 @@ async function readRuntimeInfoReport() {
1738
1779
  }
1739
1780
  async function readPluginOperationalReportFeed() {
1740
1781
  const nowMs = Date.now();
1741
- const { getPluginOperationalReports } = await import("./agent-hooks-J2FB7XD6.js");
1782
+ const { getPluginOperationalReports } = await import("./agent-hooks-5DDPWRYO.js");
1742
1783
  return pluginOperationalReportFeedSchema.parse({
1743
1784
  source: "plugins",
1744
1785
  generatedAt: new Date(nowMs).toISOString(),
@@ -2812,6 +2853,7 @@ function createPersonalTokenRoutes() {
2812
2853
  import { Hono as Hono5 } from "hono";
2813
2854
  import {
2814
2855
  pluginUserPageContentSchema as pluginUserPageContentSchema2,
2856
+ pluginUserPageInputSchema,
2815
2857
  pluginUserPageLinksSchema as pluginUserPageLinksSchema2
2816
2858
  } from "@sentry/junior-plugin-api";
2817
2859
 
@@ -2820,57 +2862,6 @@ import {
2820
2862
  pluginUserPageContentSchema,
2821
2863
  pluginUserPageLinksSchema
2822
2864
  } from "@sentry/junior-plugin-api";
2823
-
2824
- // src/chat/plugins/viewer-actors.ts
2825
- import { and as and12, eq as eq13 } from "drizzle-orm";
2826
- import {
2827
- actorSchema
2828
- } from "@sentry/junior-plugin-api";
2829
- async function readViewerActorsFromSql(db, email) {
2830
- const normalizedEmail = normalizeIdentityEmail(email);
2831
- if (!normalizedEmail) return [];
2832
- const rows = await db.select({
2833
- displayName: juniorIdentities.displayName,
2834
- email: juniorUsers.primaryEmail,
2835
- handle: juniorIdentities.handle,
2836
- provider: juniorIdentities.provider,
2837
- providerSubjectId: juniorIdentities.providerSubjectId,
2838
- providerTenantId: juniorIdentities.providerTenantId
2839
- }).from(juniorIdentities).innerJoin(juniorUsers, eq13(juniorUsers.id, juniorIdentities.userId)).where(
2840
- and12(
2841
- eq13(juniorUsers.primaryEmailNormalized, normalizedEmail),
2842
- eq13(juniorIdentities.kind, "user")
2843
- )
2844
- );
2845
- const actors = [];
2846
- for (const row of rows) {
2847
- const candidate = row.provider === "slack" ? {
2848
- platform: "slack",
2849
- teamId: row.providerTenantId,
2850
- userId: row.providerSubjectId,
2851
- email: row.email,
2852
- ...row.displayName ? { fullName: row.displayName } : {},
2853
- ...row.handle ? { userName: row.handle } : {}
2854
- } : row.provider === "local" ? {
2855
- platform: "local",
2856
- userId: row.providerSubjectId,
2857
- email: row.email,
2858
- ...row.displayName ? { fullName: row.displayName } : {},
2859
- ...row.handle ? { userName: row.handle } : {}
2860
- } : void 0;
2861
- if (!candidate) continue;
2862
- const parsed = actorSchema.safeParse(candidate);
2863
- if (parsed.success && parsed.data.platform !== "system") {
2864
- actors.push(parsed.data);
2865
- }
2866
- }
2867
- return actors;
2868
- }
2869
- async function readViewerActors(email) {
2870
- return await readViewerActorsFromSql(getDb(), email);
2871
- }
2872
-
2873
- // src/chat/plugins/user-pages.ts
2874
2865
  function readPluginUserPageLinks() {
2875
2866
  return pluginUserPageLinksSchema.parse(
2876
2867
  getPlugins().flatMap(
@@ -2884,6 +2875,10 @@ function readPluginUserPageLinks() {
2884
2875
  )
2885
2876
  );
2886
2877
  }
2878
+ function actionBelongsToPlugin(href, pluginName) {
2879
+ const parsed = new URL(href, "http://junior.local");
2880
+ return parsed.origin === "http://junior.local" && parsed.pathname === href && parsed.pathname.startsWith(`/api/plugins/${pluginName}/`) && !parsed.search && !parsed.hash;
2881
+ }
2887
2882
  async function readPluginUserPage(input) {
2888
2883
  const plugin = getPlugins().find(
2889
2884
  (candidate) => candidate.manifest.name === input.pluginName
@@ -2892,17 +2887,30 @@ async function readPluginUserPage(input) {
2892
2887
  (candidate) => candidate.id === input.pageId
2893
2888
  );
2894
2889
  if (!plugin || !page) return void 0;
2895
- return pluginUserPageContentSchema.parse(
2896
- await page.read({
2897
- db: getDb(),
2898
- log: createPluginLogger(plugin.manifest.name),
2899
- plugin: { name: plugin.manifest.name },
2900
- viewer: {
2901
- actors: await readViewerActors(input.email),
2902
- email: input.email
2903
- }
2904
- })
2890
+ const content = pluginUserPageContentSchema.parse(
2891
+ await page.read(
2892
+ {
2893
+ db: getDb(),
2894
+ log: createPluginLogger(plugin.manifest.name),
2895
+ plugin: { name: plugin.manifest.name },
2896
+ viewer: {
2897
+ actors: await readViewerActors(input.email),
2898
+ email: input.email
2899
+ }
2900
+ },
2901
+ input.query
2902
+ )
2905
2903
  );
2904
+ if (content.records.some(
2905
+ (record) => record.actions?.some(
2906
+ (action) => !actionBelongsToPlugin(action.href, plugin.manifest.name)
2907
+ )
2908
+ )) {
2909
+ throw new Error(
2910
+ `Plugin user page "${plugin.manifest.name}/${page.id}" returned an action outside its API namespace.`
2911
+ );
2912
+ }
2913
+ return content;
2906
2914
  }
2907
2915
 
2908
2916
  // src/api/user-pages/routes.ts
@@ -2921,10 +2929,23 @@ function createUserPageRoutes() {
2921
2929
  { status: 401 }
2922
2930
  );
2923
2931
  }
2932
+ const pageInput = pluginUserPageInputSchema.safeParse({
2933
+ cursor: context.req.query("cursor") || void 0,
2934
+ limit: context.req.query("limit") ? Number(context.req.query("limit")) : 20,
2935
+ query: context.req.query("q") || void 0
2936
+ });
2937
+ if (!pageInput.success) {
2938
+ return jsonResponse(
2939
+ apiErrorSchema,
2940
+ { error: "Invalid user page query." },
2941
+ { status: 400 }
2942
+ );
2943
+ }
2924
2944
  const page = await readPluginUserPage({
2925
2945
  email,
2926
2946
  pageId: context.req.param("pageId"),
2927
- pluginName: context.req.param("pluginName")
2947
+ pluginName: context.req.param("pluginName"),
2948
+ query: pageInput.data
2928
2949
  });
2929
2950
  return page ? jsonResponse(pluginUserPageContentSchema2, page) : jsonResponse(
2930
2951
  apiErrorSchema,