@sentry/junior 0.158.0 → 0.159.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 (64) hide show
  1. package/dist/{agent-hooks-BOWFTDE5.js → agent-hooks-IAD3AANZ.js} +10 -10
  2. package/dist/api/conversations/cancel-pending-messages.d.ts +4 -0
  3. package/dist/api/schema/conversation.d.ts +13 -0
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +5 -1
  6. package/dist/api.js +87 -23
  7. package/dist/app.js +32 -32
  8. package/dist/{catalog-runtime-7GZ25WTR.js → catalog-runtime-6VANKLH5.js} +5 -5
  9. package/dist/chat/conversations/history.d.ts +4 -1
  10. package/dist/chat/slack/mrkdwn.d.ts +2 -1
  11. package/dist/chat/task-execution/state.d.ts +10 -0
  12. package/dist/chat/task-execution/store.d.ts +11 -0
  13. package/dist/{chunk-X4BLYIMV.js → chunk-27UQ7UB3.js} +6 -6
  14. package/dist/{chunk-C3FYJZSA.js → chunk-54O6IKUS.js} +4 -4
  15. package/dist/{chunk-SAJPQLTY.js → chunk-6IADZQJR.js} +1 -1
  16. package/dist/{chunk-UQJO35BP.js → chunk-AIQKUJKK.js} +4 -4
  17. package/dist/{chunk-3A7VXSPJ.js → chunk-AZW5HKC5.js} +8 -8
  18. package/dist/{chunk-YEZS4TEY.js → chunk-CNHELV2P.js} +1 -1
  19. package/dist/{chunk-4JAOLUDB.js → chunk-DJZPA72K.js} +35 -6
  20. package/dist/{chunk-JEXQQLEC.js → chunk-DXSZJAVZ.js} +18 -18
  21. package/dist/{chunk-NOEERHHR.js → chunk-EBP6IS66.js} +6 -6
  22. package/dist/{chunk-CZCMFRUQ.js → chunk-EQXVKNLM.js} +11 -0
  23. package/dist/{chunk-A7EDLNGU.js → chunk-FWDN67U3.js} +55 -4
  24. package/dist/{chunk-DTVTBZNP.js → chunk-IJ6KWS3V.js} +1 -1
  25. package/dist/{chunk-ROOTB7J7.js → chunk-K2LAI7RW.js} +2 -2
  26. package/dist/{chunk-FAJ6SMEE.js → chunk-L2PEQ2PY.js} +2 -2
  27. package/dist/{chunk-IXYGGJRA.js → chunk-LUIKMY35.js} +1 -1
  28. package/dist/{chunk-IEM3GFXL.js → chunk-NCJV265M.js} +9 -9
  29. package/dist/{chunk-4Q6QVTKA.js → chunk-NT6V5WEE.js} +5 -5
  30. package/dist/{chunk-VURJ2NSF.js → chunk-O2DZWUPQ.js} +1 -1
  31. package/dist/{chunk-6GJCOUTA.js → chunk-OGMHLKNO.js} +1 -1
  32. package/dist/{chunk-UJ6N32ZM.js → chunk-PQWWCKNB.js} +4 -4
  33. package/dist/{chunk-UPPU3FQU.js → chunk-PT7B6A3O.js} +1 -1
  34. package/dist/{chunk-PHQDXC27.js → chunk-Q5X37U6G.js} +1 -1
  35. package/dist/{chunk-AF4PHIP6.js → chunk-QODFNKQS.js} +27 -10
  36. package/dist/{chunk-EXITAVHO.js → chunk-SQOVZSWF.js} +20 -18
  37. package/dist/{chunk-KSZXVR5G.js → chunk-TD7ZQZ5W.js} +1 -1
  38. package/dist/{chunk-LUSAAJJA.js → chunk-U7D4VLUF.js} +2 -2
  39. package/dist/{chunk-SSU65ZTZ.js → chunk-UG673UVL.js} +1 -1
  40. package/dist/{chunk-4XJ2WSTI.js → chunk-UKKOKMRE.js} +5 -5
  41. package/dist/{chunk-BNFGY66A.js → chunk-UP6KQVF5.js} +1 -1
  42. package/dist/{chunk-RCIKTZZF.js → chunk-WTQ3CKC3.js} +1 -1
  43. package/dist/{chunk-FA32YRZ3.js → chunk-X7AIXRVJ.js} +5 -5
  44. package/dist/{chunk-EQ6Y37MD.js → chunk-YCBZ47LC.js} +1 -1
  45. package/dist/{chunk-KAFYW3O6.js → chunk-YSMAMSOU.js} +10 -10
  46. package/dist/cli/chat.js +30 -30
  47. package/dist/cli/check.js +6 -6
  48. package/dist/cli/plugins.js +13 -13
  49. package/dist/cli/snapshot-create.js +9 -9
  50. package/dist/cli/upgrade.js +7 -7
  51. package/dist/{db-HFWTPYT7.js → db-BIIMAPFB.js} +7 -7
  52. package/dist/instrumentation.js +4 -4
  53. package/dist/nitro.js +2 -2
  54. package/dist/{oauth-callback-server-J3NW4QL5.js → oauth-callback-server-4BENCPP3.js} +23 -23
  55. package/dist/{runner-CL6QHML5.js → runner-TUBJLEYO.js} +13 -13
  56. package/dist/{skills-WZWKZIFQ.js → skills-MBRLNBRV.js} +6 -6
  57. package/dist/spawn-ZWIXA46E.js +37 -0
  58. package/dist/{validation-4HVSSLJV.js → validation-YTJGRJYT.js} +6 -6
  59. package/dist/version.js +1 -1
  60. package/dist/{work-UF4KXPVG.js → work-5MRHKA54.js} +17 -17
  61. package/dist/worker-S2V7HZJ4.js +24 -0
  62. package/package.json +5 -5
  63. package/dist/spawn-TQJWADG4.js +0 -37
  64. package/dist/worker-HI7I2W2U.js +0 -24
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-A7EDLNGU.js";
3
+ } from "./chunk-FWDN67U3.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-4XJ2WSTI.js";
9
+ } from "./chunk-UKKOKMRE.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-FA32YRZ3.js";
18
+ } from "./chunk-X7AIXRVJ.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-C3FYJZSA.js";
29
+ } from "./chunk-54O6IKUS.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-AF4PHIP6.js";
34
+ } from "./chunk-QODFNKQS.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-VURJ2NSF.js";
38
+ } from "./chunk-O2DZWUPQ.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";
@@ -13,7 +13,7 @@ import {
13
13
  instructionProvenanceFor,
14
14
  sanitizePostgresJson,
15
15
  withConversationEventLock
16
- } from "./chunk-AF4PHIP6.js";
16
+ } from "./chunk-QODFNKQS.js";
17
17
  import {
18
18
  SANDBOX_WORKSPACE_ROOT,
19
19
  sleep
@@ -23,14 +23,14 @@ import {
23
23
  fenceLock,
24
24
  getStateAdapter,
25
25
  withLock
26
- } from "./chunk-PHQDXC27.js";
26
+ } from "./chunk-Q5X37U6G.js";
27
27
  import {
28
28
  botConfig,
29
29
  completeText,
30
30
  escapeXml,
31
31
  resolveGatewayModel,
32
32
  unwrapCurrentInstruction
33
- } from "./chunk-FAJ6SMEE.js";
33
+ } from "./chunk-L2PEQ2PY.js";
34
34
  import {
35
35
  parseSlackMessageTs,
36
36
  toStoredSlackActor
@@ -40,7 +40,7 @@ import {
40
40
  logException,
41
41
  logWarn,
42
42
  setSpanAttributes
43
- } from "./chunk-KSZXVR5G.js";
43
+ } from "./chunk-TD7ZQZ5W.js";
44
44
 
