@sentry/junior 0.125.0 → 0.126.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/{agent-hooks-MF5UZRCO.js → agent-hooks-HDSNWDQM.js} +8 -9
  2. package/dist/api.js +30 -24
  3. package/dist/app.js +49 -37
  4. package/dist/{catalog-runtime-V6SJTUV7.js → catalog-runtime-BDC3UWPG.js} +5 -6
  5. package/dist/chat/agent/request.d.ts +2 -1
  6. package/dist/chat/agent/resume.d.ts +2 -0
  7. package/dist/chat/agent-dispatch/types.d.ts +2 -1
  8. package/dist/chat/conversation-privacy.d.ts +7 -12
  9. package/dist/chat/conversations/destination-visibility.d.ts +7 -0
  10. package/dist/chat/conversations/store.d.ts +3 -3
  11. package/dist/chat/services/turn-session-record.d.ts +4 -1
  12. package/dist/chat/slack/conversation-context.d.ts +4 -7
  13. package/dist/chat/slack/footer.d.ts +10 -1
  14. package/dist/chat/slack/reply.d.ts +9 -2
  15. package/dist/chat/state/turn-session.d.ts +2 -6
  16. package/dist/{chunk-K6MQWEEJ.js → chunk-4PV73JHH.js} +11 -13
  17. package/dist/{chunk-ODB55JM7.js → chunk-6KWO5DU3.js} +9 -9
  18. package/dist/chunk-72SDEHFP.js +102 -0
  19. package/dist/{chunk-CAPBVX4L.js → chunk-ACJZZY5W.js} +2 -2
  20. package/dist/{chunk-XJYGLTYI.js → chunk-APYVVX2Y.js} +1 -1
  21. package/dist/{chunk-2U5CLBYF.js → chunk-EFQX6XBW.js} +1 -1
  22. package/dist/{chunk-Q3UF3K77.js → chunk-EQMSKORN.js} +1 -1
  23. package/dist/{chunk-NM3PMQS6.js → chunk-GHNO2WUH.js} +1 -1
  24. package/dist/{chunk-IHNBJHEP.js → chunk-GK55KLEH.js} +1 -1
  25. package/dist/{chunk-ZXGBLAYQ.js → chunk-JFW62B3Y.js} +1 -1
  26. package/dist/{chunk-MVYNJECP.js → chunk-JP2ZOSQK.js} +15 -5
  27. package/dist/{chunk-LG5TXWXI.js → chunk-KISG7E24.js} +57 -36
  28. package/dist/{chunk-IS4DGI5J.js → chunk-KP7E267S.js} +14 -11
  29. package/dist/{chunk-2R5MASH3.js → chunk-LCRWDMCH.js} +1 -1
  30. package/dist/{chunk-MYKSUTUV.js → chunk-LIDEU7QS.js} +4 -4
  31. package/dist/{chunk-HT7DSLKL.js → chunk-TUHUIBDX.js} +56 -38
  32. package/dist/{chunk-S7G34U75.js → chunk-VUBUFT66.js} +5 -121
  33. package/dist/{chunk-7K57FJXR.js → chunk-WRH7DWFO.js} +13 -11
  34. package/dist/{chunk-KN7QI56S.js → chunk-XLIAQRDI.js} +3 -8
  35. package/dist/{chunk-EXD2Z3YR.js → chunk-XVKJJXHF.js} +16 -14
  36. package/dist/{chunk-JT3YMQR3.js → chunk-YMSVBWBY.js} +8 -8
  37. package/dist/cli/chat.js +23 -23
  38. package/dist/cli/check.js +6 -7
  39. package/dist/cli/plugins.js +11 -12
  40. package/dist/cli/snapshot-create.js +9 -10
  41. package/dist/cli/upgrade.js +6 -7
  42. package/dist/{db-JSDSWK7T.js → db-AZB6AGJL.js} +6 -7
  43. package/dist/instrumentation.js +4 -5
  44. package/dist/nitro.js +2 -2
  45. package/dist/{oauth-callback-server-UMS2T3HN.js → oauth-callback-server-XK4QJLPZ.js} +16 -16
  46. package/dist/{runner-RGOANIRV.js → runner-DSGDSATN.js} +11 -12
  47. package/dist/{skills-GBLPOQOD.js → skills-CO6E3BQJ.js} +6 -7
  48. package/dist/{validation-BMQY6CD4.js → validation-IHLISKM5.js} +6 -7
  49. package/dist/version.js +1 -1
  50. package/migrations/0014_source_visibility.sql +8 -0
  51. package/migrations/meta/0014_snapshot.json +1201 -0
  52. package/migrations/meta/_journal.json +8 -1
  53. package/package.json +5 -5
  54. package/dist/chunk-OB42YVAE.js +0 -16
