@sentry/junior 0.150.1 → 0.152.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 (77) hide show
  1. package/dist/{agent-hooks-G4LEACQB.js → agent-hooks-U66Q3X2P.js} +10 -10
  2. package/dist/api/schema/conversation.d.ts +35 -4
  3. package/dist/api/schema.d.ts +1 -1
  4. package/dist/api/schema.js +3 -1
  5. package/dist/api.js +81 -38
  6. package/dist/app.js +129 -206
  7. package/dist/{catalog-runtime-ZRSNE2MH.js → catalog-runtime-CVCR7SND.js} +5 -5
  8. package/dist/chat/agent/skills.d.ts +5 -4
  9. package/dist/chat/agent/tools.d.ts +5 -5
  10. package/dist/chat/api-turns/authorization.d.ts +23 -0
  11. package/dist/chat/conversations/history.d.ts +12 -3
  12. package/dist/chat/conversations/projection.d.ts +7 -3
  13. package/dist/chat/mcp/tool-manager.d.ts +0 -4
  14. package/dist/chat/runtime/agent-run-outcome.d.ts +4 -0
  15. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  16. package/dist/chat/tools/skill/call-mcp-tool.d.ts +0 -1
  17. package/dist/chat/tools/skill/load-skill.d.ts +2 -5
  18. package/dist/chat/tools/types.d.ts +1 -2
  19. package/dist/{chunk-2AWDPNP7.js → chunk-3PCKG4BT.js} +16 -10
  20. package/dist/{chunk-2Z7YX5PI.js → chunk-3UJ3QYRV.js} +156 -19
  21. package/dist/{chunk-IQW6RFXG.js → chunk-5LDOQV7Y.js} +72 -218
  22. package/dist/{chunk-JBYWR6FW.js → chunk-67VR4BJK.js} +5 -5
  23. package/dist/{chunk-5NOHC2Z4.js → chunk-732P2RBQ.js} +1 -1
  24. package/dist/{chunk-3WIFZBJL.js → chunk-7TZM33YX.js} +1 -1
  25. package/dist/{chunk-JVOLC6JZ.js → chunk-AYPU5T5L.js} +4 -4
  26. package/dist/{chunk-TZRYLW3R.js → chunk-CLX3T7Q3.js} +1 -1
  27. package/dist/{chunk-JUBPTYNO.js → chunk-ELAVLP7Z.js} +1 -1
  28. package/dist/{chunk-LSI3EKZQ.js → chunk-ETXLHT3S.js} +4 -4
  29. package/dist/{chunk-N6QJAPZS.js → chunk-I4LR7MS2.js} +45 -11
  30. package/dist/{chunk-6ZYGORV4.js → chunk-KC47ZY6Q.js} +2 -2
  31. package/dist/{chunk-6A24WEKX.js → chunk-KC5XZBRB.js} +4 -4
  32. package/dist/{chunk-D2PVJU5E.js → chunk-KTYC3GDO.js} +3 -3
  33. package/dist/{chunk-AD6N2KNE.js → chunk-KW2MGCW5.js} +5 -5
  34. package/dist/{chunk-QO3OSJDS.js → chunk-LETPYIDF.js} +1 -1
  35. package/dist/{chunk-6IWDFUXW.js → chunk-M6PWM3OK.js} +1 -1
  36. package/dist/{chunk-LWFHRWJI.js → chunk-N2472SQK.js} +8 -8
  37. package/dist/{chunk-QNSV46AW.js → chunk-NF733C66.js} +6 -6
  38. package/dist/{chunk-FGP5W3NS.js → chunk-OEECXAGT.js} +2 -2
  39. package/dist/{chunk-SZ74ECCC.js → chunk-QKPIW2CY.js} +6 -6
  40. package/dist/{chunk-4JV7GUUH.js → chunk-RCBAXKMB.js} +1 -1
  41. package/dist/{chunk-QZGYKKH6.js → chunk-SDMVFTH4.js} +173 -70
  42. package/dist/chunk-SFYDSI34.js +89 -0
  43. package/dist/{chunk-W3FQZAX5.js → chunk-TSQMITMQ.js} +6 -6
  44. package/dist/{chunk-IZE2EGCX.js → chunk-UFKSILED.js} +5 -5
  45. package/dist/{chunk-3JVUWLR7.js → chunk-UG5UCHHJ.js} +15 -1
  46. package/dist/{chunk-OWLJZ6I7.js → chunk-VD6CRYCT.js} +1 -1
  47. package/dist/{chunk-2DIRU2C2.js → chunk-WZN4RQ64.js} +1 -1
  48. package/dist/{chunk-KFHJQYKQ.js → chunk-X4RM4TBW.js} +1 -1
  49. package/dist/{chunk-B2YA2G26.js → chunk-X6JP6AMX.js} +1 -1
  50. package/dist/{chunk-GZ25ZSTX.js → chunk-XTLF7C4I.js} +11 -4
  51. package/dist/{chunk-R53UTQ2Q.js → chunk-Z5WLTGME.js} +1 -1
  52. package/dist/cli/chat.js +30 -30
  53. package/dist/cli/check.js +6 -6
  54. package/dist/cli/plugins.js +13 -13
  55. package/dist/cli/snapshot-create.js +9 -9
  56. package/dist/cli/upgrade.js +7 -7
  57. package/dist/{db-WRA5ZHYE.js → db-HQAZQASY.js} +7 -7
  58. package/dist/handlers/mcp-oauth-callback.d.ts +3 -0
  59. package/dist/handlers/oauth-callback.d.ts +3 -0
  60. package/dist/instrumentation.js +4 -4
  61. package/dist/nitro.js +2 -2
  62. package/dist/{oauth-callback-server-QWAYG3MI.js → oauth-callback-server-OJONZ7T3.js} +23 -24
  63. package/dist/{runner-5JQ54J6P.js → runner-BIJAVQDX.js} +14 -16
  64. package/dist/{skills-3YD55WPO.js → skills-SIPNY4AT.js} +6 -6
  65. package/dist/spawn-ABDIBQT6.js +38 -0
  66. package/dist/{validation-ZXE3IRSB.js → validation-KRPOY5RQ.js} +6 -6
  67. package/dist/version.js +1 -1
  68. package/dist/{work-7G2U64WI.js → work-KS3JOEI2.js} +17 -17
  69. package/dist/{worker-HJM2FZNI.js → worker-CZ5KNZUI.js} +11 -11
  70. package/migrations/0025_mcp_credential_subject.sql +8 -0
  71. package/migrations/meta/0025_snapshot.json +2275 -0
  72. package/migrations/meta/_journal.json +7 -0
  73. package/package.json +5 -5
  74. package/dist/chat/pi/derived-state.d.ts +0 -5
  75. package/dist/chunk-4CODA7P5.js +0 -43
  76. package/dist/chunk-XED3H34M.js +0 -48
  77. package/dist/spawn-OOO26XDL.js +0 -38