45
45
  // src/chat/turn-context-tag.ts
46
46
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-YEZS4TEY.js";
3
+ } from "./chunk-CNHELV2P.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-RCIKTZZF.js";
3
+ } from "./chunk-WTQ3CKC3.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-A7EDLNGU.js";
24
+ } from "./chunk-FWDN67U3.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-FAJ6SMEE.js";
31
+ } from "./chunk-L2PEQ2PY.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-KSZXVR5G.js";
37
+ } from "./chunk-TD7ZQZ5W.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -3,38 +3,38 @@ import {
3
3
  } from "./chunk-RF6J3DIO.js";
4
4
  import {
5
5
  resolveBaseUrl
6
- } from "./chunk-4JAOLUDB.js";
6
+ } from "./chunk-DJZPA72K.js";
7
7
  import {
8
8
  isExperimentalFeatureEnabled
9
9
  } from "./chunk-5IDFPCON.js";
10
10
  import {
11
11
  createPluginLogger,
12
12
  getPlugins
13
- } from "./chunk-NOEERHHR.js";
13
+ } from "./chunk-EBP6IS66.js";
14
14
  import {
15
15
  getSlackClient,
16
16
  withSlackRetries
17
- } from "./chunk-ROOTB7J7.js";
17
+ } from "./chunk-K2LAI7RW.js";
18
18
  import {
19
19
  getDb,
20
20
  parseDestination
21
- } from "./chunk-AF4PHIP6.js";
21
+ } from "./chunk-QODFNKQS.js";
22
22
  import {
23
23
  sleep
24
24
  } from "./chunk-EM225ITJ.js";
