@sentry/junior 0.153.0 → 0.155.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 (83) hide show
  1. package/dist/{agent-hooks-7BWOB7SN.js → agent-hooks-AWVTLAV2.js} +11 -12
  2. package/dist/api/conversations/list.d.ts +5 -3
  3. package/dist/api/conversations/membership.d.ts +16 -0
  4. package/dist/api/locations/detail.d.ts +1 -0
  5. package/dist/api/schema/conversation.d.ts +3 -0
  6. package/dist/api/schema/location.d.ts +1 -0
  7. package/dist/api/schema/person.d.ts +1 -0
  8. package/dist/api/schema.js +1 -1
  9. package/dist/api.js +318 -187
  10. package/dist/app.js +39 -39
  11. package/dist/catalog-runtime-V6YD6KH5.js +16 -0
  12. package/dist/chat/conversations/sql/event-actor.d.ts +14 -0
  13. package/dist/chat/conversations/sql/event-lock.d.ts +1 -1
  14. package/dist/chat/conversations/sql/participants.d.ts +17 -0
  15. package/dist/chat/plugins/unfinished-work.d.ts +2 -0
  16. package/dist/chat/runtime/agent-runner.d.ts +2 -0
  17. package/dist/chat/runtime/slack-resume.d.ts +1 -1
  18. package/dist/chat/state/conversation.d.ts +1 -0
  19. package/dist/{chunk-O2YXWWPM.js → chunk-2AHVM3HK.js} +92 -9
  20. package/dist/{chunk-VXWTGOLW.js → chunk-2WLJDM23.js} +1 -1
  21. package/dist/{chunk-4TWLKHOM.js → chunk-37G5HJ2X.js} +4 -4
  22. package/dist/{chunk-ISEROVYZ.js → chunk-4K5N6HTX.js} +5 -5
  23. package/dist/{chunk-ET54Q4TD.js → chunk-773XC7P4.js} +116 -82
  24. package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
  25. package/dist/{chunk-HMU2QP5M.js → chunk-7NYEB2TM.js} +1 -1
  26. package/dist/{chunk-URFV5RWN.js → chunk-AENPRXCG.js} +23 -56
  27. package/dist/{chunk-TIV3PX5H.js → chunk-APHDJYN7.js} +2 -2
  28. package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
  29. package/dist/{chunk-5TXDKTET.js → chunk-CPQBTTI6.js} +7 -7
  30. package/dist/{chunk-A5SROS6H.js → chunk-ELOTIL5F.js} +5 -5
  31. package/dist/{chunk-JJAMURMR.js → chunk-EORR34UB.js} +1 -1
  32. package/dist/{chunk-5QBK3QHJ.js → chunk-J2SYI36O.js} +6 -8
  33. package/dist/{chunk-K4LK6KYO.js → chunk-J7MWZFFP.js} +4 -4
  34. package/dist/{chunk-COC65LIW.js → chunk-JFZBGFNX.js} +3 -1
  35. package/dist/{chunk-YECBSG77.js → chunk-JIC33O5L.js} +2 -2
  36. package/dist/{chunk-XAYXN4EG.js → chunk-JJX77MB7.js} +366 -138
  37. package/dist/{chunk-FLEY546A.js → chunk-KBT2I5ER.js} +7 -7
  38. package/dist/{chunk-37LMRT7G.js → chunk-KTVHAHUV.js} +1 -1
  39. package/dist/{chunk-PMJAY6JS.js → chunk-LQT3SWFA.js} +5 -5
  40. package/dist/{chunk-HYEAR6HL.js → chunk-MLBH7J7J.js} +1 -1
  41. package/dist/{chunk-5DMPHA4V.js → chunk-NKFRRZIT.js} +27 -37
  42. package/dist/{chunk-HOK7MEWG.js → chunk-NWSKFYOH.js} +1 -1
  43. package/dist/{chunk-JY2HJYJT.js → chunk-RN3AWYEP.js} +2 -2
  44. package/dist/{chunk-RKW5QGGN.js → chunk-RQ62VKM7.js} +1 -1
  45. package/dist/{chunk-XQPKMLRI.js → chunk-SDRJ2LE3.js} +1 -1
  46. package/dist/{chunk-JAJVUQV7.js → chunk-TKJ7277U.js} +3 -3
  47. package/dist/{chunk-EPOA52SD.js → chunk-TVXAN43I.js} +1 -1
  48. package/dist/{chunk-2NS3ACHB.js → chunk-UWTXAYBP.js} +11 -11
  49. package/dist/{chunk-2J4VCHRX.js → chunk-V57LZDHN.js} +8 -10
  50. package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
  51. package/dist/{chunk-PGJBNO3I.js → chunk-XFZLQANQ.js} +2 -2
  52. package/dist/{chunk-5XBRH3N7.js → chunk-Y6MVGU7L.js} +12 -11
  53. package/dist/{chunk-WTKAALLV.js → chunk-Y7ZUBP2K.js} +6 -6
  54. package/dist/{chunk-UG5UCHHJ.js → chunk-ZLSFOSDK.js} +2 -1
  55. package/dist/cli/chat.js +36 -36
  56. package/dist/cli/check.js +8 -9
  57. package/dist/cli/init.js +41 -7
  58. package/dist/cli/plugins.js +15 -16
  59. package/dist/cli/snapshot-create.js +11 -12
  60. package/dist/cli/upgrade.js +9 -10
  61. package/dist/db/schema/conversation-events.d.ts +20 -0
  62. package/dist/db/schema/conversation-participants.d.ts +63 -0
  63. package/dist/db/schema.d.ts +77 -1
  64. package/dist/{db-QNQM5YRR.js → db-WT7P56AH.js} +8 -8
  65. package/dist/instrumentation.js +4 -4
  66. package/dist/nitro.js +2 -2
  67. package/dist/{oauth-callback-server-ERQPIR27.js → oauth-callback-server-R2PK2MCA.js} +26 -26
  68. package/dist/{runner-BX46SQIE.js → runner-O7YYUIHT.js} +15 -16
  69. package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
  70. package/dist/{skills-JL44EIRX.js → skills-S6HLQRH7.js} +8 -9
  71. package/dist/spawn-B4SBFFA2.js +37 -0
  72. package/dist/{validation-UU2AIJIY.js → validation-46WD2OAR.js} +8 -9
  73. package/dist/version.js +1 -1
  74. package/dist/{work-SS7RU5CH.js → work-YT5QUBS3.js} +20 -21
  75. package/dist/worker-4C5BEDWN.js +24 -0
  76. package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
  77. package/migrations/meta/0026_snapshot.json +2424 -0
  78. package/migrations/meta/_journal.json +7 -0
  79. package/package.json +8 -6
  80. package/dist/catalog-runtime-CGUDNL3D.js +0 -17
  81. package/dist/chunk-F3B2YJ76.js +0 -57
  82. package/dist/spawn-W6FO32T4.js +0 -38
  83. package/dist/worker-5P2E7LVI.js +0 -25