@@ -11,20 +11,19 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-ODB55JM7.js";
15
- import "./chunk-IS4DGI5J.js";
14
+ } from "./chunk-6KWO5DU3.js";
15
+ import "./chunk-KP7E267S.js";
16
16
  import "./chunk-S4PUICSB.js";
17
- import "./chunk-XJYGLTYI.js";
18
- import "./chunk-KN7QI56S.js";
17
+ import "./chunk-APYVVX2Y.js";
18
+ import "./chunk-XLIAQRDI.js";
19
19
  import "./chunk-VFUK3X5B.js";
20
- import "./chunk-S7G34U75.js";
20
+ import "./chunk-VUBUFT66.js";
21
21
  import "./chunk-HZF5P5UN.js";
22
- import "./chunk-MVYNJECP.js";
23
- import "./chunk-OB42YVAE.js";
24
22
  import "./chunk-F3B2YJ76.js";
23
+ import "./chunk-JP2ZOSQK.js";
25
24
  import "./chunk-6GWA276C.js";
26
- import "./chunk-2R5MASH3.js";
27
- import "./chunk-ZXGBLAYQ.js";
25
+ import "./chunk-LCRWDMCH.js";
26
+ import "./chunk-JFW62B3Y.js";
28
27
  import "./chunk-MLKGABMK.js";
29
28
  export {
30
29
  PluginHookDeniedError,
package/dist/api.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  formatSlackConversationRedactedLabel,
30
30
  readHealthReport,
31
31
  resolveSlackConversationContextFromThreadId
32
- } from "./chunk-EXD2Z3YR.js";
32
+ } from "./chunk-XVKJJXHF.js";
33
33
  import {
34
34
  buildSentryConversationUrl
35
35
  } from "./chunk-4CODA7P5.js";
@@ -42,7 +42,10 @@ import {
42
42
  } from "./chunk-UTL3MHPC.js";
43
43
  import {
44
44
  readStats
45
- } from "./chunk-Q3UF3K77.js";
45
+ } from "./chunk-EQMSKORN.js";
46
+ import {
47
+ parseSlackThreadId
48
+ } from "./chunk-72SDEHFP.js";
46
49
  import {
47
50
  agentTurnUsageSchema,
48
51
  hasAgentTurnUsage,
@@ -55,13 +58,13 @@ import {
55
58
  listConversationAnnotations,
56
59
  readViewerActors,
57
60
  renderPluginConversationEvent
58
- } from "./chunk-ODB55JM7.js";
61
+ } from "./chunk-6KWO5DU3.js";
59
62
  import {
60
63
  decodeStoredConversationEvent,
61
64
  getDb,
62
65
  getSqlExecutor,
63
66
  parseSessionSource
64
- } from "./chunk-IS4DGI5J.js";
67
+ } from "./chunk-KP7E267S.js";
65
68
  import {
66
69
  juniorApiTokens,
67
70
  juniorConversationEvents,
@@ -69,25 +72,23 @@ import {
69
72
  juniorIdentities,
70
73
  juniorUsers
71
74
  } from "./chunk-S4PUICSB.js";
72
- import "./chunk-XJYGLTYI.js";
73
- import "./chunk-KN7QI56S.js";
75
+ import "./chunk-APYVVX2Y.js";
76
+ import "./chunk-XLIAQRDI.js";
74
77
  import {
75
78
  juniorDestinations
76
79
  } from "./chunk-VFUK3X5B.js";
77
80
  import {
78
- canExposeConversationPayload,
79
- parseSlackThreadId
80
- } from "./chunk-S7G34U75.js";
81
+ canExposeConversationPayload
82
+ } from "./chunk-VUBUFT66.js";
81
83
  import "./chunk-HZF5P5UN.js";
82
- import "./chunk-MVYNJECP.js";
83
- import "./chunk-OB42YVAE.js";
84
84
  import {
85
85
  parseSlackChannelId,
86
86
  parseSlackTeamId
87
87
  } from "./chunk-F3B2YJ76.js";
88
+ import "./chunk-JP2ZOSQK.js";
88
89
  import "./chunk-6GWA276C.js";
89
- import "./chunk-2R5MASH3.js";
90
- import "./chunk-ZXGBLAYQ.js";
90
+ import "./chunk-LCRWDMCH.js";
91
+ import "./chunk-JFW62B3Y.js";
91
92
  import "./chunk-MLKGABMK.js";
92
93
 
93
94
  // src/api.ts