25
25
  import {
26
26
  acquireActiveLock,
27
27
  getStateAdapter
28
- } from "./chunk-PHQDXC27.js";
28
+ } from "./chunk-Q5X37U6G.js";
29
29
  import {
30
30
  pluginCatalogRuntime
31
- } from "./chunk-YEZS4TEY.js";
31
+ } from "./chunk-CNHELV2P.js";
32
32
  import {
33
33
  fetchWithBoundedOAuthErrorBodies
34
- } from "./chunk-EQ6Y37MD.js";
34
+ } from "./chunk-YCBZ47LC.js";
35
35
  import {
36
36
  isRecord
37
- } from "./chunk-KSZXVR5G.js";
37
+ } from "./chunk-TD7ZQZ5W.js";
38
38
 
39
39
  // src/chat/capabilities/router.ts
40
40
  var ProviderCredentialRouter = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-EQ6Y37MD.js";
3
+ } from "./chunk-YCBZ47LC.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -4,19 +4,19 @@ import {
4
4
  isDmChannel,
5
5
  normalizeSlackConversationId,
6
6
  withSlackRetries
7
- } from "./chunk-ROOTB7J7.js";
7
+ } from "./chunk-K2LAI7RW.js";
8
8
  import {
9
9
  parseDestination
10
- } from "./chunk-AF4PHIP6.js";
10
+ } from "./chunk-QODFNKQS.js";
11
11
  import {
12
12
  getStateAdapter
13
- } from "./chunk-PHQDXC27.js";
13
+ } from "./chunk-Q5X37U6G.js";
14
14
  import {
15
15
  normalizeSlackEmojiName
16
- } from "./chunk-FAJ6SMEE.js";
16
+ } from "./chunk-L2PEQ2PY.js";
17
17
  import {
18
18
  pluginCatalogRuntime
19
- } from "./chunk-YEZS4TEY.js";
19
+ } from "./chunk-CNHELV2P.js";
20
20
  import {
21
21
  parseSlackMessageTs,
22
22
  parseSlackUserId
@@ -25,7 +25,7 @@ import {
25
25
  isRecord,
26
26
  logInfo,
27
27
  logWarn
28
- } from "./chunk-KSZXVR5G.js";
28
+ } from "./chunk-TD7ZQZ5W.js";
29
29
 
30
30
  // src/chat/slack/outbound.ts
31
31
  var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
@@ -379,6 +379,29 @@ function hasUnmatchedClosingParen(text) {
379
379
  }
380
380
  return balance < 0;
381
381
  }