@@ -4,28 +4,28 @@ import {
4
4
  isDmChannel,
5
5
  normalizeSlackConversationId,
6
6
  withSlackRetries
7
- } from "./chunk-JAJVUQV7.js";
7
+ } from "./chunk-TKJ7277U.js";
8
8
  import {
9
9
  parseDestination
10
- } from "./chunk-XAYXN4EG.js";
10
+ } from "./chunk-JJX77MB7.js";
11
11
  import {
12
12
  getStateAdapter
13
- } from "./chunk-XQPKMLRI.js";
13
+ } from "./chunk-SDRJ2LE3.js";
14
14
  import {
15
15
  normalizeSlackEmojiName
16
- } from "./chunk-PGJBNO3I.js";
16
+ } from "./chunk-XFZLQANQ.js";
17
17
  import {
18
18
  pluginCatalogRuntime
19
- } from "./chunk-EPOA52SD.js";
19
+ } from "./chunk-TVXAN43I.js";
20
20
  import {
21
21
  parseSlackMessageTs,
22
22
  parseSlackUserId
23
- } from "./chunk-F3B2YJ76.js";
23
+ } from "./chunk-V7YE4WCP.js";
24
24
  import {
25
25
  isRecord,
26
26
  logInfo,
27
27
  logWarn
28
- } from "./chunk-HMU2QP5M.js";
28
+ } from "./chunk-7NYEB2TM.js";
29
29
 
