@sentry/junior 0.154.0 → 0.156.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 (96) hide show
  1. package/dist/{agent-hooks-VEHV2QUA.js → agent-hooks-CCAR46PQ.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 +2 -0
  5. package/dist/api/schema/conversation.d.ts +22 -4
  6. package/dist/api/schema/location.d.ts +2 -0
  7. package/dist/api/schema/person.d.ts +2 -0
  8. package/dist/api/schema.js +1 -1
  9. package/dist/api.js +331 -188
  10. package/dist/app.js +154 -51
  11. package/dist/catalog-runtime-3SNKYCBG.js +16 -0
  12. package/dist/chat/agent/types.d.ts +2 -0
  13. package/dist/chat/attachments/storage.d.ts +12 -0
  14. package/dist/chat/attachments/store.d.ts +52 -0
  15. package/dist/chat/attachments/vercel.d.ts +3 -0
  16. package/dist/chat/conversations/retention.d.ts +4 -0
  17. package/dist/chat/conversations/sql/event-actor.d.ts +14 -0
  18. package/dist/chat/conversations/sql/event-lock.d.ts +1 -1
  19. package/dist/chat/conversations/sql/participants.d.ts +17 -0
  20. package/dist/chat/ingress/bot-mention.d.ts +13 -0
  21. package/dist/chat/plugins/unfinished-work.d.ts +8 -0
  22. package/dist/chat/runtime/agent-runner.d.ts +4 -0
  23. package/dist/chat/runtime/slack-resume.d.ts +1 -1
  24. package/dist/chat/services/conversation-memory.d.ts +1 -1
  25. package/dist/chat/slack/tools/send-files.d.ts +17 -11
  26. package/dist/chat/state/conversation.d.ts +3 -1
  27. package/dist/chat/tools/types.d.ts +2 -0
  28. package/dist/{chunk-XYMCZGH6.js → chunk-3FFUC32L.js} +8 -10
  29. package/dist/{chunk-4U4MNYGP.js → chunk-3L2PMOSR.js} +6 -8
  30. package/dist/{chunk-PTJ75ZWR.js → chunk-4ZZDTHFC.js} +94 -9
  31. package/dist/{chunk-DAJZZFU7.js → chunk-53W3LZEW.js} +386 -93
  32. package/dist/{chunk-F7QUK3YP.js → chunk-6CINHXIL.js} +5 -5
  33. package/dist/{chunk-6VWMX7NS.js → chunk-6JUU7J2B.js} +4 -4
  34. package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
  35. package/dist/{chunk-O4AQDOKA.js → chunk-7RAETIYO.js} +7 -7
  36. package/dist/{chunk-4R2XCKUH.js → chunk-A6WPDFHQ.js} +1 -1
  37. package/dist/{chunk-CZD6M57V.js → chunk-AIJRG227.js} +191 -126
  38. package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
  39. package/dist/{chunk-NUG3VYHL.js → chunk-CK2H7CFO.js} +2 -2
  40. package/dist/{chunk-HOGJ6TBT.js → chunk-CN2XSVKF.js} +6 -6
  41. package/dist/{chunk-3567VGCN.js → chunk-EDJ64P2P.js} +1 -1
  42. package/dist/{chunk-6PJXR4BC.js → chunk-GKC43TLS.js} +2 -2
  43. package/dist/{chunk-A6LWN4K6.js → chunk-GSBPZHLQ.js} +11 -11
  44. package/dist/{chunk-Y654CTW2.js → chunk-IIO5PFZX.js} +366 -138
  45. package/dist/{chunk-F2Q3ZHW2.js → chunk-IZEBHYI4.js} +1 -1
  46. package/dist/{chunk-QGR6QTC4.js → chunk-JUJR6WTL.js} +4 -4
  47. package/dist/{chunk-ZQT4RHUO.js → chunk-KBGMYLSV.js} +4 -1
  48. package/dist/{chunk-DK2FSQHS.js → chunk-KCA5MKHU.js} +5 -5
  49. package/dist/{chunk-NNN2WYAD.js → chunk-MC57E5U5.js} +1 -1
  50. package/dist/{chunk-6AF5GOZA.js → chunk-MJE7XKWP.js} +1 -1
  51. package/dist/{chunk-7CPN5JTA.js → chunk-NTNU6T2D.js} +3 -3
  52. package/dist/{chunk-NG4IAOVD.js → chunk-OGZPRMZA.js} +1 -1
  53. package/dist/{chunk-UCH55IGZ.js → chunk-OMQJB7YN.js} +28 -37
  54. package/dist/{chunk-2XNVS6RC.js → chunk-PMFGVLDU.js} +12 -11
  55. package/dist/{chunk-65IAU2L2.js → chunk-SE3D225X.js} +1 -1
  56. package/dist/{chunk-CCAU73CE.js → chunk-SRJA6QLM.js} +2 -2
  57. package/dist/{chunk-7RFWIHPM.js → chunk-TN4LVILT.js} +5 -5
  58. package/dist/{chunk-3ZR2R5EQ.js → chunk-TNXGMFWV.js} +1 -1
  59. package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
  60. package/dist/{chunk-MSOZLASC.js → chunk-WD7SEUZO.js} +2 -2
  61. package/dist/{chunk-UG5UCHHJ.js → chunk-X5NZQH5U.js} +4 -2
  62. package/dist/{chunk-3HX67UPN.js → chunk-X7W45B5G.js} +1 -1
  63. package/dist/{chunk-FVY7AJ46.js → chunk-ZNWRYNCA.js} +7 -7
  64. package/dist/cli/chat.js +36 -36
  65. package/dist/cli/check.js +8 -9
  66. package/dist/cli/init.js +41 -7
  67. package/dist/cli/plugins.js +15 -16
  68. package/dist/cli/snapshot-create.js +11 -12
  69. package/dist/cli/upgrade.js +9 -10
  70. package/dist/db/schema/attachments.d.ts +178 -0
  71. package/dist/db/schema/conversation-events.d.ts +20 -0
  72. package/dist/db/schema/conversation-participants.d.ts +63 -0
  73. package/dist/db/schema.d.ts +255 -1
  74. package/dist/{db-SOJJLMJK.js → db-TYUUKGJX.js} +8 -8
  75. package/dist/handlers/retention.d.ts +4 -1
  76. package/dist/instrumentation.js +4 -4
  77. package/dist/nitro.js +2 -2
  78. package/dist/{oauth-callback-server-GCJROMVO.js → oauth-callback-server-AWVDKPR5.js} +26 -26
  79. package/dist/{runner-SY6KDQCN.js → runner-JUQXMACC.js} +15 -16
  80. package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
  81. package/dist/{skills-XJ2LJ2ML.js → skills-4GZTZX4V.js} +8 -9
  82. package/dist/spawn-32SSRWU4.js +37 -0
  83. package/dist/{validation-XQWY6QRY.js → validation-DRLNJRND.js} +8 -9
  84. package/dist/version.js +1 -1
  85. package/dist/{work-FFT5JAOU.js → work-TGIXRRJY.js} +20 -21
  86. package/dist/worker-IFXZOYED.js +24 -0
  87. package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
  88. package/migrations/0027_attachment_storage.sql +16 -0
  89. package/migrations/meta/0026_snapshot.json +2424 -0
  90. package/migrations/meta/0027_snapshot.json +2554 -0
  91. package/migrations/meta/_journal.json +15 -1
  92. package/package.json +10 -7
  93. package/dist/catalog-runtime-AK5MY63F.js +0 -17
  94. package/dist/chunk-F3B2YJ76.js +0 -57
  95. package/dist/spawn-QFCQREEP.js +0 -38
  96. package/dist/worker-JAITK72F.js +0 -25
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-HOGJ6TBT.js";
3
+ } from "./chunk-CN2XSVKF.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-4R2XCKUH.js";
3
+ } from "./chunk-A6WPDFHQ.js";
4
4
  import {
5
5
  CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
6
6
  CONVERSATION_WORK_MAX_RETRIES,
@@ -21,20 +21,20 @@ import {
21
21
  releaseConversationWork,
22
22
  requestAnotherSlice,
23
23
  startConversationWork
24
- } from "./chunk-F7QUK3YP.js";
24
+ } from "./chunk-6CINHXIL.js";
25
25
  import {
26
26
  ConversationQueueMessageRejectedError
27
27
  } from "./chunk-JAL3CH4G.js";