382
+ var GITHUB_OWNER_PATTERN = "[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?";
383
+ var GITHUB_REPO_PATTERN = "[A-Za-z0-9._-]+";
384
+ var GITHUB_REPO_ISSUE_REF_PATTERN = new RegExp(
385
+ `^(${GITHUB_OWNER_PATTERN})\\/(${GITHUB_REPO_PATTERN})#(\\d+)\\b`
386
+ );
387
+ function isGitHubRefBoundary(char) {
388
+ return char === void 0 || !/[A-Za-z0-9._-]/.test(char);
389
+ }
390
+ function readGitHubRepoIssueRef(line, start) {
391
+ if (!isGitHubRefBoundary(start === 0 ? void 0 : line[start - 1])) {
392
+ return void 0;
393
+ }
394
+ const match = GITHUB_REPO_ISSUE_REF_PATTERN.exec(line.slice(start));
395
+ if (!match) {
396
+ return void 0;
397
+ }
398
+ const [text, owner, repo, number] = match;
399
+ return {
400
+ text,
401
+ end: start + text.length,
402
+ url: `https://github.com/${owner}/${repo}/issues/${number}`
403
+ };
404
+ }
382
405
  function readBareUrl(line, start) {
383
406
  let end = start;
384
407
  while (end < line.length) {
@@ -436,6 +459,12 @@ function wrapBareUrlsOnLine(line) {
436
459
  continue;
437
460
  }
438
461
  }
462
+ const repoIssueRef = readGitHubRepoIssueRef(line, i);
463
+ if (repoIssueRef) {
464
+ result += `[${repoIssueRef.text}](${repoIssueRef.url})`;
465
+ i = repoIssueRef.end;
466
+ continue;
467
+ }
439
468
  result += line[i];
440
469
  i++;
441
470
  }
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-FA6POGLH.js";
4
4
  import {
5
5
  getTurnRequestDeadline
6
- } from "./chunk-RCIKTZZF.js";
6
+ } from "./chunk-WTQ3CKC3.js";
7
7
  import {
8
8
  buildSentryConversationUrl,
9
9
  deleteWebAuthorization
10
- } from "./chunk-SSU65ZTZ.js";
10
+ } from "./chunk-UG673UVL.js";
11
11
  import {
12
12
  ensureConversationWake,
13
13
  requestConversationWork
14
- } from "./chunk-A7EDLNGU.js";
14
+ } from "./chunk-FWDN67U3.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-IEM3GFXL.js";
27
+ } from "./chunk-NCJV265M.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-4XJ2WSTI.js";
36
+ } from "./chunk-UKKOKMRE.js";
37
37
  import {
38
38
  getVercelConversationWorkQueue
39
39
  } from "./chunk-WR76IVA5.js";
@@ -47,7 +47,7 @@ import {
47
47
  lookupSlackUserProfile,
48
48
  resolvePluginOAuthAccount,
49
49
  runAgentWithTimeout
50
- } from "./chunk-3A7VXSPJ.js";
50
+ } from "./chunk-AZW5HKC5.js";
51
51
  import {
52
52
  RetryableDeliveryError
53
53
  } from "./chunk-RF6J3DIO.js";