30
30
  // src/chat/slack/outbound.ts
31
31
  var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-XQPKMLRI.js";
3
+ } from "./chunk-SDRJ2LE3.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-6GWA276C.js";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-5QBK3QHJ.js";
3
+ } from "./chunk-J2SYI36O.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-2J4VCHRX.js";
7
+ } from "./chunk-V57LZDHN.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-XAYXN4EG.js";
10
+ } from "./chunk-JJX77MB7.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-ET54Q4TD.js";
16
+ } from "./chunk-773XC7P4.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-HMU2QP5M.js";
22
+ } from "./chunk-7NYEB2TM.js";
23
23
 
24
24
  // src/chat/event-tasks/store.ts
25
25
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-EPOA52SD.js";
3
+ } from "./chunk-TVXAN43I.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-FA6POGLH.js";
4
4
  import {
5
5
  getTurnRequestDeadline
6
- } from "./chunk-HOK7MEWG.js";
6
+ } from "./chunk-NWSKFYOH.js";
7
7
  import {
8
8
  buildSentryConversationUrl,
9
9
  deleteWebAuthorization
10
- } from "./chunk-37LMRT7G.js";
10
+ } from "./chunk-KTVHAHUV.js";
11
11
  import {
12
12
  ensureConversationWake,
13
13
  requestConversationWork
14
- } from "./chunk-A5SROS6H.js";
14
+ } from "./chunk-ELOTIL5F.js";
15
15
  import {
16
16
  buildDeliveredTurnStatePatch,
17
17
  finalizeFailedTurnReplyWithEvent,
@@ -24,7 +24,7 @@ import {
24
24
  requireTurnFailureEventId,
25
25
  resolveTurnSessionRouting,
26
26
  scheduleSessionCompletedPluginTasks
27
- } from "./chunk-2NS3ACHB.js";
27
+ } from "./chunk-UWTXAYBP.js";
28
28
  import {
29
29
  ConversationTurnLifecycleService,
30
30
  coerceThreadConversationState,
@@ -33,7 +33,7 @@ import {
33
33
  getPersistedSandboxState,
34
34
  getPersistedThreadState,
35
35
  persistThreadStateById
36
- } from "./chunk-ISEROVYZ.js";
36
+ } from "./chunk-4K5N6HTX.js";
37
37
  import {
38
38
  getVercelConversationWorkQueue
39
39
  } from "./chunk-WR76IVA5.js";
@@ -45,8 +45,9 @@ import {
45
45
  getMcpProviderErrorAttributes,
46
46
  getMcpStoredOAuthCredentials,
47
47
  lookupSlackUserProfile,
48
- resolvePluginOAuthAccount
49
- } from "./chunk-O2YXWWPM.js";
48
+ resolvePluginOAuthAccount,
49
+ runAgentWithTimeout
50
+ } from "./chunk-2AHVM3HK.js";
50
51
  import {
51
52
  RetryableDeliveryError
52
53
  } from "./chunk-RF6J3DIO.js";