@@ -11,21 +11,21 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-QNSV46AW.js";
15
- import "./chunk-D2PVJU5E.js";
16
- import "./chunk-GZ25ZSTX.js";
17
- import "./chunk-KFHJQYKQ.js";
14
+ } from "./chunk-NF733C66.js";
15
+ import "./chunk-KTYC3GDO.js";
16
+ import "./chunk-XTLF7C4I.js";
17
+ import "./chunk-X4RM4TBW.js";
18
18
  import "./chunk-EM225ITJ.js";
19
- import "./chunk-B2YA2G26.js";
20
- import "./chunk-FGP5W3NS.js";
19
+ import "./chunk-X6JP6AMX.js";
20
+ import "./chunk-OEECXAGT.js";
21
21
  import "./chunk-VFUK3X5B.js";
22
- import "./chunk-5NOHC2Z4.js";
22
+ import "./chunk-732P2RBQ.js";
23
23
  import "./chunk-HZF5P5UN.js";
24
24
  import "./chunk-F3B2YJ76.js";
25
- import "./chunk-3WIFZBJL.js";
25
+ import "./chunk-7TZM33YX.js";
26
26
  import "./chunk-6GWA276C.js";
27
- import "./chunk-6IWDFUXW.js";
28
- import "./chunk-JUBPTYNO.js";
27
+ import "./chunk-M6PWM3OK.js";
28
+ import "./chunk-ELAVLP7Z.js";
29
29
  import "./chunk-MLKGABMK.js";