28
28
  import {
29
29
  getChatConfig,
30
30
  isProviderRetryError
31
- } from "./chunk-6PJXR4BC.js";
31
+ } from "./chunk-GKC43TLS.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-3HX67UPN.js";
37
+ } from "./chunk-X7W45B5G.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.154.0",
4
+ version: "0.156.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -77,10 +77,13 @@ var package_default = {
77
77
  "@logtape/logtape": "^2.1.1",
78
78
  "@modelcontextprotocol/sdk": "1.29.0",
79
79
  "@neondatabase/serverless": "^1.1.0",
80
+ "@opentelemetry/api": "catalog:",
81
+ "@opentelemetry/core": "catalog:",
80
82
  "@sentry/junior-plugin-api": "workspace:*",
81
83
  "@sentry/node": "catalog:",
82
84
  "@sinclair/typebox": "^0.34.49",
83
85
  "@slack/web-api": "^7.16.0",
86
+ "@vercel/blob": "^2.4.0",
84
87
  "@vercel/functions": "^3.6.0",
85
88
  "@vercel/oidc": "^3.4.1",
86
89
  "@vercel/queue": "^0.2.0",
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-4U4MNYGP.js";
3
+ } from "./chunk-3L2PMOSR.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-XYMCZGH6.js";
7
+ } from "./chunk-3FFUC32L.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-Y654CTW2.js";
10
+ } from "./chunk-IIO5PFZX.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-CZD6M57V.js";
16
+ } from "./chunk-AIJRG227.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-3HX67UPN.js";
22
+ } from "./chunk-X7W45B5G.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
  getChatConfig