@@ -62,13 +63,13 @@ import {
62
63
  removeReactionFromMessage,
63
64
  resolveBaseUrl,
64
65
  truncateStatusText
65
- } from "./chunk-FLEY546A.js";
66
+ } from "./chunk-KBT2I5ER.js";
66
67
  import {
67
68
  parseSlackThreadId,
68
69
  readSlackRawMessageContext,
69
70
  resolveSlackChannelIdFromMessage,
70
71
  resolveSlackChannelIdFromThreadId
71
- } from "./chunk-TIV3PX5H.js";
72
+ } from "./chunk-APHDJYN7.js";
72
73
  import {
73
74
  CooperativeTurnYieldError,
74
75
  TurnSliceLimitExceededError,
@@ -95,29 +96,29 @@ import {
95
96
  recordTurnSummary,
96
97
  saveTurnCheckpoint,
97
98
  turnHasReply
98
- } from "./chunk-5QBK3QHJ.js";
99
+ } from "./chunk-J2SYI36O.js";
99
100
  import {
100
101
  getDashboardConversationLink,
101
102
  getPluginSlackConversationLink
102
- } from "./chunk-2J4VCHRX.js";
103
+ } from "./chunk-V57LZDHN.js";
103
104
  import {
104
105
  SlackActionError,
105
106
  getHeaderString,
106
107
  getSlackClient,
107
108
  isDmChannel,
108
109
  normalizeSlackConversationId
109
- } from "./chunk-JAJVUQV7.js";
110
+ } from "./chunk-TKJ7277U.js";
110
111
  import {
111
112
  getConversationEventStore,
112
113
  getSqlExecutor,
113
114
  requireSlackDestination,
114
115
  upsertIdentity,
115
116
  upsertLinkedIdentity
116
- } from "./chunk-XAYXN4EG.js";
117
+ } from "./chunk-JJX77MB7.js";
117
118
  import {
118
119
  acquireActiveLock,
119
120
  getStateAdapter
120
- } from "./chunk-XQPKMLRI.js";
121
+ } from "./chunk-SDRJ2LE3.js";
121
122
  import {
122
123
  botConfig,
123
124
  escapeXml,
@@ -125,26 +126,24 @@ import {
125
126
  getRuntimeMetadata,
126
127
  normalizeSlackEmojiName,
127
128
  standardModelId
128
- } from "./chunk-PGJBNO3I.js";
129
+ } from "./chunk-XFZLQANQ.js";
129
130
  import {
130
131
  discoverSkills
131
- } from "./chunk-YECBSG77.js";
132
+ } from "./chunk-JIC33O5L.js";
132
133
  import {
133
134
  pluginCatalogRuntime
134
- } from "./chunk-EPOA52SD.js";
135
+ } from "./chunk-TVXAN43I.js";
135
136
  import {
136
137
  buildOAuthTokenRequest,
137
138
  hasRequiredOAuthScope,
138
139
  parseOAuthTokenResponse
139
- } from "./chunk-JY2HJYJT.js";
140
+ } from "./chunk-RN3AWYEP.js";
140
141
  import {
141
142
  createSlackResumeActor,
142
- isUserActor
143
- } from "./chunk-HZF5P5UN.js";
144
- import {
143
+ isUserActor,
145
144
  parseSlackMessageTs,
146
145
  parseSlackUserId
147
- } from "./chunk-F3B2YJ76.js";
146
+ } from "./chunk-V7YE4WCP.js";
148
147
  import {
149
148
  buildTurnFailureResponse,
150
149
  logException,
@@ -154,7 +153,7 @@ import {
154
153
  setTags,
155
154
  toOptionalString,
156
155
  withLogContext
157
- } from "./chunk-HMU2QP5M.js";
156
+ } from "./chunk-7NYEB2TM.js";
158
157
  import {
159
158
  homeDir
160
159
  } from "./chunk-H4HBKISO.js";
@@ -1512,21 +1511,12 @@ async function resumeSlackTurnInContext(args) {
1512
1511
  surface: "slack"
1513
1512
  });
1514
1513
  }
1515
- const replyPromise = runArgs.agentRunner.run(replyContext);
1516
1514
  const replyTimeoutMs = resolveReplyTimeoutMs(runArgs.replyTimeoutMs);