@@ -63,13 +63,13 @@ import {
63
63
  removeReactionFromMessage,
64
64
  resolveBaseUrl,
65
65
  truncateStatusText
66
- } from "./chunk-4JAOLUDB.js";
66
+ } from "./chunk-DJZPA72K.js";
67
67
  import {
68
68
  parseSlackThreadId,
69
69
  readSlackRawMessageContext,
70
70
  resolveSlackChannelIdFromMessage,
71
71
  resolveSlackChannelIdFromThreadId
72
- } from "./chunk-DTVTBZNP.js";
72
+ } from "./chunk-IJ6KWS3V.js";
73
73
  import {
74
74
  CooperativeTurnYieldError,
75
75
  TurnSliceLimitExceededError,
@@ -96,29 +96,29 @@ import {
96
96
  recordTurnSummary,
97
97
  saveTurnCheckpoint,
98
98
  turnHasReply
99
- } from "./chunk-C3FYJZSA.js";
99
+ } from "./chunk-54O6IKUS.js";
100
100
  import {
101
101
  getDashboardConversationLink,
102
102
  getPluginSlackConversationLink
103
- } from "./chunk-NOEERHHR.js";
103
+ } from "./chunk-EBP6IS66.js";
104
104
  import {
105
105
  SlackActionError,
106
106
  getHeaderString,
107
107
  getSlackClient,
108
108
  isDmChannel,
109
109
  normalizeSlackConversationId
110
- } from "./chunk-ROOTB7J7.js";
110
+ } from "./chunk-K2LAI7RW.js";
111
111
  import {
112
112
  getConversationEventStore,
113
113
  getSqlExecutor,
114
114
  requireSlackDestination,
115
115
  upsertIdentity,
116
116
  upsertLinkedIdentity
117
- } from "./chunk-AF4PHIP6.js";
117
+ } from "./chunk-QODFNKQS.js";
118
118
  import {
119
119
  acquireActiveLock,
120
120
  getStateAdapter
121
- } from "./chunk-PHQDXC27.js";
121
+ } from "./chunk-Q5X37U6G.js";
122
122
  import {
123
123
  botConfig,
124
124
  escapeXml,
@@ -126,18 +126,18 @@ import {
126
126
  getRuntimeMetadata,
127
127
  normalizeSlackEmojiName,
128
128
  standardModelId
129
- } from "./chunk-FAJ6SMEE.js";
129
+ } from "./chunk-L2PEQ2PY.js";
130
130
  import {
131
131
  discoverSkills
132
- } from "./chunk-LUSAAJJA.js";
132
+ } from "./chunk-U7D4VLUF.js";
133
133
  import {
134
134
  pluginCatalogRuntime
135
- } from "./chunk-YEZS4TEY.js";
135
+ } from "./chunk-CNHELV2P.js";
136
136
  import {
137
137
  buildOAuthTokenRequest,
138
138
  hasRequiredOAuthScope,
139
139
  parseOAuthTokenResponse
140
- } from "./chunk-EQ6Y37MD.js";
140
+ } from "./chunk-YCBZ47LC.js";
141
141
  import {
142
142
  createSlackResumeActor,
143
143
  isUserActor,
@@ -153,7 +153,7 @@ import {
153
153
  setTags,
154
154
  toOptionalString,
155
155
  withLogContext
156
- } from "./chunk-KSZXVR5G.js";
156
+ } from "./chunk-TD7ZQZ5W.js";
157
157
  import {
158
158
  homeDir
159
159
  } from "./chunk-H4HBKISO.js";
@@ -4,30 +4,30 @@ import {
4
4
  isConversationScopedChannel,
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId
7
- } from "./chunk-ROOTB7J7.js";
7
+ } from "./chunk-K2LAI7RW.js";
8
8
  import {
9
9
  getConversationEventStore,
10
10
  getDb
11
- } from "./chunk-AF4PHIP6.js";
11
+ } from "./chunk-QODFNKQS.js";
12
12
  import {
13
13
  juniorConversationAnnotations,
14
14
  juniorConversationEvents,
15
15
  juniorIdentities,
16
16
  juniorUsers
17
- } from "./chunk-VURJ2NSF.js";
17
+ } from "./chunk-O2DZWUPQ.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT
20
20
  } from "./chunk-EM225ITJ.js";
21
21
  import {
22
22
  getStateAdapter
23
- } from "./chunk-PHQDXC27.js";
23
+ } from "./chunk-Q5X37U6G.js";
24
24
  import {
25
25
  botConfig,
26
26
  completeObject,
27
27
  embedTexts,
28
28
  getSlackBotToken,
29
29
  standardModelId
30
- } from "./chunk-FAJ6SMEE.js";
30
+ } from "./chunk-L2PEQ2PY.js";
31
31
  import {
32
32
  isActorUserId,
33
33
  parseActorUserId,
@@ -40,7 +40,7 @@ import {
40
40
  logInfo,
41
41
  logWarn,
42
42
  normalizeIdentityEmail
43
- } from "./chunk-KSZXVR5G.js";
43
+ } from "./chunk-TD7ZQZ5W.js";
44
44
 
45
45
  // src/chat/plugins/agent-hooks.ts