30
30
  export {
31
31
  PluginHookDeniedError,
@@ -107,8 +107,19 @@ export declare const conversationPendingMessageSchema: z.ZodObject<{
107
107
  text: z.ZodOptional<z.ZodString>;
108
108
  redacted: z.ZodOptional<z.ZodLiteral<true>>;
109
109
  }, z.core.$strict>;
110
+ /** Participant-only authorization prompt for a parked web turn. */
111
+ export declare const conversationPendingAuthorizationSchema: z.ZodObject<{
112
+ authorizationUrl: z.ZodString;
113
+ completionText: z.ZodString;
114
+ label: z.ZodString;
115
+ }, z.core.$strict>;
110
116
  /** Bounded mailbox snapshot for one conversation transcript. */
111
117
  export declare const conversationPendingMessagesReportSchema: z.ZodObject<{
118
+ authorization: z.ZodOptional<z.ZodObject<{
119
+ authorizationUrl: z.ZodString;
120
+ completionText: z.ZodString;
121
+ label: z.ZodString;
122
+ }, z.core.$strict>>;
112
123
  conversationId: z.ZodString;
113
124
  generatedAt: z.ZodString;
114
125
  messages: z.ZodArray<z.ZodObject<{
@@ -233,6 +244,7 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
233
244
  slackUserName: z.ZodOptional<z.ZodString>;
234
245
  }, z.core.$strict>>;
235
246
  eventType: z.ZodOptional<z.ZodString>;
247
+ explicitMention: z.ZodOptional<z.ZodBoolean>;
236
248
  text: z.ZodOptional<z.ZodString>;
237
249
  redacted: z.ZodOptional<z.ZodLiteral<true>>;
238
250
  }, z.core.$strict>, z.ZodObject<{
@@ -274,10 +286,14 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
274
286
  type: z.ZodLiteral<"turn_lifecycle">;
275
287
  turnId: z.ZodString;
276
288
  state: z.ZodEnum<{
277
- started: "started";
278
289
  succeeded: "succeeded";
279
290
  no_reply: "no_reply";
280
291
  }>;
292
+ }, z.core.$strict>, z.ZodObject<{
293
+ type: z.ZodLiteral<"turn_lifecycle">;
294
+ turnId: z.ZodString;
295
+ state: z.ZodLiteral<"started">;
296
+ inputMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
281
297
  }, z.core.$strict>, z.ZodObject<{
282
298
  type: z.ZodLiteral<"turn_lifecycle">;
283
299
  turnId: z.ZodString;
@@ -412,6 +428,7 @@ export declare const conversationReportEventSchema: z.ZodObject<{
412
428
  slackUserName: z.ZodOptional<z.ZodString>;
413
429
  }, z.core.$strict>>;
414
430
  eventType: z.ZodOptional<z.ZodString>;
431
+ explicitMention: z.ZodOptional<z.ZodBoolean>;
415
432
  text: z.ZodOptional<z.ZodString>;
416
433
  redacted: z.ZodOptional<z.ZodLiteral<true>>;
417
434
  }, z.core.$strict>, z.ZodObject<{
@@ -453,10 +470,14 @@ export declare const conversationReportEventSchema: z.ZodObject<{
453
470
  type: z.ZodLiteral<"turn_lifecycle">;
454
471
  turnId: z.ZodString;
455
472
  state: z.ZodEnum<{
456
- started: "started";
457
473
  succeeded: "succeeded";
458
474
  no_reply: "no_reply";
459
475
  }>;
476
+ }, z.core.$strict>, z.ZodObject<{
477
+ type: z.ZodLiteral<"turn_lifecycle">;
478
+ turnId: z.ZodString;
479
+ state: z.ZodLiteral<"started">;
480
+ inputMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
460
481
  }, z.core.$strict>, z.ZodObject<{
461
482
  type: z.ZodLiteral<"turn_lifecycle">;
462
483
  turnId: z.ZodString;
@@ -716,6 +737,7 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
716
737
  slackUserName: z.ZodOptional<z.ZodString>;
717
738
  }, z.core.$strict>>;
718
739
  eventType: z.ZodOptional<z.ZodString>;
740
+ explicitMention: z.ZodOptional<z.ZodBoolean>;
719
741
  text: z.ZodOptional<z.ZodString>;
720
742
  redacted: z.ZodOptional<z.ZodLiteral<true>>;
721
743
  }, z.core.$strict>, z.ZodObject<{
@@ -757,10 +779,14 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
757
779
  type: z.ZodLiteral<"turn_lifecycle">;
758
780
  turnId: z.ZodString;
759
781
  state: z.ZodEnum<{
760
- started: "started";
761
782
  succeeded: "succeeded";
762
783
  no_reply: "no_reply";
763
784
  }>;
785
+ }, z.core.$strict>, z.ZodObject<{
786
+ type: z.ZodLiteral<"turn_lifecycle">;
787
+ turnId: z.ZodString;
788
+ state: z.ZodLiteral<"started">;
789
+ inputMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
764
790
  }, z.core.$strict>, z.ZodObject<{
765
791
  type: z.ZodLiteral<"turn_lifecycle">;
766
792
  turnId: z.ZodString;
@@ -918,6 +944,7 @@ export declare const conversationEventPageSchema: z.ZodObject<{
918
944
  slackUserName: z.ZodOptional<z.ZodString>;
919
945
  }, z.core.$strict>>;
920
946
  eventType: z.ZodOptional<z.ZodString>;
947
+ explicitMention: z.ZodOptional<z.ZodBoolean>;
921
948
  text: z.ZodOptional<z.ZodString>;
922
949
  redacted: z.ZodOptional<z.ZodLiteral<true>>;
923
950
  }, z.core.$strict>, z.ZodObject<{
@@ -959,10 +986,14 @@ export declare const conversationEventPageSchema: z.ZodObject<{
959
986
  type: z.ZodLiteral<"turn_lifecycle">;
960
987
  turnId: z.ZodString;
961
988
  state: z.ZodEnum<{
962
- started: "started";
963
989
  succeeded: "succeeded";
964
990
  no_reply: "no_reply";
965
991
  }>;
992
+ }, z.core.$strict>, z.ZodObject<{
993
+ type: z.ZodLiteral<"turn_lifecycle">;
994
+ turnId: z.ZodString;
995
+ state: z.ZodLiteral<"started">;
996
+ inputMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
966
997
  }, z.core.$strict>, z.ZodObject<{
967
998
  type: z.ZodLiteral<"turn_lifecycle">;
968
999
  turnId: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  export { dailyConversationActivitySchema } from "./activity";
2
2
  export type { DailyConversationActivity } from "./activity";
3
- export { acceptedConversationMessageSchema, archiveConversationBodySchema, archiveConversationResponseSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventPageSchema, conversationEventHistorySchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, createConversationBodySchema, createConversationMessageBodySchema, } from "./schema/conversation";
3
+ export { acceptedConversationMessageSchema, archiveConversationBodySchema, archiveConversationResponseSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventPageSchema, conversationEventHistorySchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingAuthorizationSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, createConversationBodySchema, createConversationMessageBodySchema, } from "./schema/conversation";
4
4
  export type { AcceptedConversationMessage, ArchiveConversationBody, ArchiveConversationResponse, ActorIdentity, ConversationAuxiliaryCosts, ConversationCost, ConversationDetailReport, ConversationEventPage, ConversationEventHistory, ConversationFeed, ConversationPendingMessage, ConversationPendingMessageDelivery, ConversationPendingMessagesReport, ConversationReportEvent, ConversationReportEventData, ConversationReportStatus, ConversationMetricDay, ConversationModelUsage, ConversationParams, ConversationSourceTask, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationUsage, CreateConversationBody, CreateConversationMessageBody, GuardianMetricDay, GuardianStats, } from "./schema/conversation";
5
5
  export { actorDirectoryReportSchema, actorProfileReportSchema, personalSpendReportSchema, personParamsSchema, } from "./schema/person";
6
6
  export { locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, locationParamsSchema, } from "./schema/location";
@@ -14,6 +14,7 @@ import {
14
14
  conversationFeedQuerySchema,
15
15
  conversationFeedSchema,
16
16
  conversationParamsSchema,
17
+ conversationPendingAuthorizationSchema,
17
18
  conversationPendingMessageDeliverySchema,
18
19
  conversationPendingMessageSchema,
19
20
  conversationPendingMessagesReportSchema,
@@ -49,7 +50,7 @@ import {
49
50
  taskRunListSchema,
50
51
  taskRunSchema,
51
52
  taskSummarySchema
52
- } from "../chunk-3JVUWLR7.js";
53
+ } from "../chunk-UG5UCHHJ.js";
53
54
  import {
54
55
  healthReportSchema,
55
56
  pluginOperationalReportFeedSchema,
@@ -81,6 +82,7 @@ export {
81
82
  conversationFeedQuerySchema,
82
83
  conversationFeedSchema,
83
84
  conversationParamsSchema,
85
+ conversationPendingAuthorizationSchema,
84
86
  conversationPendingMessageDeliverySchema,
85
87
  conversationPendingMessageSchema,
86
88
  conversationPendingMessagesReportSchema,
package/dist/api.js CHANGED
@@ -33,21 +33,23 @@ import {
33
33
  taskListSchema,
34
34
  taskParamsSchema,
35
35
  taskRunListSchema
36
- } from "./chunk-3JVUWLR7.js";
36
+ } from "./chunk-UG5UCHHJ.js";
37
37
  import {
38
38
  appendAndEnqueueApiConversationMessage,
39
39
  createAndEnqueueApiConversation,
40
40
  formatSlackConversationRedactedLabel,
41
+ lookupSlackUser,
41
42
  readHealthReport,
42
43
  resolveSlackConversationContextFromThreadId,
43
44
  webActorFromEmail
44
- } from "./chunk-2Z7YX5PI.js";
45
+ } from "./chunk-3UJ3QYRV.js";
45
46
  import {
46
- buildSentryConversationUrl
47
- } from "./chunk-4CODA7P5.js";
47
+ buildSentryConversationUrl,
48
+ getWebAuthorization
49
+ } from "./chunk-SFYDSI34.js";
48
50
  import {
49
51
  getConversation
50
- } from "./chunk-JVOLC6JZ.js";
52
+ } from "./chunk-AYPU5T5L.js";
51
53
  import {
52
54
  readTaskExecutionByConversationId,
53
55
  readTaskExecutionDays,
@@ -55,8 +57,8 @@ import {
55
57
  readTaskExecutionSummaries,
56
58
  readTaskExecutions,
57
59
  readTaskRuns
58
- } from "./chunk-N6QJAPZS.js";
59
- import "./chunk-JBYWR6FW.js";
60
+ } from "./chunk-I4LR7MS2.js";
61
+ import "./chunk-67VR4BJK.js";
60
62
  import {
61
63
  healthReportSchema,
62
64
  pluginOperationalReportFeedSchema,
@@ -80,16 +82,16 @@ import {
80
82
  listPublicEventTasksForTeams,
81
83
  listPublicScheduledTasksForTeams,
82
84
  readStats
83
- } from "./chunk-AD6N2KNE.js";
85
+ } from "./chunk-KW2MGCW5.js";
84
86
  import {
85
87
  parseSlackThreadId
86
- } from "./chunk-4JV7GUUH.js";
88
+ } from "./chunk-RCBAXKMB.js";
87
89
  import {
88
90
  agentTurnUsageSchema,
89
91
  fallbackShortTitle,
90
92
  hasAgentTurnUsage,
91
93
  renderJuniorNativeConversationEvent
92
- } from "./chunk-2AWDPNP7.js";
94
+ } from "./chunk-3PCKG4BT.js";
93
95
  import "./chunk-3Y47VMHV.js";