1517
- const outcome = typeof replyTimeoutMs === "number" ? await Promise.race([
1518
- replyPromise,
1519
- new Promise(
1520
- (_, reject) => setTimeout(
1521
- () => reject(
1522
- new Error(
1523
- `executeAgentRun timed out after ${replyTimeoutMs}ms`
1524
- )
1525
- ),
1526
- replyTimeoutMs
1527
- )
1528
- )
1529
- ]) : await replyPromise;
1515
+ const outcome = await runAgentWithTimeout(
1516
+ runArgs.agentRunner,
1517
+ replyContext,
1518
+ replyTimeoutMs
1519
+ );
1530
1520
  if (outcome.status !== "completed") {
1531
1521
  await status.clear();
1532
1522
  const onAuthPause = runArgs.onAuthPause;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-PGJBNO3I.js";
4
+ } from "./chunk-XFZLQANQ.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  credentialUserSubjectId
3
- } from "./chunk-RUIXF3YQ.js";
3
+ } from "./chunk-BDUENQD3.js";
4
4
  import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-HMU2QP5M.js";
8
+ } from "./chunk-7NYEB2TM.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-WTKAALLV.js";
3
+ } from "./chunk-Y7ZUBP2K.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-PGJBNO3I.js";
3
+ } from "./chunk-XFZLQANQ.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -3,16 +3,16 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-PGJBNO3I.js";
6
+ } from "./chunk-XFZLQANQ.js";
7
7
  import {
8
8
  parseSlackChannelReferenceId
9
- } from "./chunk-F3B2YJ76.js";
9
+ } from "./chunk-V7YE4WCP.js";
10
10
  import {
11
11
  logWarn,
12
12
  setSpanAttributes,
13
13
  setSpanStatus,
14
14
  withSpan
15
- } from "./chunk-HMU2QP5M.js";
15
+ } from "./chunk-7NYEB2TM.js";
16
16
 
17
17
  // src/chat/slack/client.ts
18
18
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-JY2HJYJT.js";
3
+ } from "./chunk-RN3AWYEP.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -2,7 +2,7 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-ISEROVYZ.js";
5
+ } from "./chunk-4K5N6HTX.js";
6
6
  import {
7
7
  pluginTaskId,
8
8
  pluginTaskParamsSchema,
@@ -22,7 +22,7 @@ import {
22
22
  markTurnCompleted,
23
23
  normalizeToolNameFromResult,
24
24
  stripRuntimeTurnContext
25
- } from "./chunk-5QBK3QHJ.js";
25
+ } from "./chunk-J2SYI36O.js";
26
26
  import {
27
27
  JUNIOR_THREAD_STATE_TTL_MS
28
28
  } from "./chunk-3Y47VMHV.js";
@@ -33,35 +33,35 @@ import {
33
33
  createPluginModel,
34
34
  createPluginState,
35
35
  getPlugins
36
- } from "./chunk-2J4VCHRX.js";
36
+ } from "./chunk-V57LZDHN.js";
37
37
  import {
38
38
  getConversationStore,
39
39
  getDb,
40
40
  sameActorIdentity
41
- } from "./chunk-XAYXN4EG.js";
41
+ } from "./chunk-JJX77MB7.js";
42
42
  import {
43
43
  juniorConversations,
44
44
  juniorTaskExecutions
45
- } from "./chunk-ET54Q4TD.js";
45
+ } from "./chunk-773XC7P4.js";
46
46
  import {
47
47
  getStateAdapter
48
- } from "./chunk-XQPKMLRI.js";
48
+ } from "./chunk-SDRJ2LE3.js";
49
49
  import {
50
50
  ProviderError,
51
51
  findProviderError,
52
52
  getProviderErrorAttributes,
53
53
  getProviderErrorUserMessage
54
- } from "./chunk-PGJBNO3I.js";
54
+ } from "./chunk-XFZLQANQ.js";
55
55
  import {
56
56
  credentialSubjectSchema
57
- } from "./chunk-RUIXF3YQ.js";
57
+ } from "./chunk-BDUENQD3.js";
58
58
  import {
59
59
  parseSlackMessageTs
60
- } from "./chunk-F3B2YJ76.js";
60
+ } from "./chunk-V7YE4WCP.js";
61
61
  import {
62
62
  buildTurnFailureResponse,
63
63
  logWarn
64
- } from "./chunk-HMU2QP5M.js";
64
+ } from "./chunk-7NYEB2TM.js";
65
65
 