46
46
  import {
@@ -133,6 +133,15 @@ var conversationPendingMessagesReportSchema = z2.object({
133
133
  generatedAt: z2.string().datetime(),
134
134
  messages: z2.array(conversationPendingMessageSchema)
135
135
  }).strict();
136
+ var cancelConversationPendingMessagesBodySchema = z2.object({
137
+ inboundMessageIds: z2.array(z2.string().min(1)).min(1).optional(),
138
+ receivedBefore: z2.string().datetime().optional()
139
+ }).strict();
140
+ var cancelConversationPendingMessagesResponseSchema = z2.object({
141
+ cancelledCount: z2.number().int().nonnegative(),
142
+ cancelledInboundMessageIds: z2.array(z2.string().min(1)),
143
+ conversationId: z2.string().min(1)
144
+ }).strict();
136
145
  var conversationAuxiliaryCostsSchema = z2.object({
137
146
  costUsd: z2.number().finite().nonnegative(),
138
147
  operations: z2.array(
@@ -810,6 +819,8 @@ export {
810
819
  conversationPendingMessageSchema,
811
820
  conversationPendingAuthorizationSchema,
812
821
  conversationPendingMessagesReportSchema,
822
+ cancelConversationPendingMessagesBodySchema,
823
+ cancelConversationPendingMessagesResponseSchema,
813
824
  conversationAuxiliaryCostsSchema,
814
825
  conversationSummaryReportSchema,
815
826
  conversationReportEventDataSchema,
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-AF4PHIP6.js";
11
+ } from "./chunk-QODFNKQS.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-PHQDXC27.js";
15
+ } from "./chunk-Q5X37U6G.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-FAJ6SMEE.js";
18
+ } from "./chunk-L2PEQ2PY.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-V7YE4WCP.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-KSZXVR5G.js";
26
+ } from "./chunk-TD7ZQZ5W.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -984,6 +984,49 @@ async function ackMessages(args) {
984
984
  return true;
985
985
  });
986
986
  }
987
+ async function cancelHumanFacingPendingMessages(args) {
988
+ const nowMs = args.nowMs ?? now();
989
+ const requestedIds = args.inboundMessageIds === void 0 ? void 0 : new Set(args.inboundMessageIds);
990
+ return await withConversationMutation(args, async (state, lock) => {
991
+ const current = await readConversation(state, args.conversationId);
992
+ if (!current) {
993
+ return { cancelledInboundMessageIds: [] };
994
+ }
995
+ const cancelledInboundMessageIds = [];
996
+ const pendingMessages2 = [];
997
+ for (const message of current.execution.pendingMessages) {
998
+ const isHumanFacing = message.source === "web" || message.source === "slack";
999
+ const isRequested = requestedIds === void 0 || requestedIds.has(message.inboundMessageId);
1000
+ const isInSnapshot = args.receivedBeforeMs === void 0 || message.receivedAtMs <= args.receivedBeforeMs;
1001
+ if (isHumanFacing && isRequested && isInSnapshot) {
1002
+ cancelledInboundMessageIds.push(message.inboundMessageId);
1003
+ continue;
1004
+ }
1005
+ pendingMessages2.push(message);
1006
+ }
1007
+ if (cancelledInboundMessageIds.length === 0) {
1008
+ return { cancelledInboundMessageIds };
1009
+ }
1010
+ const becomesIdle = current.execution.status === "pending" && pendingMessages2.length === 0;
1011
+ await writeConversation(
1012
+ state,
1013
+ lock,
1014
+ withExecutionUpdate(
1015
+ current,
1016
+ {
1017
+ ...current.execution,
1018
+ lastEnqueuedAtMs: pendingMessages2.length === 0 ? void 0 : current.execution.lastEnqueuedAtMs,
1019
+ pendingMessages: pendingMessages2,
1020
+ retryCount: becomesIdle ? 0 : current.execution.retryCount,
1021
+ runId: becomesIdle ? void 0 : current.execution.runId,
1022
+ status: becomesIdle ? "idle" : current.execution.status
1023
+ },
1024
+ nowMs
1025
+ )
1026
+ );
1027
+ return { cancelledInboundMessageIds };
1028
+ });
1029
+ }
987
1030
  async function requestAnotherSlice(args) {
988
1031
  const nowMs = args.nowMs ?? now();
989
1032
  return await withConversationMutation(args, async (state, lock) => {
@@ -1451,6 +1494,13 @@ async function ackMessages2(args) {
1451
1494
  await recordExecutionMetadata(args);
1452
1495
  return result;
1453
1496
  }
1497
+ async function cancelHumanFacingPendingMessages2(args) {
1498
+ const result = await cancelHumanFacingPendingMessages(args);
1499
+ if (result.cancelledInboundMessageIds.length > 0) {
1500
+ await recordExecutionMetadata(args);
1501
+ }
1502
+ return result;
1503
+ }
1454
1504
  async function requestAnotherSlice2(args) {
1455
1505
  const result = await requestAnotherSlice(args);
1456
1506
  await recordExecutionMetadata(args);
@@ -1516,6 +1566,7 @@ export {
1516
1566
  checkInConversationWork2 as checkInConversationWork,
1517
1567
  drainConversationMailbox2 as drainConversationMailbox,
1518
1568
  ackMessages2 as ackMessages,
1569
+ cancelHumanFacingPendingMessages2 as cancelHumanFacingPendingMessages,
1519
1570
  requestAnotherSlice2 as requestAnotherSlice,
1520
1571
  beginConversationResume2 as beginConversationResume,
1521
1572
  releaseConversationWork2 as releaseConversationWork,
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-V7YE4WCP.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-KSZXVR5G.js";
8
+ } from "./chunk-TD7ZQZ5W.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-FAJ6SMEE.js";
6
+ } from "./chunk-L2PEQ2PY.js";
7
7
  import {
8
8
  parseSlackChannelReferenceId
9
9
  } from "./chunk-V7YE4WCP.js";
@@ -12,7 +12,7 @@ import {
12
12
  setSpanAttributes,
13
13
  setSpanStatus,
14
14
  withSpan
15
- } from "./chunk-KSZXVR5G.js";
15
+ } from "./chunk-TD7ZQZ5W.js";
16
16
 
17
17
  // src/chat/slack/client.ts
18
18
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-UPPU3FQU.js";
6
+ } from "./chunk-PT7B6A3O.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-KSZXVR5G.js";
14
+ } from "./chunk-TD7ZQZ5W.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.158.0",
4
+ version: "0.159.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -2,7 +2,7 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-4XJ2WSTI.js";
5
+ } from "./chunk-UKKOKMRE.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-C3FYJZSA.js";
25
+ } from "./chunk-54O6IKUS.js";
26
26
  import {
27
27
  JUNIOR_THREAD_STATE_TTL_MS
28
28
  } from "./chunk-3Y47VMHV.js";