94
96
  import "./chunk-PDO5BLNM.js";
95
97
  import {
@@ -99,11 +101,11 @@ import {
99
101
  renderPluginConversationEvent,
100
102
  resolveViewerUser,
101
103
  updateViewerDisplayName
102
- } from "./chunk-QNSV46AW.js";
104
+ } from "./chunk-NF733C66.js";
103
105
  import {
104
106
  getSlackClient,
105
107
  withSlackRetries
106
- } from "./chunk-D2PVJU5E.js";
108
+ } from "./chunk-KTYC3GDO.js";
107
109
  import {
108
110
  decodeStoredConversationEvent,
109
111
  getConversationStore,
@@ -111,23 +113,23 @@ import {
111
113
  getSqlExecutor,
112
114
  locationFromRow,
113
115
  parseSessionSource
114
- } from "./chunk-GZ25ZSTX.js";
116
+ } from "./chunk-XTLF7C4I.js";
115
117
  import {
116
118
  juniorApiTokens,
117
119
  juniorConversationEvents,
118
120
  juniorConversations,
119
121
  juniorIdentities,
120
122
  juniorUsers
121
- } from "./chunk-KFHJQYKQ.js";
123
+ } from "./chunk-X4RM4TBW.js";
122
124
  import "./chunk-EM225ITJ.js";