66
66
  // src/chat/runtime/delivered-turn-state.ts
67
67
  function buildDeliveredTurnStatePatch(args) {
@@ -87,7 +87,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
87
87
 
88
88
  // src/chat/services/turn-session-routing.ts
89
89
  async function resolveTurnSessionRouting(args) {
90
- const conversationStore = args.conversationStore ?? (await import("./db-QNQM5YRR.js")).getConversationStore();
90
+ const conversationStore = args.conversationStore ?? (await import("./db-WT7P56AH.js")).getConversationStore();
91
91
  const conversation = await conversationStore.get({
92
92
  conversationId: args.conversationId
93
93
  });
@@ -4,45 +4,43 @@ import {
4
4
  isConversationScopedChannel,
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId
7
- } from "./chunk-JAJVUQV7.js";
7
+ } from "./chunk-TKJ7277U.js";
8
8
  import {
9
9
  getConversationEventStore,
10
10
  getDb
11
- } from "./chunk-XAYXN4EG.js";
11
+ } from "./chunk-JJX77MB7.js";
12
12
  import {
13
13
  juniorConversationAnnotations,
14
14
  juniorConversationEvents,
15
15
  juniorIdentities,
16
16
  juniorUsers
17
- } from "./chunk-ET54Q4TD.js";
17
+ } from "./chunk-773XC7P4.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT
20
20
  } from "./chunk-EM225ITJ.js";
21
21
  import {
22
22
  getStateAdapter
23
- } from "./chunk-XQPKMLRI.js";
23
+ } from "./chunk-SDRJ2LE3.js";
24
24
  import {
25
25
  botConfig,
26
26
  completeObject,
27
27
  embedTexts,
28
28
  getSlackBotToken,
29
29
  standardModelId
30
- } from "./chunk-PGJBNO3I.js";
30
+ } from "./chunk-XFZLQANQ.js";
31
31
  import {
32
32
  isActorUserId,
33
- parseActorUserId
34
- } from "./chunk-HZF5P5UN.js";
35
- import {
33
+ parseActorUserId,
36
34
  parseSlackChannelReferenceId,
37
35
  parseSlackMessageTs,
38
36
  parseSlackTeamId
39
- } from "./chunk-F3B2YJ76.js";
37
+ } from "./chunk-V7YE4WCP.js";
40
38
  import {
41
39
  logException,
42
40
  logInfo,
43
41
  logWarn,
44
42
  normalizeIdentityEmail
45
- } from "./chunk-HMU2QP5M.js";
43
+ } from "./chunk-7NYEB2TM.js";
46
44
 
47
45
  // src/chat/plugins/agent-hooks.ts