3
- } from "./chunk-6PJXR4BC.js";
3
+ } from "./chunk-GKC43TLS.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-3HX67UPN.js";
3
+ } from "./chunk-X7W45B5G.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -3,16 +3,16 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-6PJXR4BC.js";
6
+ } from "./chunk-GKC43TLS.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-3HX67UPN.js";
15
+ } from "./chunk-X7W45B5G.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
  JUNIOR_VERSION
3
- } from "./chunk-ZQT4RHUO.js";
3
+ } from "./chunk-KBGMYLSV.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-FA6POGLH.js";
4
4
  import {
5
5
  getTurnRequestDeadline
6
- } from "./chunk-4R2XCKUH.js";
6
+ } from "./chunk-A6WPDFHQ.js";
7
7
  import {
8
8
  buildSentryConversationUrl,
9
9
  deleteWebAuthorization
10
- } from "./chunk-65IAU2L2.js";
10
+ } from "./chunk-SE3D225X.js";
11
11
  import {
12
12
  ensureConversationWake,
13
13
  requestConversationWork
14
- } from "./chunk-F7QUK3YP.js";
14
+ } from "./chunk-6CINHXIL.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-A6LWN4K6.js";
27
+ } from "./chunk-GSBPZHLQ.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-7RFWIHPM.js";
36
+ } from "./chunk-TN4LVILT.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-PTJ75ZWR.js";
48
+ resolvePluginOAuthAccount,
49
+ runAgentWithTimeout
50
+ } from "./chunk-4ZZDTHFC.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-O4AQDOKA.js";
66
+ } from "./chunk-7RAETIYO.js";
66
67
  import {
67
68
  parseSlackThreadId,
68
69
  readSlackRawMessageContext,
69
70
  resolveSlackChannelIdFromMessage,
70
71
  resolveSlackChannelIdFromThreadId
71
- } from "./chunk-NUG3VYHL.js";
72
+ } from "./chunk-CK2H7CFO.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-4U4MNYGP.js";
99
+ } from "./chunk-3L2PMOSR.js";
99
100
  import {
100
101
  getDashboardConversationLink,
101
102
  getPluginSlackConversationLink
102
- } from "./chunk-XYMCZGH6.js";
103
+ } from "./chunk-3FFUC32L.js";
103
104
  import {
104
105
  SlackActionError,
105
106
  getHeaderString,
106
107
  getSlackClient,
107
108
  isDmChannel,
108
109
  normalizeSlackConversationId
109
- } from "./chunk-7CPN5JTA.js";
110
+ } from "./chunk-NTNU6T2D.js";
110
111
  import {
111
112
  getConversationEventStore,
112
113
  getSqlExecutor,
113
114
  requireSlackDestination,
114
115
  upsertIdentity,
115
116
  upsertLinkedIdentity
116
- } from "./chunk-Y654CTW2.js";
117
+ } from "./chunk-IIO5PFZX.js";
117
118
  import {
118
119
  acquireActiveLock,
119
120
  getStateAdapter
120
- } from "./chunk-NNN2WYAD.js";
121
+ } from "./chunk-MC57E5U5.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-6PJXR4BC.js";
129
+ } from "./chunk-GKC43TLS.js";
129
130
  import {
130
131
  discoverSkills
131
- } from "./chunk-CCAU73CE.js";
132
+ } from "./chunk-SRJA6QLM.js";
132
133
  import {
133
134
  pluginCatalogRuntime
134
- } from "./chunk-3567VGCN.js";
135
+ } from "./chunk-EDJ64P2P.js";
135
136
  import {
136
137
  buildOAuthTokenRequest,
137
138
  hasRequiredOAuthScope,
138
139
  parseOAuthTokenResponse
139
- } from "./chunk-MSOZLASC.js";
140
+ } from "./chunk-WD7SEUZO.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-3HX67UPN.js";
156
+ } from "./chunk-X7W45B5G.js";
158
157
  import {
159
158
  homeDir
160
159
  } from "./chunk-H4HBKISO.js";