123
- import "./chunk-B2YA2G26.js";
124
- import "./chunk-FGP5W3NS.js";
125
+ import "./chunk-X6JP6AMX.js";
126
+ import "./chunk-OEECXAGT.js";
125
127
  import {
126
128
  juniorDestinations
127
129
  } from "./chunk-VFUK3X5B.js";
128
130
  import {
129
131
  canExposeConversationPayload
130
- } from "./chunk-5NOHC2Z4.js";
132
+ } from "./chunk-732P2RBQ.js";
131
133
  import "./chunk-RUIXF3YQ.js";
132
134
  import "./chunk-HZF5P5UN.js";
133
135
  import {
@@ -137,10 +139,10 @@ import {
137
139
  } from "./chunk-F3B2YJ76.js";
138
140
  import {
139
141
  logException
140
- } from "./chunk-3WIFZBJL.js";
142
+ } from "./chunk-7TZM33YX.js";
141
143
  import "./chunk-6GWA276C.js";
142
- import "./chunk-6IWDFUXW.js";
143
- import "./chunk-JUBPTYNO.js";
144
+ import "./chunk-M6PWM3OK.js";
145
+ import "./chunk-ELAVLP7Z.js";
144
146
  import "./chunk-MLKGABMK.js";
145
147
 
146
148
  // src/api.ts