48
46
  import {
@@ -1,17 +1,63 @@
1
- import {
2
- parseSlackTeamId
3
- } from "./chunk-F3B2YJ76.js";
1
+ // src/chat/slack/timestamp.ts
2
+ import { z } from "zod";
3
+ var slackMessageTsSchema = z.string().trim().regex(/^\d+(?:\.\d+)?$/).brand();
4
+ function parseSlackMessageTs(value) {
5
+ const parsed = slackMessageTsSchema.safeParse(value);
6
+ return parsed.success ? parsed.data : void 0;
7
+ }
8
+
9
+ // src/chat/slack/ids.ts
10
+ import { z as z2 } from "zod";
11
+ var slackChannelIdSchema = z2.string().regex(/^[CDG][A-Z0-9]+$/).brand();
12
+ var slackTeamIdSchema = z2.string().regex(/^T[A-Z0-9]+$/).brand();
13
+ var slackUserIdSchema = z2.string().regex(/^[UW][A-Z0-9]+$/).brand();
14
+ function slackChannelReferenceCandidate(value) {
15
+ const trimmed = value.trim();
16
+ if (!trimmed.startsWith("slack:")) {
17
+ return trimmed;
18
+ }
19
+ const parts = trimmed.split(":");
20
+ if (parts.length === 2) {
21
+ return parts[1]?.trim() ?? "";
22
+ }
23
+ if (parts.length === 3 && parseSlackMessageTs(parts[2])) {
24
+ return parts[1]?.trim() ?? "";
25
+ }
26
+ return "";
27
+ }
28
+ function parseSlackChannelId(value) {
29
+ if (typeof value !== "string") return void 0;
30
+ const parsed = slackChannelIdSchema.safeParse(value.trim());
31
+ return parsed.success ? parsed.data : void 0;
32
+ }
33
+ function parseSlackChannelReferenceId(value) {
34
+ if (typeof value !== "string") return void 0;
35
+ const parsed = slackChannelIdSchema.safeParse(
36
+ slackChannelReferenceCandidate(value)
37
+ );
38
+ return parsed.success ? parsed.data : void 0;
39
+ }
40
+ function parseSlackTeamId(value) {
41
+ if (typeof value !== "string") return void 0;
42
+ const parsed = slackTeamIdSchema.safeParse(value.trim());
43
+ return parsed.success ? parsed.data : void 0;
44
+ }
45
+ function parseSlackUserId(value) {
46
+ if (typeof value !== "string") return void 0;
47
+ const parsed = slackUserIdSchema.safeParse(value.trim());
48
+ return parsed.success ? parsed.data : void 0;
49
+ }
4
50
 
5
51
  // src/chat/actor.ts
6
- import { z } from "zod";
52
+ import { z as z3 } from "zod";
7
53
  import { actorSchema } from "@sentry/junior-plugin-api";
8
54
  var SLACK_USER_ID_DISPLAY_PATTERN = /^[UW][A-Z0-9]{5,}$/;
9
55
  var EMAIL_PATTERN = /^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;
10
- var exactStoredStringSchema = z.string().min(1).refine((value) => value === value.trim());
11
- var storedSlackActorSchema = z.object({
56
+ var exactStoredStringSchema = z3.string().min(1).refine((value) => value === value.trim());
57
+ var storedSlackActorSchema = z3.object({
12
58
  email: exactStoredStringSchema.optional(),
13
59
  fullName: exactStoredStringSchema.optional(),
14
- platform: z.literal("slack").optional(),
60
+ platform: z3.literal("slack").optional(),
15
61
  slackUserId: exactStoredStringSchema.optional(),
16
62
  slackUserName: exactStoredStringSchema.optional(),
17
63
  teamId: exactStoredStringSchema.optional()
@@ -170,6 +216,11 @@ function createSlackResumeActor(args) {
170
216
  }
171
217
 
172
218
  export {
219
+ parseSlackMessageTs,
220
+ parseSlackChannelId,
221
+ parseSlackChannelReferenceId,
222
+ parseSlackTeamId,
223
+ parseSlackUserId,
173
224
  isUserActor,
174
225
  parseActorUserId,
175
226
  isActorUserId,
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-VXWTGOLW.js";
6
+ } from "./chunk-2WLJDM23.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-HMU2QP5M.js";
14
+ } from "./chunk-7NYEB2TM.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createWebAuthorization,
3
3
  deleteWebAuthorization
4
- } from "./chunk-37LMRT7G.js";
4
+ } from "./chunk-KTVHAHUV.js";
5
5
  import {
6
6
  appendAndEnqueueInboundMessage
7
- } from "./chunk-A5SROS6H.js";
7
+ } from "./chunk-ELOTIL5F.js";
8
8
  import {
9
9
  buildDeliveredTurnStatePatch,
10
10
  completeAuthPauseTurn,
@@ -12,20 +12,20 @@ import {
12
12
  getTurnUserMessage,
13
13
  processPluginTask,
14
14
  scheduleSessionCompletedPluginTasks
15
- } from "./chunk-2NS3ACHB.js";
15
+ } from "./chunk-UWTXAYBP.js";
16
16
  import {
17
17
  ConversationTurnLifecycleService,
18
18
  coerceThreadConversationState,
19
19
  getPersistedSandboxState,
20
20
  getPersistedThreadState,
21
21
  persistThreadStateById
22
- } from "./chunk-ISEROVYZ.js";
22
+ } from "./chunk-4K5N6HTX.js";
23
23
  import {
24
24
  healthReportSchema
25
25
  } from "./chunk-UTL3MHPC.js";