@@ -33,25 +33,25 @@ import {
33
33
  createPluginModel,
34
34
  createPluginState,
35
35
  getPlugins
36
- } from "./chunk-NOEERHHR.js";
36
+ } from "./chunk-EBP6IS66.js";
37
37
  import {
38
38
  getConversationStore,
39
39
  getDb,
40
40
  sameActorIdentity
41
- } from "./chunk-AF4PHIP6.js";
41
+ } from "./chunk-QODFNKQS.js";
42
42
  import {
43
43
  juniorConversations,
44
44
  juniorTaskExecutions
45
- } from "./chunk-VURJ2NSF.js";
45
+ } from "./chunk-O2DZWUPQ.js";
46
46
  import {
47
47
  getStateAdapter
48
- } from "./chunk-PHQDXC27.js";
48
+ } from "./chunk-Q5X37U6G.js";
49
49
  import {
50
50
  ProviderError,
51
51
  findProviderError,
52
52
  getProviderErrorAttributes,
53
53
  getProviderErrorUserMessage
54
- } from "./chunk-FAJ6SMEE.js";
54
+ } from "./chunk-L2PEQ2PY.js";
55
55
  import {
56
56
  credentialSubjectSchema
57
57
  } from "./chunk-BDUENQD3.js";
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  buildTurnFailureResponse,
63
63
  logWarn
64
- } from "./chunk-KSZXVR5G.js";
64
+ } from "./chunk-TD7ZQZ5W.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-HFWTPYT7.js")).getConversationStore();
90
+ const conversationStore = args.conversationStore ?? (await import("./db-BIIMAPFB.js")).getConversationStore();
91
91
  const conversation = await conversationStore.get({
92
92
  conversationId: args.conversationId
93
93
  });