@@ -1433,6 +1432,7 @@ async function resumeSlackTurnInContext(args) {
1433
1432
  const recordedMessageId = recordDeliveredAssistantMessage({
1434
1433
  conversation: deliveryState2.conversation,
1435
1434
  sessionId: deliveryState2.sessionId,
1435
+ source: "slack",
1436
1436
  text,
1437
1437
  userMessageId: deliveryState2.userMessageId
1438
1438
  });
@@ -1512,21 +1512,12 @@ async function resumeSlackTurnInContext(args) {
1512
1512
  surface: "slack"
1513
1513
  });
1514
1514
  }
1515
- const replyPromise = runArgs.agentRunner.run(replyContext);
1516
1515
  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;
1516
+ const outcome = await runAgentWithTimeout(
1517
+ runArgs.agentRunner,
1518
+ replyContext,
1519
+ replyTimeoutMs
1520
+ );
1530
1521
  if (outcome.status !== "completed") {
1531
1522
  await status.clear();
1532
1523
  const onAuthPause = runArgs.onAuthPause;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createWebAuthorization,
3
3
  deleteWebAuthorization
4
- } from "./chunk-65IAU2L2.js";
4
+ } from "./chunk-SE3D225X.js";
5
5
  import {
6
6
  appendAndEnqueueInboundMessage
7
- } from "./chunk-F7QUK3YP.js";
7
+ } from "./chunk-6CINHXIL.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-A6LWN4K6.js";
15
+ } from "./chunk-GSBPZHLQ.js";
16
16
  import {
17
17
  ConversationTurnLifecycleService,
18
18
  coerceThreadConversationState,
19
19
  getPersistedSandboxState,
20
20
  getPersistedThreadState,
21
21
  persistThreadStateById
22
- } from "./chunk-7RFWIHPM.js";
22
+ } from "./chunk-TN4LVILT.js";
23
23
  import {
24
24
  healthReportSchema
25
25
  } from "./chunk-UTL3MHPC.js";