@@ -524,7 +526,11 @@ function usageFromRow(row) {
524
526
  return hasAgentTurnUsage(result) ? agentTurnUsageSchema.parse(result) : void 0;
525
527
  }
526
528
  async function readConversationModelUsageFromSql(executor, options) {
527
- const modelId = sql`concat(${message}->>'provider', '/', ${message}->>'model')`;
529
+ const modelId = sql`case
530
+ when position('/' in coalesce(${message}->>'model', '')) > 0
531
+ then ${message}->>'model'
532
+ else concat(${message}->>'provider', '/', ${message}->>'model')
533
+ end`;
528
534
  const inputTokens = token("input", "inputTokens");
529
535
  const outputTokens = token("output", "outputTokens");
530
536
  const cachedInputTokens = token("cacheRead", "cachedInputTokens");
@@ -833,6 +839,7 @@ function reportEventData(args) {
833
839
  ...data.meta?.source === "web" ? { source: "web" } : {},
834
840
  ...actorIdentity ? { actorIdentity } : {},
835
841
  ...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : {},
842
+ ...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta.explicitMention } : {},
836
843
  ...args.canExposePayload ? { text: data.text } : { redacted: true }
837
844
  };
838
845
  }
@@ -845,7 +852,8 @@ function reportEventData(args) {
845
852
  return {
846
853
  type: "turn_lifecycle",
847
854
  turnId: data.turnId,
848
- state: "started"
855
+ state: "started",
856
+ ...data.inputMessageIds.length > 0 ? { inputMessageIds: data.inputMessageIds } : {}
849
857
  };
850
858
  case "turn_context":
851
859
  if (!args.canExposePayload) {
@@ -2372,19 +2380,22 @@ function actorIdentityFromApiMetadata(metadata2) {
2372
2380
  ...metadata2.authorFullName ? { fullName: metadata2.authorFullName } : {}
2373
2381
  };
2374
2382
  }
2375
- function actorIdentityFromSlackMetadata(metadata2) {
2383
+ async function actorIdentityFromSlackMetadata(metadata2, teamId) {
2376
2384
  if (metadata2.message.author.isMe === true) return void 0;
2377
2385
  const slackUserId = metadata2.message.author.userId.trim();
2378
2386
  if (!slackUserId) return void 0;
2379
- const slackUserName = metadata2.message.author.userName?.trim();
2380
- const fullName = metadata2.message.author.fullName?.trim();
2387
+ const profile = teamId ? await lookupSlackUser(teamId, slackUserId) : null;
2388
+ const slackUserName = profile?.userName?.trim() || metadata2.message.author.userName?.trim();
2389
+ const fullName = profile?.fullName?.trim() || metadata2.message.author.fullName?.trim();
2390
+ const email = profile?.email?.trim().toLowerCase();
2381
2391
  return {
2382
2392
  slackUserId,
2383
2393
  ...slackUserName ? { slackUserName } : {},
2384
- ...fullName ? { fullName } : {}
2394
+ ...fullName ? { fullName } : {},
2395
+ ...email ? { email } : {}
2385
2396
  };
2386
2397
  }
2387
- function projectPendingMessage(message2, canExposePayload) {
2398
+ async function projectPendingMessage(message2, canExposePayload) {
2388
2399
  if (message2.source === "web") {
2389
2400
  const metadata2 = apiTurnMailboxMetadataSchema.safeParse(
2390
2401
  message2.input.metadata
@@ -2414,7 +2425,22 @@ function projectPendingMessage(message2, canExposePayload) {
2414
2425
  if (metadata2.data.message.author.isMe === true) return void 0;
2415
2426
  const text = message2.input.text.trim();
2416
2427
  if (!text) return void 0;
2417
- const actorIdentity = actorIdentityFromSlackMetadata(metadata2.data);
2428
+ if (!canExposePayload) {
2429
+ return {
2430
+ createdAt: isoFromMs(message2.createdAtMs),
2431
+ delivery: message2.delivery,
2432
+ inboundMessageId: message2.inboundMessageId,
2433
+ messageId: metadata2.data.message.id,
2434
+ receivedAt: isoFromMs(message2.receivedAtMs),
2435
+ redacted: true,
2436
+ role: "user",
2437
+ source: "slack"
2438
+ };
2439
+ }
2440
+ const actorIdentity = await actorIdentityFromSlackMetadata(
2441
+ metadata2.data,
2442
+ message2.destination?.platform === "slack" ? message2.destination.teamId : void 0
2443
+ );
2418
2444
  return {
2419
2445
  createdAt: isoFromMs(message2.createdAtMs),
2420
2446
  delivery: message2.delivery,
@@ -2423,10 +2449,8 @@ function projectPendingMessage(message2, canExposePayload) {
2423
2449
  receivedAt: isoFromMs(message2.receivedAtMs),
2424
2450
  role: "user",
2425
2451
  source: "slack",
2426
- ...canExposePayload ? {
2427
- ...actorIdentity ? { actorIdentity } : {},
2428
- text
2429
- } : { redacted: true }
2452
+ ...actorIdentity ? { actorIdentity } : {},
2453
+ text
2430
2454
  };
2431
2455
  }
2432
2456
  return void 0;
@@ -2434,13 +2458,32 @@ function projectPendingMessage(message2, canExposePayload) {
2434
2458
  async function readConversationPendingMessages(conversationId, options = {}) {
2435
2459
  const conversation = await getConversationStore().get({ conversationId });
2436
2460
  if (!conversation) return void 0;
2437
- const access = (await readConversationAccessFromSql(getDb(), [conversationId], options.viewer)).get(conversationId);
2461
+ const access = (await readConversationAccessFromSql(
2462
+ getDb(),
2463
+ [conversationId],
2464
+ options.viewer
2465
+ )).get(conversationId);
2438
2466
  const canExposePayload = access?.canViewPrivateContent ?? false;
2467
+ const isParticipant = access?.isParticipant ?? false;
2468
+ const actorId = options.viewer?.email ? webActorFromEmail(options.viewer.email).userId : void 0;
2469
+ const authorization = isParticipant && actorId ? await getWebAuthorization({ actorId, conversationId }) : void 0;
2439
2470
  const work = await getConversation({ conversationId });
2440
- const messages = (work?.execution.pendingMessages ?? []).map((message2) => projectPendingMessage(message2, canExposePayload)).filter(
2471
+ const projectedMessages = await Promise.all(
2472
+ (work?.execution.pendingMessages ?? []).map(
2473
+ (message2) => projectPendingMessage(message2, canExposePayload)
2474
+ )
2475
+ );
2476
+ const messages = projectedMessages.filter(
2441
2477
  (message2) => Boolean(message2)
2442
2478
  );
2443
2479
  return conversationPendingMessagesReportSchema.parse({
2480
+ ...authorization ? {
2481
+ authorization: {
2482
+ authorizationUrl: authorization.authorizationUrl,
2483
+ completionText: authorization.completionText,
2484
+ label: authorization.label
2485
+ }
2486
+ } : {},
2444
2487
  conversationId,
2445
2488
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2446
2489
  messages
@@ -4310,7 +4353,7 @@ function readDescriptionText(home) {
4310
4353
  }
4311
4354
  }
4312
4355
  async function readSkillReports() {
4313
- const { discoverSkills } = await import("./skills-3YD55WPO.js");
4356
+ const { discoverSkills } = await import("./skills-SIPNY4AT.js");
4314
4357
  const skills = await discoverSkills();
4315
4358
  return skillReportsSchema.parse(
4316
4359
  skills.map((skill) => ({
@@ -4320,7 +4363,7 @@ async function readSkillReports() {
4320
4363
  );
4321
4364
  }
4322
4365
  async function readPlugins() {
4323
- const { pluginCatalogRuntime } = await import("./catalog-runtime-ZRSNE2MH.js");
4366
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-CVCR7SND.js");
4324
4367
  return pluginsSchema.parse(
4325
4368
  pluginCatalogRuntime.getProviders().map((plugin) => ({
4326
4369
  configKeys: plugin.manifest.configKeys ?? [],
@@ -4333,7 +4376,7 @@ async function readPlugins() {
4333
4376
  async function readRuntimeInfoReport() {
4334
4377
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4335
4378
  import("./discovery-GUFTFBTL.js"),
4336
- import("./catalog-runtime-ZRSNE2MH.js"),
4379
+ import("./catalog-runtime-CVCR7SND.js"),
4337
4380
  readPlugins(),
4338
4381
  readSkillReports()
4339
4382
  ]);
@@ -4349,7 +4392,7 @@ async function readRuntimeInfoReport() {
4349
4392
  }
4350
4393
  async function readPluginOperationalReportFeed() {
4351
4394
  const nowMs = Date.now();
4352
- const { getPluginOperationalReports } = await import("./agent-hooks-G4LEACQB.js");
4395
+ const { getPluginOperationalReports } = await import("./agent-hooks-U66Q3X2P.js");
4353
4396
  return pluginOperationalReportFeedSchema.parse({
4354
4397
  source: "plugins",
4355
4398
  generatedAt: new Date(nowMs).toISOString(),