@@ -941,7 +942,8 @@ function titleFromConversation(args) {
941
942
  const effectiveChannelName = args.conversation.channelName;
942
943
  const slackConversation = resolveSlackConversationContextFromThreadId({
943
944
  threadId: args.conversation.conversationId,
944
- channelName: effectiveChannelName
945
+ channelName: effectiveChannelName,
946
+ ...args.visibility ? { visibility: args.visibility } : {}
945
947
  });
946
948
  const privateLabel = args.canViewPrivateContent ? void 0 : privateConversationLabel(slackConversation);
947
949
  return privateLabel ?? args.conversation.title ?? slackStatsLocationLabel({
@@ -949,7 +951,7 @@ function titleFromConversation(args) {
949
951
  channelName: effectiveChannelName
950
952
  }) ?? surfaceFallbackLabel(args.surface);
951
953
  }
952
- function channelNameFromConversation(conversation, canViewPrivateContent) {
954
+ function channelNameFromConversation(conversation, canViewPrivateContent, visibility) {
953
955
  const effectiveChannelName = conversation.channelName;
954
956
  const slackThread = parseSlackThreadId(conversation.conversationId);
955
957
  if (!effectiveChannelName && !slackThread) {
@@ -957,7 +959,8 @@ function channelNameFromConversation(conversation, canViewPrivateContent) {
957
959
  }
958
960
  const slackConversation = resolveSlackConversationContextFromThreadId({
959
961
  threadId: conversation.conversationId,
960
- channelName: effectiveChannelName
962
+ channelName: effectiveChannelName,
963
+ ...visibility ? { visibility } : {}
961
964
  });
962
965
  if (!canViewPrivateContent) {
963
966
  return privateConversationLabel(slackConversation);
@@ -984,6 +987,8 @@ function conversationEventHistory(args) {
984
987
  function conversationSummaryFromStoredConversation(args) {
985
988
  const { conversation, durationMs, usage: usage3 } = args;
986
989
  const canViewPrivateContent = args.access?.canViewPrivateContent ?? false;
990
+ const accessVisibility = args.access?.visibility;
991
+ const visibility = accessVisibility === "public" || accessVisibility === "private" ? accessVisibility : void 0;
987
992
  const surface = surfaceFromSource(
988
993
  conversation.source,
989
994
  conversation.conversationId
@@ -996,7 +1001,8 @@ function conversationSummaryFromStoredConversation(args) {
996
1001
  const slackThread = parseSlackThreadId(conversation.conversationId);
997
1002
  const channelName = channelNameFromConversation(
998
1003
  conversation,
999
- canViewPrivateContent
1004
+ canViewPrivateContent,
1005
+ visibility
1000
1006
  );
1001
1007
  const channelNameRedacted = channelNameRedactedFromConversation(
1002
1008
  conversation,
@@ -1008,7 +1014,8 @@ function conversationSummaryFromStoredConversation(args) {
1008
1014
  displayTitle: titleFromConversation({
1009
1015
  canViewPrivateContent,
1010
1016
  conversation,
1011
- surface
1017
+ surface,
1018
+ visibility
1012
1019
  }),
1013
1020
  isParticipant: args.access?.isParticipant ?? false,
1014
1021
  lastProgressAt: new Date(
@@ -1069,8 +1076,7 @@ async function readConversationAccessFromSql(db, conversationIds, verifiedViewer
1069
1076
  const visibility = validRootConversationId === void 0 ? null : row.visibility;
1070
1077
  const isParticipant = validRootConversationId !== void 0 && normalizedViewerEmail !== void 0 && row.rootEmailVerified === true && row.rootEmailNormalized === normalizedViewerEmail;
1071
1078
  const canViewPrivateContent = isParticipant || validRootConversationId !== void 0 && canExposeConversationPayload({
1072
- conversationId: validRootConversationId,
1073
- ...visibility === "public" || visibility === "private" ? { visibility } : {}
1079
+ visibility: visibility ?? void 0
1074
1080
  });
1075
1081
  return [
1076
1082
  row.conversationId,
@@ -2008,7 +2014,7 @@ function readDescriptionText(home) {
2008
2014
  }
2009
2015
  }
2010
2016
  async function readSkillReports() {
2011
- const { discoverSkills } = await import("./skills-GBLPOQOD.js");
2017
+ const { discoverSkills } = await import("./skills-CO6E3BQJ.js");
2012
2018
  const skills = await discoverSkills();
2013
2019
  return skillReportsSchema.parse(
2014
2020
  skills.map((skill) => ({
@@ -2018,7 +2024,7 @@ async function readSkillReports() {
2018
2024
  );
2019
2025
  }
2020
2026
  async function readPlugins() {
2021
- const { pluginCatalogRuntime } = await import("./catalog-runtime-V6SJTUV7.js");
2027
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-BDC3UWPG.js");
2022
2028
  return pluginsSchema.parse(
2023
2029
  pluginCatalogRuntime.getProviders().map((plugin) => ({
2024
2030
  configKeys: plugin.manifest.configKeys ?? [],
@@ -2031,7 +2037,7 @@ async function readPlugins() {
2031
2037
  async function readRuntimeInfoReport() {
2032
2038
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
2033
2039
  import("./discovery-GUFTFBTL.js"),
2034
- import("./catalog-runtime-V6SJTUV7.js"),
2040
+ import("./catalog-runtime-BDC3UWPG.js"),
2035
2041
  readPlugins(),
2036
2042
  readSkillReports()
2037
2043
  ]);
@@ -2047,7 +2053,7 @@ async function readRuntimeInfoReport() {
2047
2053
  }
2048
2054
  async function readPluginOperationalReportFeed() {
2049
2055
  const nowMs = Date.now();
2050
- const { getPluginOperationalReports } = await import("./agent-hooks-MF5UZRCO.js");
2056
+ const { getPluginOperationalReports } = await import("./agent-hooks-HDSNWDQM.js");
2051
2057
  return pluginOperationalReportFeedSchema.parse({
2052
2058
  source: "plugins",
2053
2059
  generatedAt: new Date(nowMs).toISOString(),
package/dist/app.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  startConversationWork,
51
51
  startSlackProcessingReaction,
52
52
  stripLeadingBotMention
53
- } from "./chunk-LG5TXWXI.js";
53
+ } from "./chunk-KISG7E24.js";
54
54
  import "./chunk-FA6POGLH.js";
55
55
  import {
56
56
  ConversationTurnLifecycleService,
@@ -65,13 +65,13 @@ import {
65
65
  processPluginTask,
66
66
  requireTurnFailureEventId,
67
67
  scheduleSessionCompletedPluginTasks
68
- } from "./chunk-JT3YMQR3.js";
68
+ } from "./chunk-YMSVBWBY.js";
69
69
  import {
70
70
  GET,
71
71
  conversationVisibilityFromSlackChannelType,
72
72
  resolveSlackChannelTypeFromMessage,
73
73
  resolveSlackConversationContext
74
- } from "./chunk-EXD2Z3YR.js";
74
+ } from "./chunk-XVKJJXHF.js";
75
75
  import "./chunk-4CODA7P5.js";
76
76
  import "./chunk-UTL3MHPC.js";
77
77
  import {
@@ -90,7 +90,7 @@ import {
90
90
  import {
91
91
  validatePluginEgressCredentialHooks,
92
92
  validatePluginRegistrations
93
- } from "./chunk-IHNBJHEP.js";
93
+ } from "./chunk-GK55KLEH.js";
94
94
  import {
95
95
  defineJuniorPlugins,
96
96
  pluginCatalogConfigFromEnv,
@@ -119,11 +119,12 @@ import {
119
119
  normalizeSandboxEgressTracePropagationDomains,
120
120
  parseSandboxEgressCredentialToken,
121
121
  renderSlackLegacyAttachmentText,
122
+ resolveDestinationVisibility,
122
123
  resolveSandboxEgressProviderForHost,
123
124
  setConfigDefaults,
124
125
  shouldEmitDevAgentTrace,
125
126
  shouldPropagateSandboxEgressTrace
126
- } from "./chunk-HT7DSLKL.js";
127
+ } from "./chunk-TUHUIBDX.js";
127
128
  import "./chunk-DIB4GX3G.js";
128
129
  import {
129
130
  RetryableDeliveryError,
@@ -134,7 +135,7 @@ import {
134
135
  formatProviderLabel,
135
136
  postSlackMessage,
136
137
  startOAuthFlow
137
- } from "./chunk-K6MQWEEJ.js";
138
+ } from "./chunk-4PV73JHH.js";
138
139
  import {
139
140
  ConversationTurnBoundaryError,
140
141
  CooperativeTurnYieldError,
@@ -190,10 +191,13 @@ import {
190
191
  trimTrailingAssistantMessages,
191
192
  updateConversationStats,
192
193
  upsertConversationMessage
193
- } from "./chunk-7K57FJXR.js";
194
+ } from "./chunk-WRH7DWFO.js";
194
195
  import "./chunk-HDSDCEPK.js";
195
- import "./chunk-MYKSUTUV.js";
196
- import "./chunk-Q3UF3K77.js";
196
+ import "./chunk-LIDEU7QS.js";
197
+ import "./chunk-EQMSKORN.js";
198
+ import {
199
+ parseSlackThreadId
200
+ } from "./chunk-72SDEHFP.js";
197
201
  import "./chunk-HX236W2U.js";
198
202
  import "./chunk-PDO5BLNM.js";
199
203
  import "./chunk-UIE3R5XU.js";
@@ -218,7 +222,7 @@ import {
218
222
  validatePlugins,
219
223
  verifyScheduledTaskCredentialSubject,
220
224
  verifySlackDirectCredentialSubject
221
- } from "./chunk-ODB55JM7.js";
225
+ } from "./chunk-6KWO5DU3.js";
222
226
  import {
223
227
  contextProvenance,
224
228
  createSlackDestination,
@@ -229,7 +233,7 @@ import {
229
233
  instructionProvenanceFor,
230
234
  requireSlackDestination,
231
235
  withConversationEventLock
232
- } from "./chunk-IS4DGI5J.js";
236
+ } from "./chunk-KP7E267S.js";
233
237
  import {
234
238
  juniorConversationEvents,
235
239
  juniorConversations
@@ -238,7 +242,7 @@ import {
238
242
  acquireActiveLock,
239
243
  getStateAdapter,
240
244
  sleep
241
- } from "./chunk-XJYGLTYI.js";
245
+ } from "./chunk-APYVVX2Y.js";
242
246
  import {
243
247
  STANDARD_MODEL_PROFILE,
244
248
  botConfig,
@@ -256,18 +260,16 @@ import {
256
260
  modelIdForProfile,
257
261
  setSlackReactionConfig,
258
262
  standardModelId
259
- } from "./chunk-KN7QI56S.js";
263
+ } from "./chunk-XLIAQRDI.js";
260
264
  import {
261
265
  juniorDestinations
262
266
  } from "./chunk-VFUK3X5B.js";
263
- import {
264
- parseSlackThreadId
265
- } from "./chunk-S7G34U75.js";
266
- import "./chunk-CAPBVX4L.js";
267
+ import "./chunk-VUBUFT66.js";
268
+ import "./chunk-ACJZZY5W.js";
267
269
  import {
268
270
  pluginCatalogRuntime
269
- } from "./chunk-NM3PMQS6.js";
270
- import "./chunk-2U5CLBYF.js";
271
+ } from "./chunk-GHNO2WUH.js";
272
+ import "./chunk-EFQX6XBW.js";
271
273
  import {
272
274
  credentialSubjectSchema
273
275
  } from "./chunk-W3U3YQYI.js";
@@ -278,6 +280,10 @@ import {
278
280
  isActorUserId,
279
281
  parseActorUserId
280
282
  } from "./chunk-HZF5P5UN.js";
283
+ import {
284
+ parseSlackChannelId,
285
+ parseSlackMessageTs
286
+ } from "./chunk-F3B2YJ76.js";
281
287
  import {
282
288
  buildTurnFailureResponse,
283
289
  createChatSdkLogger,
@@ -291,17 +297,11 @@ import {
291
297
  setSpanAttributes,
292
298
  setSpanStatus,
293
299
  setTags,
300
+ toOptionalString,
294
301
  withContext,
295
302
  withLogContext,
296
303
  withSpan
297
- } from "./chunk-MVYNJECP.js";
298
- import {
299
- toOptionalString
300
- } from "./chunk-OB42YVAE.js";
301
- import {
302
- parseSlackChannelId,
303
- parseSlackMessageTs
304
- } from "./chunk-F3B2YJ76.js";
304
+ } from "./chunk-JP2ZOSQK.js";
305
305
  import {
306
306
  continueTrace
307
307
  } from "./chunk-6GWA276C.js";
@@ -309,10 +309,10 @@ import "./chunk-OOUNJNMR.js";
309
309
  import "./chunk-H4HBKISO.js";
310
310
  import {
311
311
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
312
- } from "./chunk-2R5MASH3.js";
312
+ } from "./chunk-LCRWDMCH.js";
313
313
  import {
314
314
  JUNIOR_VERSION
315
- } from "./chunk-ZXGBLAYQ.js";
315
+ } from "./chunk-JFW62B3Y.js";
316
316
  import "./chunk-MLKGABMK.js";
317
317
 
318
318
  // src/app.ts
@@ -380,6 +380,7 @@ import {
380
380
  destinationSchema,
381
381
  destinationVisibilitySchema,
382
382
  isSlackDestination,
383
+ replyAttributionSchema,
383
384
  sourceSchema
384
385
  } from "@sentry/junior-plugin-api";
385
386
  import { z as z2 } from "zod";
@@ -417,6 +418,7 @@ var dispatchRecordSchema = z2.object({
417
418
  input: z2.string().min(1),
418
419
  metadata: z2.record(z2.string(), z2.string()).optional(),
419
420
  plugin: nonEmptyExactStringSchema,
421
+ replyAttribution: replyAttributionSchema.optional(),
420
422
  resultMessageTs: z2.string().optional(),
421
423
  source: sourceSchema,
422
424
  status: dispatchStatusSchema,
@@ -625,6 +627,7 @@ async function createOrGetDispatch(args) {
625
627
  input: args.options.input,
626
628
  ...metadata ? { metadata } : {},
627
629
  plugin: args.plugin,
630
+ ...args.options.replyAttribution ? { replyAttribution: args.options.replyAttribution } : {},
628
631
  status: "pending",
629
632
  source: args.options.source,
630
633
  updatedAtMs: args.nowMs
@@ -758,7 +761,8 @@ function buildDispatchRoutingContext(dispatch) {
758
761
  actor: dispatch.actor,
759
762
  id: dispatch.id,
760
763
  metadata: dispatch.metadata,
761
- plugin: dispatch.plugin
764
+ plugin: dispatch.plugin,
765
+ replyAttribution: dispatch.replyAttribution
762
766
  },
763
767
  surface: "api"
764
768
  };
@@ -1313,6 +1317,9 @@ function dispatchOptionsErrorMessage(issues) {
1313
1317
  if (hasIssueUnderPath(issues, ["metadata"])) {
1314
1318
  return "Dispatch metadata values must be strings";
1315
1319
  }
1320
+ if (hasIssueUnderPath(issues, ["replyAttribution"])) {
1321
+ return "Dispatch reply attribution is invalid";
1322
+ }
1316
1323
  return "Dispatch options are invalid";
1317
1324
  }
1318
1325
  function validateDispatchOptions(options) {
@@ -6486,27 +6493,30 @@ function createReplyToThread(deps) {
6486
6493
  const threadId = getThreadId(thread, message);
6487
6494
  const channelId = getChannelId(thread, message);
6488
6495
  const channelName = !options.execution && channelId ? await resolveChannelName(thread) : void 0;
6496
+ const destination = requireSlackDestination(
6497
+ options.destination,
6498
+ "Slack reply execution"
6499
+ );
6489
6500
  const slackChannelType = resolveSlackChannelTypeFromMessage(message);
6490
6501
  const slackConversation = resolveSlackConversationContext({
6491
6502
  channelId,
6492
6503
  channelName,
6493
6504
  channelType: slackChannelType
6494
6505
  });
6495
- const destinationVisibility = options.execution?.destinationVisibility ?? conversationVisibilityFromSlackChannelType(slackChannelType);
6506
+ const destinationVisibility = await resolveDestinationVisibility({
6507
+ destination,
6508
+ visibility: options.execution?.destinationVisibility ?? conversationVisibilityFromSlackChannelType(slackChannelType)
6509
+ });
6496
6510
  const threadTs = getThreadTs(threadId);
6497
6511
  const assistantThreadContext = getAssistantThreadContext(message);
6498
6512
  const messageTs = getMessageTs(message);
6499
- const destination = requireSlackDestination(
6500
- options.destination,
6501
- "Slack reply execution"
6502
- );
6503
6513
  const teamId = destination.teamId;
6504
6514
  const source = options.execution?.source ?? createSlackSource({
6505
6515
  channelId: channelId ?? destination.channelId,
6506
6516
  messageTs,
6507
6517
  teamId,
6508
6518
  threadTs,
6509
- type: destinationVisibility === "public" ? "pub" : "priv"
6519
+ visibility: destinationVisibility ?? "private"
6510
6520
  });
6511
6521
  const slackActionToken = readSlackActionToken(message);
6512
6522
  const runId = options.execution?.dispatch?.id ?? getRunId(thread, message);
@@ -6603,6 +6613,7 @@ function createReplyToThread(deps) {
6603
6613
  await sendSlackReply({
6604
6614
  channelId,
6605
6615
  conversationId,
6616
+ replyAttribution: options.execution?.dispatch?.replyAttribution,
6606
6617
  text,
6607
6618
  threadTs
6608
6619
  });
@@ -6968,6 +6979,7 @@ function createReplyToThread(deps) {
6968
6979
  slackTs = await sendSlackReply({
6969
6980
  channelId,
6970
6981
  conversationId,
6982
+ replyAttribution: options.execution?.dispatch?.replyAttribution,
6971
6983
  text,
6972
6984
  ...threadTs ? { threadTs } : {}
6973
6985
  });
@@ -7197,7 +7209,7 @@ function createReplyToThread(deps) {
7197
7209
  slackConversation,
7198
7210
  source,
7199
7211
  destination,
7200
- destinationVisibility,
7212
+ ...destinationVisibility ? { destinationVisibility } : {},
7201
7213
  surface: options.execution?.surface ?? "slack",
7202
7214
  dispatch: options.execution?.dispatch,
7203
7215
  toolChannelId,
@@ -1,17 +1,16 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-NM3PMQS6.js";
4
- import "./chunk-2U5CLBYF.js";
3
+ } from "./chunk-GHNO2WUH.js";
4
+ import "./chunk-EFQX6XBW.js";
5
5
  import "./chunk-W3U3YQYI.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
- import "./chunk-MVYNJECP.js";
8
- import "./chunk-OB42YVAE.js";
9
7
  import "./chunk-F3B2YJ76.js";
8
+ import "./chunk-JP2ZOSQK.js";
10
9
  import "./chunk-6GWA276C.js";
11
10
  import "./chunk-OOUNJNMR.js";
12
11
  import "./chunk-H4HBKISO.js";
13
- import "./chunk-2R5MASH3.js";
14
- import "./chunk-ZXGBLAYQ.js";
12
+ import "./chunk-LCRWDMCH.js";
13
+ import "./chunk-JFW62B3Y.js";
15
14
  import "./chunk-MLKGABMK.js";
16
15
  export {
17
16
  pluginCatalogRuntime
@@ -7,7 +7,7 @@
7
7
  * phases consume these groups directly; callers build them at runtime
8
8
  * boundaries.
9
9
  */
10
- import type { Destination, Source, SystemActor } from "@sentry/junior-plugin-api";
10
+ import type { Destination, ReplyAttribution, Source, SystemActor } from "@sentry/junior-plugin-api";
11
11
  import type { ChannelConfigurationService } from "@/chat/configuration/types";
12
12
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
13
13
  import type { CredentialContext } from "@/chat/credentials/context";
@@ -81,6 +81,7 @@ export interface AgentRunRouting {
81
81
  id: string;
82
82
  metadata?: Record<string, string>;
83
83
  plugin?: string;
84
+ replyAttribution?: ReplyAttribution;
84
85
  };
85
86
  toolChannelId?: string;
86
87
  }
@@ -19,10 +19,12 @@ import { type AuthorizationPauseError } from "@/chat/services/auth-pause";
19
19
  import { type AgentTurnUsage } from "@/chat/usage";
20
20
  import { type AgentRunDurability } from "@/chat/agent/request";
21
21
  import type { PluginTurnContext } from "@/chat/plugins/prompt";
22
+ import type { ConversationPrivacy } from "@/chat/conversation-privacy";
22
23
  type LoadedSessionRecordState = Awaited<ReturnType<typeof loadTurnSessionRecord>>;
23
24
  interface ResumeStateArgs {
24
25
  channelName?: string;
25
26
  destination: Destination;
27
+ destinationVisibility?: ConversationPrivacy;
26
28
  dispatchId?: string;
27
29
  durability: AgentRunDurability;
28
30
  getLoadedSkillNames: () => string[];
@@ -1,4 +1,4 @@
1
- import type { DispatchOptions, DestinationVisibility, Source, SlackDestination } from "@sentry/junior-plugin-api";
1
+ import type { DispatchOptions, DestinationVisibility, ReplyAttribution, Source, SlackDestination } from "@sentry/junior-plugin-api";
2
2
  import type { CredentialContext, CredentialSubject, CredentialSystemActor } from "@/chat/credentials/context";
3
3
  import type { AgentRunRouting } from "@/chat/agent/request";
4
4
  import type { AgentTurnSurface } from "@/chat/state/turn-session";
@@ -22,6 +22,7 @@ export interface DispatchRecord {
22
22
  input: string;
23
23
  metadata?: Record<string, string>;
24
24
  plugin: string;
25
+ replyAttribution?: ReplyAttribution;
25
26
  resultMessageTs?: string;
26
27
  source: Source;
27
28
  status: DispatchStatus;
@@ -4,22 +4,17 @@ type TraceAttributeValue = string | number | boolean | string[];
4
4
  /**
5
5
  * Resolve whether a conversation may expose raw payloads.
6
6
  *
7
- * Only a live source signal or persisted destination visibility can classify
8
- * a conversation public. Identifier prefixes may only narrow classification
9
- * toward private. Unknown stays undefined so callers fail closed to private.
7
+ * Explicit destination visibility is authoritative. Missing visibility is
8
+ * observable and fails closed without inferring from identifiers.
10
9
  */
11
10
  export declare function resolveConversationPrivacy(input: {
12
- channelId?: string;
13
- conversationId?: string;
14
- /** Live source or persisted visibility, when the caller has one. */
15
- visibility?: ConversationPrivacy;
16
- }): ConversationPrivacy | undefined;
11
+ /** Live or persisted destination visibility, when the caller has one. */
12
+ visibility?: ConversationPrivacy | "direct" | "unknown";
13
+ }): ConversationPrivacy;
17
14
  /** Gate raw transcript/tool payload exposure to public conversations. */
18
15
  export declare function canExposeConversationPayload(input: {
19
- channelId?: string;
20
- conversationId?: string;
21
- /** Live source or persisted visibility, when the caller has one. */
22
- visibility?: ConversationPrivacy;
16
+ /** Live or persisted destination visibility, when the caller has one. */
17
+ visibility?: ConversationPrivacy | "direct" | "unknown";
23
18
  }): boolean;
24
19
  /** Return the privacy mode bound to the current agent turn. */
25
20
  export declare function getCurrentConversationPrivacy(): ConversationPrivacy | undefined;
@@ -0,0 +1,7 @@
1
+ import type { Destination } from "@sentry/junior-plugin-api";
2
+ import type { ConversationPrivacy } from "@/chat/conversation-privacy";
3
+ /** Read confirmed visibility from the current signal or persisted destination. */
4
+ export declare function resolveDestinationVisibility(args: {
5
+ destination: Destination;
6
+ visibility?: ConversationPrivacy;
7
+ }): Promise<ConversationPrivacy | undefined>;
@@ -49,7 +49,7 @@ export interface ConversationStore {
49
49
  get(args: {
50
50
  conversationId: string;
51
51
  }): Promise<Conversation | undefined>;
52
- /** Read persisted visibility for one destination. Missing rows fail closed. */
52
+ /** Read confirmed public/private visibility for one destination. */
53
53
  getDestinationVisibility(args: {
54
54
  provider: string;
55
55
  providerDestinationId: string;
@@ -66,7 +66,7 @@ export interface ConversationStore {
66
66
  /** Source normalized to a stable session locator; set-once when absent. */
67
67
  sessionSource?: Source;
68
68
  title?: string;
69
- /** Source-confirmed visibility from the current event's signal only. */
69
+ /** Confirmed destination visibility; omit when unavailable. */
70
70
  visibility?: ConversationPrivacy;
71
71
  }): Promise<void>;
72
72
  /**
@@ -88,7 +88,7 @@ export interface ConversationStore {
88
88
  source?: ConversationSource;
89
89
  title?: string;
90
90
  updatedAtMs: number;
91
- /** Source-confirmed visibility from the current event's signal only. */
91
+ /** Confirmed destination visibility; omit when unavailable. */
92
92
  visibility?: ConversationPrivacy;
93
93
  }): Promise<void>;
94
94
  listByActivity(args?: {
@@ -21,6 +21,7 @@ export declare function persistRunningSessionRecord(args: {
21
21
  channelName?: string;
22
22
  conversationId: string;
23
23
  destination?: Destination;
24
+ destinationVisibility?: ConversationPrivacy;
24
25
  dispatchId?: string;
25
26
  source?: Source;
26
27
  sessionId: string;
@@ -54,7 +55,7 @@ export declare function persistCompletedSessionRecord(args: {
54
55
  dispatchId?: string;
55
56
  dispatchOutcome?: AgentDispatchOutcome;
56
57
  errorMessage?: string;
57
- /** Source-confirmed destination visibility from the current event's signal. */
58
+ /** Confirmed visibility; omit when unavailable to preserve canonical metadata. */
58
59
  destinationVisibility?: ConversationPrivacy;
59
60
  /** Provider-owned identifier returned after visible delivery is accepted. */
60
61
  resultMessageId?: string;
@@ -105,6 +106,7 @@ export declare function persistAuthPauseSessionRecord(args: {
105
106
  currentDurationMs?: number;
106
107
  currentUsage?: AgentTurnUsage;
107
108
  destination?: Destination;
109
+ destinationVisibility?: ConversationPrivacy;
108
110
  dispatchId?: string;
109
111
  source?: Source;
110
112
  messages: PiMessage[];
@@ -123,6 +125,7 @@ interface ContinuationRecordInput {
123
125
  currentDurationMs?: number;
124
126
  currentUsage?: AgentTurnUsage;
125
127
  destination?: Destination;
128
+ destinationVisibility?: ConversationPrivacy;
126
129
  dispatchId?: string;
127
130
  source?: Source;
128
131
  messages: PiMessage[];
@@ -8,18 +8,14 @@ export type SlackConversationVisibility = "public" | "private";
8
8
  export interface SlackConversationContext {
9
9
  type: SlackConversationType;
10
10
  name?: string;
11
- /**
12
- * Visibility proven by a source signal (`channel_type`) or narrowed toward
13
- * private by a `D`/`G` id prefix. Undefined for `C`-prefixed conversations
14
- * without a signal, which may be public or private.
15
- */
11
+ /** Visibility proven by source or persisted metadata. */
16
12
  visibility?: SlackConversationVisibility;
17
13
  }
18
14
  /**
19
15
  * Map Slack's Events API channel_type to a source-confirmed visibility.
20
16
  *
21
- * This is the only mapping allowed to classify a Slack conversation public;
22
- * channel-id prefixes may only narrow classification toward private.
17
+ * Slack's event metadata is the only visibility authority; channel IDs never
18
+ * classify visibility.
23
19
  */
24
20
  export declare function conversationVisibilityFromSlackChannelType(channelType: SlackEventChannelType | undefined): SlackConversationVisibility | undefined;
25
21
  /** Resolve Slack's raw event channel type from a Chat SDK message-like object. */
@@ -34,6 +30,7 @@ export declare function resolveSlackConversationContext(input: {
34
30
  export declare function resolveSlackConversationContextFromThreadId(input: {
35
31
  threadId?: string;
36
32
  channelName?: string;
33
+ visibility?: SlackConversationVisibility;
37
34
  }): SlackConversationContext | undefined;
38
35
  /** Render a human label for a privacy-preserving Slack conversation type. */
39
36
  export declare function formatSlackConversationTypeLabel(type: SlackConversationType): string;