26
26
  import {
27
27
  parseSlackThreadId
28
- } from "./chunk-NUG3VYHL.js";
28
+ } from "./chunk-CK2H7CFO.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-4U4MNYGP.js";
51
+ } from "./chunk-3L2PMOSR.js";
52
52
  import {
53
53
  normalizeSlackConversationId
54
- } from "./chunk-7CPN5JTA.js";
54
+ } from "./chunk-NTNU6T2D.js";
55
55
  import {
56
56
  getConversationEventStore,
57
57
  getConversationStore
58
- } from "./chunk-Y654CTW2.js";
58
+ } from "./chunk-IIO5PFZX.js";
59
59
  import {
60
60
  getSlackBotToken
61
- } from "./chunk-6PJXR4BC.js";
61
+ } from "./chunk-GKC43TLS.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-3HX67UPN.js";
70
+ } from "./chunk-X7W45B5G.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,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-NNN2WYAD.js";
3
+ } from "./chunk-MC57E5U5.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-6GWA276C.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-3567VGCN.js";
3
+ } from "./chunk-EDJ64P2P.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-3HX67UPN.js";
6
+ } from "./chunk-X7W45B5G.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-4U4MNYGP.js";
3
+ } from "./chunk-3L2PMOSR.js";
4
4
  import {
5
5
  JUNIOR_THREAD_STATE_TTL_MS
6
6
  } from "./chunk-3Y47VMHV.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-Y654CTW2.js";
9
+ } from "./chunk-IIO5PFZX.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-CZD6M57V.js";
12
+ } from "./chunk-AIJRG227.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-NNN2WYAD.js";
15
+ } from "./chunk-MC57E5U5.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -20,7 +20,7 @@ import {
20
20
  isRecord,
21
21
  toOptionalNumber,
22
22
  toOptionalString
23
- } from "./chunk-3HX67UPN.js";
23
+ } from "./chunk-X7W45B5G.js";
24
24
 
25
25
  // src/chat/conversations/turn-lifecycle.ts
26
26
  var ConversationTurnLifecycleService = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-3567VGCN.js";
3
+ } from "./chunk-EDJ64P2P.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -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,
@@ -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-3HX67UPN.js";
8
+ } from "./chunk-X7W45B5G.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -174,13 +174,15 @@ var conversationSummaryReportSchema = z2.object({
174
174
  locationId: z2.string().optional(),
175
175
  sentryTraceUrl: z2.string().optional(),
176
176
  sourceUrl: z2.string().url().optional(),
177
- traceId: z2.string().optional()
177
+ traceId: z2.string().optional(),
178
+ assignedWork: z2.boolean().optional(),
179
+ unfinishedWork: z2.boolean().optional()
178
180
  }).strict();
179
181
  var conversationReportMessageEventDataSchema = z2.object({
180
182
  type: z2.literal("message"),
181
183
  messageId: z2.string().min(1),
182
184
  role: z2.enum(["assistant", "system", "user"]),
183
- source: z2.literal("web").optional(),
185
+ source: z2.enum(["slack", "web"]).optional(),
184
186
  actorIdentity: actorIdentitySchema.optional(),
185
187
  eventType: z2.string().min(1).optional(),
186
188
  explicitMention: z2.boolean().optional(),
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6GWA276C.js";
10
10
  import {
11
11
  getDeploymentTelemetryAttributes
12
- } from "./chunk-NG4IAOVD.js";
12
+ } from "./chunk-OGZPRMZA.js";
13
13
 
14
14
  // src/chat/logging.ts
15
15
  import path from "path";
@@ -4,27 +4,27 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-O4AQDOKA.js";
7
+ } from "./chunk-7RAETIYO.js";
8
8
  import {
9
9
  parseSandboxEgressAuthRequiredSignal
10
- } from "./chunk-HUO3UTAQ.js";
10
+ } from "./chunk-7MA4HV4W.js";
11
11
  import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink,
14
14
  recordAuthorizationRequested
15
- } from "./chunk-4U4MNYGP.js";
15
+ } from "./chunk-3L2PMOSR.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-CZD6M57V.js";
18
+ } from "./chunk-AIJRG227.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-6PJXR4BC.js";
21
+ } from "./chunk-GKC43TLS.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-3567VGCN.js";
24
+ } from "./chunk-EDJ64P2P.js";
25
25
  import {
26
26
  credentialContextSchema
27
- } from "./chunk-RUIXF3YQ.js";
27
+ } from "./chunk-BDUENQD3.js";
28
28
 
29
29
  // src/chat/services/auth-pause.ts
30
30
  var AuthorizationPauseError = class extends Error {