26
26
  import {
27
27
  parseSlackThreadId
28
- } from "./chunk-TIV3PX5H.js";
28
+ } from "./chunk-APHDJYN7.js";
29
29
  import {
30
30
  TurnInputCommitLostError,
31
31
  abandonTurnRecord,
@@ -48,26 +48,26 @@ import {
48
48
  saveTurnCheckpoint,
49
49
  startActiveTurn,
50
50
  upsertConversationMessage
51
- } from "./chunk-5QBK3QHJ.js";
51
+ } from "./chunk-J2SYI36O.js";
52
52
  import {
53
53
  normalizeSlackConversationId
54
- } from "./chunk-JAJVUQV7.js";
54
+ } from "./chunk-TKJ7277U.js";
55
55
  import {
56
56
  getConversationEventStore,
57
57
  getConversationStore
58
- } from "./chunk-XAYXN4EG.js";
58
+ } from "./chunk-JJX77MB7.js";
59
59
  import {
60
60
  getSlackBotToken
61
- } from "./chunk-PGJBNO3I.js";
61
+ } from "./chunk-XFZLQANQ.js";
62
62
  import {
63
63
  credentialContextForActor
64
- } from "./chunk-RUIXF3YQ.js";
64
+ } from "./chunk-BDUENQD3.js";
65
65
  import {
66
66
  logException,
67
67
  logWarn,
68
68
  setTags,
69
69
  withLogContext
70
- } from "./chunk-HMU2QP5M.js";
70
+ } from "./chunk-7NYEB2TM.js";
71
71
 
72
72
  // src/handlers/health.ts
73
73
  function readHealthReport() {
@@ -561,6 +561,7 @@ function createApiTurnWorker(options) {
561
561
  text: normalizeConversationText(text),
562
562
  createdAtMs: startedAtMs,
563
563
  author: {
564
+ ...actor.email ? { email: actor.email } : {},
564
565
  ...actor.fullName ? { fullName: actor.fullName } : {},
565
566
  userId: actor.userId,
566
567
  ...actor.userName ? { userName: actor.userName } : {}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-A5SROS6H.js";
3
+ } from "./chunk-ELOTIL5F.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-ISEROVYZ.js";
9
+ } from "./chunk-4K5N6HTX.js";
10
10
  import {
11
11
  AgentInvocationBusyError,
12
12
  AgentInvocationLimitError,
@@ -15,7 +15,7 @@ import {
15
15
  agentBindingSchema,
16
16
  agentInvocationSchema,
17
17
  createAgentInvocationSchema
18
- } from "./chunk-5TXDKTET.js";
18
+ } from "./chunk-CPQBTTI6.js";
19
19
  import {
20
20
  TurnInputCommitLostError,
21
21
  failTurnRecord,
@@ -26,16 +26,16 @@ import {
26
26
  isTurnInputCommitLostError,
27
27
  openConversationProjection,
28
28
  saveTurnCheckpoint
29
- } from "./chunk-5QBK3QHJ.js";
29
+ } from "./chunk-J2SYI36O.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-XAYXN4EG.js";
34
+ } from "./chunk-JJX77MB7.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-ET54Q4TD.js";
38
+ } from "./chunk-773XC7P4.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";