@sentry/junior 0.201.0 → 0.202.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 (62) hide show
  1. package/dist/{agent-hooks-HMG23EIR.js → agent-hooks-UXITLYOK.js} +11 -11
  2. package/dist/api.js +24 -24
  3. package/dist/app.js +59 -38
  4. package/dist/{catalog-runtime-7TIXWSYG.js → catalog-runtime-BG3JLLK2.js} +4 -4
  5. package/dist/{chunk-44W7JB5V.js → chunk-2MK3QBGA.js} +1 -1
  6. package/dist/{chunk-ZXSPPXX3.js → chunk-3PGQSKJV.js} +9 -9
  7. package/dist/{chunk-IXGQ4NTO.js → chunk-3UI3WFTX.js} +5 -5
  8. package/dist/{chunk-QHCI2E2A.js → chunk-5NOPO64K.js} +1 -1
  9. package/dist/{chunk-6QQYL2XW.js → chunk-5PKWYPFT.js} +6 -6
  10. package/dist/{chunk-PJIU4AGA.js → chunk-63NKKFJL.js} +2 -2
  11. package/dist/{chunk-VRD7FJZ2.js → chunk-6AYH6252.js} +4 -4
  12. package/dist/{chunk-73RVLY6A.js → chunk-7DHZP5KJ.js} +2 -2
  13. package/dist/{chunk-LINEEYW6.js → chunk-A76OIMYN.js} +1 -1
  14. package/dist/{chunk-KS5RPVQI.js → chunk-AWMS3SPP.js} +3 -3
  15. package/dist/{chunk-T4WKGKAW.js → chunk-B3LY5RCL.js} +5 -5
  16. package/dist/{chunk-FNAEGMGB.js → chunk-BD2KT3OB.js} +1 -1
  17. package/dist/{chunk-H5SDC32F.js → chunk-BXCX5QKA.js} +1 -1
  18. package/dist/{chunk-APX6WBD7.js → chunk-C6VVF43U.js} +1 -1
  19. package/dist/{chunk-6CYKW2J7.js → chunk-DBVY6HLX.js} +1 -1
  20. package/dist/{chunk-3XPQV262.js → chunk-DL2KLKVH.js} +6 -6
  21. package/dist/{chunk-UEIDAG2O.js → chunk-ELWOYVOY.js} +1 -1
  22. package/dist/{chunk-J4AWOSCT.js → chunk-EWT7H65X.js} +4 -4
  23. package/dist/{chunk-NN5Y32TJ.js → chunk-HMREVIO2.js} +2 -2
  24. package/dist/{chunk-VQ2XYXLB.js → chunk-IIWUT4FO.js} +8 -8
  25. package/dist/{chunk-GHZ677GD.js → chunk-JSJQEWBJ.js} +21 -21
  26. package/dist/{chunk-7V4KWIXL.js → chunk-KHKKHDLD.js} +2 -2
  27. package/dist/{chunk-I7F3JVYE.js → chunk-LA6R4A7Q.js} +3 -3
  28. package/dist/{chunk-X2PTNIN5.js → chunk-LOOU2DUR.js} +29 -25
  29. package/dist/{chunk-7YNSWPVU.js → chunk-M6FHWXE3.js} +9 -9
  30. package/dist/{chunk-VGNL3QUM.js → chunk-M76HMB7M.js} +3 -3
  31. package/dist/{chunk-SIMN6AUL.js → chunk-MAGNK5J4.js} +1 -1
  32. package/dist/{chunk-KKI5K43Z.js → chunk-NSXKRGRT.js} +3 -3
  33. package/dist/{chunk-BQFWG7MB.js → chunk-OWMPFXJA.js} +4 -4
  34. package/dist/{chunk-UJRD4NN4.js → chunk-PW4P4JYF.js} +1 -1
  35. package/dist/{chunk-ZPGGVW34.js → chunk-QB54UQUS.js} +5 -5
  36. package/dist/{chunk-RAWQD5DS.js → chunk-QP3OGJXF.js} +1 -1
  37. package/dist/{chunk-4DDQVL3Q.js → chunk-REOIRYPR.js} +2 -2
  38. package/dist/{chunk-OZ2QJWQF.js → chunk-SCOZRLZ4.js} +3 -3
  39. package/dist/{chunk-Q3BTNRDK.js → chunk-TXJSXBV5.js} +4 -4
  40. package/dist/{chunk-JYJG6LAG.js → chunk-U2GPUYAL.js} +6 -6
  41. package/dist/{chunk-5LXHEN3P.js → chunk-WQSHDTTI.js} +8 -8
  42. package/dist/{chunk-Y6EUAX5O.js → chunk-YDUR3ZYW.js} +1 -1
  43. package/dist/cli/chat.js +33 -33
  44. package/dist/cli/check.js +5 -5
  45. package/dist/cli/plugins.js +12 -12
  46. package/dist/cli/snapshot-create.js +9 -9
  47. package/dist/cli/upgrade.js +6 -6
  48. package/dist/{db-S5DGFIFR.js → db-3L2MCVRI.js} +6 -6
  49. package/dist/instrumentation.js +3 -3
  50. package/dist/nitro.js +6 -6
  51. package/dist/{oauth-callback-server-JDEUY5KP.js → oauth-callback-server-YVV6C6T2.js} +29 -29
  52. package/dist/{runner-OQZRPML2.js → runner-LQ7RETDP.js} +21 -21
  53. package/dist/{skills-4VE2VHGF.js → skills-XRWYEDCD.js} +5 -5
  54. package/dist/spawn-RC6SJUAI.js +42 -0
  55. package/dist/task-runner-7DY7ARYH.js +36 -0
  56. package/dist/{validation-CX2H5J6S.js → validation-7MNQGCJA.js} +5 -5
  57. package/dist/version.js +1 -1
  58. package/dist/{work-GUHO34OE.js → work-COALHUCG.js} +21 -21
  59. package/dist/{worker-F44XXKBH.js → worker-6MURZIPD.js} +10 -10
  60. package/package.json +5 -5
  61. package/dist/spawn-4WCYSTFY.js +0 -42
  62. package/dist/task-runner-7SDXKQ3L.js +0 -36
@@ -19,23 +19,23 @@ import {
19
19
  releaseConversationWork,
20
20
  requestAnotherSlice,
21
21
  startConversationWork
22
- } from "./chunk-BQFWG7MB.js";
22
+ } from "./chunk-OWMPFXJA.js";
23
23
  import {
24
24
  getTurnRequestDeadline
25
- } from "./chunk-FNAEGMGB.js";
25
+ } from "./chunk-BD2KT3OB.js";
26
26
  import {
27
27
  ConversationQueueMessageRejectedError
28
28
  } from "./chunk-JAL3CH4G.js";
29
29
  import {
30
30
  getChatConfig,
31
31
  isProviderRetryError
32
- } from "./chunk-PJIU4AGA.js";
32
+ } from "./chunk-63NKKFJL.js";
33
33
  import {
34
34
  logException,
35
35
  logInfo,
36
36
  logWarn,
37
37
  withLogContext
38
- } from "./chunk-SIMN6AUL.js";
38
+ } from "./chunk-MAGNK5J4.js";
39
39
 
40
40
  // src/chat/task-execution/worker.ts
41
41
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-PDO5BLNM.js";
4
4
  import {
5
5
  botConfig
6
- } from "./chunk-PJIU4AGA.js";
6
+ } from "./chunk-63NKKFJL.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-SIMN6AUL.js";
9
+ } from "./chunk-MAGNK5J4.js";
10
10
 
11
11
  // src/chat/conversations/structured-events.ts
12
12
  import {
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-N7TMSOZH.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-SIMN6AUL.js";
8
+ } from "./chunk-MAGNK5J4.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ConversationTurnLifecycleService
3
- } from "./chunk-6CYKW2J7.js";
3
+ } from "./chunk-DBVY6HLX.js";
4
4
  import {
5
5
  runAgentWithTimeout
6
- } from "./chunk-3XPQV262.js";
6
+ } from "./chunk-DL2KLKVH.js";
7
7
  import {
8
8
  getConversationEventStore
9
- } from "./chunk-VGNL3QUM.js";
9
+ } from "./chunk-M76HMB7M.js";
10
10
 
11
11
  // src/chat/runtime/turn-execution.ts
12
12
  var AgentRunError = class extends Error {
@@ -2,16 +2,16 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-IXGQ4NTO.js";
5
+ } from "./chunk-3UI3WFTX.js";
6
6
  import {
7
7
  clearPendingAuth,
8
8
  markTurnClosed,
9
9
  markTurnCompleted
10
- } from "./chunk-UEIDAG2O.js";
10
+ } from "./chunk-ELWOYVOY.js";
11
11
  import {
12
12
  hydrateConversationMessages,
13
13
  markConversationMessage
14
- } from "./chunk-6QQYL2XW.js";
14
+ } from "./chunk-5PKWYPFT.js";
15
15
  import {
16
16
  buildDeterministicTurnId
17
17
  } from "./chunk-DA2KGZZI.js";
@@ -20,13 +20,13 @@ import {
20
20
  findProviderError,
21
21
  getProviderErrorAttributes,
22
22
  getProviderErrorUserMessage
23
- } from "./chunk-PJIU4AGA.js";
23
+ } from "./chunk-63NKKFJL.js";
24
24
  import {
25
25
  parseSlackMessageTs
26
26
  } from "./chunk-N7TMSOZH.js";
27
27
  import {
28
28
  buildTurnFailureResponse
29
- } from "./chunk-SIMN6AUL.js";
29
+ } from "./chunk-MAGNK5J4.js";
30
30
 
31
31
  // src/chat/runtime/delivered-turn-state.ts
32
32
  function buildDeliveredTurnStatePatch(args) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-PJIU4AGA.js";
4
+ } from "./chunk-63NKKFJL.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-SIMN6AUL.js";
15
+ } from "./chunk-MAGNK5J4.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-Y6EUAX5O.js";
3
+ } from "./chunk-YDUR3ZYW.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
  getConversationEventStore
3
- } from "./chunk-VGNL3QUM.js";
3
+ } from "./chunk-M76HMB7M.js";
4
4
 
5
5
  // src/chat/conversations/turn-lifecycle.ts
6
6
  var ConversationTurnLifecycleService = class {
@@ -8,19 +8,19 @@ import {
8
8
  isDmChannel,
9
9
  normalizeSlackConversationId,
10
10
  withSlackRetries
11
- } from "./chunk-JYJG6LAG.js";
11
+ } from "./chunk-U2GPUYAL.js";
12
12
  import {
13
13
  parseDestination
14
- } from "./chunk-VGNL3QUM.js";
14
+ } from "./chunk-M76HMB7M.js";
15
15
  import {
16
16
  getStateAdapter
17
- } from "./chunk-44W7JB5V.js";
17
+ } from "./chunk-2MK3QBGA.js";
18
18
  import {
19
19
  normalizeSlackEmojiName
20
- } from "./chunk-PJIU4AGA.js";
20
+ } from "./chunk-63NKKFJL.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-Y6EUAX5O.js";
23
+ } from "./chunk-YDUR3ZYW.js";
24
24
  import {
25
25
  parseSlackMessageTs,
26
26
  parseSlackUserId
@@ -29,7 +29,7 @@ import {
29
29
  isRecord,
30
30
  logInfo,
31
31
  logWarn
32
- } from "./chunk-SIMN6AUL.js";
32
+ } from "./chunk-MAGNK5J4.js";
33
33
 
34
34
  // src/chat/agent/types.ts
35
35
  var RetryableDeliveryError = class extends Error {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  abandonTurnRecord,
3
3
  extractAssistantText
4
- } from "./chunk-6QQYL2XW.js";
4
+ } from "./chunk-5PKWYPFT.js";
5
5
  import {
6
6
  buildDeterministicTurnId
7
7
  } from "./chunk-DA2KGZZI.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  agentTurnCostUsd,
3
3
  agentTurnTotalTokens
4
- } from "./chunk-73RVLY6A.js";
4
+ } from "./chunk-7DHZP5KJ.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-VGNL3QUM.js";
7
+ } from "./chunk-M76HMB7M.js";
8
8
  import {
9
9
  juniorConversations,
10
10
  juniorTaskExecutions
11
- } from "./chunk-UJRD4NN4.js";
11
+ } from "./chunk-PW4P4JYF.js";
12
12
  import {
13
13
  logWarn
14
- } from "./chunk-SIMN6AUL.js";
14
+ } from "./chunk-MAGNK5J4.js";
15
15
 
16
16
  // src/chat/tasks/execution-stats.ts
17
17
  import {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.201.0",
4
+ version: "0.202.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -86,7 +86,7 @@ var package_default = {
86
86
  "@sentry/node": "catalog:",
87
87
  "@sinclair/typebox": "^0.34.49",
88
88
  "@slack/web-api": "^7.16.0",
89
- "@vercel/blob": "^2.4.0",
89
+ "@vercel/blob": "^2.6.1",
90
90
  "@vercel/functions": "^3.6.0",
91
91
  "@vercel/oidc": "^3.4.1",
92
92
  "@vercel/queue": "^0.2.0",
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState
4
- } from "./chunk-IXGQ4NTO.js";
4
+ } from "./chunk-3UI3WFTX.js";
5
5
  import {
6
6
  recordTaskExecution
7
- } from "./chunk-J4AWOSCT.js";
7
+ } from "./chunk-EWT7H65X.js";
8
8
  import {
9
9
  pluginTaskId,
10
10
  pluginTaskParamsSchema,
11
11
  sendVercelPluginTask
12
- } from "./chunk-OZ2QJWQF.js";
12
+ } from "./chunk-SCOZRLZ4.js";
13
13
  import {
14
14
  getPiMessageRole,
15
15
  getTurnRecord,
@@ -19,7 +19,7 @@ import {
19
19
  isToolResultMessage,
20
20
  normalizeToolNameFromResult,
21
21
  stripRuntimeTurnContext
22
- } from "./chunk-6QQYL2XW.js";
22
+ } from "./chunk-5PKWYPFT.js";
23
23
  import {
24
24
  createPluginConversationEvents,
25
25
  createPluginEmbedder,
@@ -28,17 +28,17 @@ import {
28
28
  createPluginState,
29
29
  getPlugins,
30
30
  readActorIdentity
31
- } from "./chunk-JYJG6LAG.js";
31
+ } from "./chunk-U2GPUYAL.js";
32
32
  import {
33
33
  JUNIOR_THREAD_STATE_TTL_MS
34
34
  } from "./chunk-3Y47VMHV.js";
35
35
  import {
36
36
  getConversationStore,
37
37
  getDb
38
- } from "./chunk-VGNL3QUM.js";
38
+ } from "./chunk-M76HMB7M.js";
39
39
  import {
40
40
  getStateAdapter
41
- } from "./chunk-44W7JB5V.js";
41
+ } from "./chunk-2MK3QBGA.js";
42
42
  import {
43
43
  sameActorIdentity
44
44
  } from "./chunk-7NL7T6VU.js";
@@ -84,7 +84,7 @@ function slackSourceForDestination(args) {
84
84
  };
85
85
  }
86
86
  async function resolveConversationRouting(args) {
87
- const conversationStore = args.conversationStore ?? (await import("./db-S5DGFIFR.js")).getConversationStore();
87
+ const conversationStore = args.conversationStore ?? (await import("./db-3L2MCVRI.js")).getConversationStore();
88
88
  const chain = await loadConversationChain(
89
89
  args.conversationId,
90
90
  conversationStore
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  AgentRunError,
6
6
  executeTurn
7
- } from "./chunk-KS5RPVQI.js";
7
+ } from "./chunk-AWMS3SPP.js";
8
8
  import {
9
9
  buildDeliveredTurnStatePatch,
10
10
  finalizeFailedTurnReplyWithEvent,
@@ -15,14 +15,14 @@ import {
15
15
  getTurnUserSlackMessageTs,
16
16
  persistAuthPauseTurnState,
17
17
  requireTurnFailureEventId
18
- } from "./chunk-T4WKGKAW.js";
18
+ } from "./chunk-B3LY5RCL.js";
19
19
  import {
20
20
  resolveTurnSessionRouting,
21
21
  scheduleSessionCompletedPluginTasks
22
- } from "./chunk-VQ2XYXLB.js";
22
+ } from "./chunk-IIWUT4FO.js";
23
23
  import {
24
24
  getTurnLifecycle
25
- } from "./chunk-6CYKW2J7.js";
25
+ } from "./chunk-DBVY6HLX.js";
26
26
  import {
27
27
  coerceThreadConversationState,
28
28
  configValueSchema,
@@ -30,11 +30,11 @@ import {
30
30
  getPersistedSandboxState,
31
31
  getPersistedThreadState,
32
32
  persistThreadStateById
33
- } from "./chunk-IXGQ4NTO.js";
33
+ } from "./chunk-3UI3WFTX.js";
34
34
  import {
35
35
  buildSentryConversationUrl,
36
36
  deleteWebAuthorization
37
- } from "./chunk-RAWQD5DS.js";
37
+ } from "./chunk-QP3OGJXF.js";
38
38
  import {
39
39
  createUserTokenStore,
40
40
  deleteMcpAuthSession,
@@ -45,7 +45,7 @@ import {
45
45
  lookupSlackUserProfile,
46
46
  putMcpStoredOAuthCredentials,
47
47
  resolvePluginOAuthAccount
48
- } from "./chunk-5LXHEN3P.js";
48
+ } from "./chunk-WQSHDTTI.js";
49
49
  import {
50
50
  RetryableDeliveryError,
51
51
  addReactionToMessage,
@@ -59,7 +59,7 @@ import {
59
59
  removeReactionFromMessage,
60
60
  resolveBaseUrl,
61
61
  truncateStatusText
62
- } from "./chunk-3XPQV262.js";
62
+ } from "./chunk-DL2KLKVH.js";
63
63
  import {
64
64
  CooperativeTurnYieldError,
65
65
  clearPendingAuth,
@@ -68,7 +68,7 @@ import {
68
68
  isCooperativeTurnYieldError,
69
69
  isPendingAuthLatestRequest,
70
70
  markTurnFailed
71
- } from "./chunk-UEIDAG2O.js";
71
+ } from "./chunk-ELWOYVOY.js";
72
72
  import {
73
73
  abandonTurnRecord,
74
74
  buildConversationContext,
@@ -87,20 +87,20 @@ import {
87
87
  recordTurnSummary,
88
88
  saveTurnCheckpoint,
89
89
  turnHasReply
90
- } from "./chunk-6QQYL2XW.js";
90
+ } from "./chunk-5PKWYPFT.js";
91
91
  import {
92
92
  parseSlackThreadId,
93
93
  readSlackRawMessageContext,
94
94
  resolveSlackChannelIdFromMessage,
95
95
  resolveSlackChannelIdFromThreadId
96
- } from "./chunk-LINEEYW6.js";
96
+ } from "./chunk-A76OIMYN.js";
97
97
  import {
98
98
  ensureConversationWake,
99
99
  requestConversationWork
100
- } from "./chunk-BQFWG7MB.js";
100
+ } from "./chunk-OWMPFXJA.js";
101
101
  import {
102
102
  getTurnRequestDeadline
103
- } from "./chunk-FNAEGMGB.js";
103
+ } from "./chunk-BD2KT3OB.js";
104
104
  import {
105
105
  getVercelConversationWorkQueue
106
106
  } from "./chunk-DKIJ2RP5.js";
@@ -112,39 +112,39 @@ import {
112
112
  getSlackClient,
113
113
  isDmChannel,
114
114
  normalizeSlackConversationId
115
- } from "./chunk-JYJG6LAG.js";
115
+ } from "./chunk-U2GPUYAL.js";
116
116
  import {
117
117
  getConversationStore,
118
118
  getSqlExecutor,
119
119
  requireSlackDestination,
120
120
  upsertIdentity,
121
121
  upsertLinkedIdentity
122
- } from "./chunk-VGNL3QUM.js";
122
+ } from "./chunk-M76HMB7M.js";
123
123
  import {
124
124
  acquireActiveLock,
125
125
  getStateAdapter
126
- } from "./chunk-44W7JB5V.js";
126
+ } from "./chunk-2MK3QBGA.js";
127
127
  import {
128
128
  botConfig,
129
129
  escapeXml,
130
130
  getChatConfig,
131
131
  getRuntimeMetadata,
132
132
  normalizeSlackEmojiName
133
- } from "./chunk-PJIU4AGA.js";
133
+ } from "./chunk-63NKKFJL.js";
134
134
  import {
135
135
  defaultModelId
136
136
  } from "./chunk-NHJU2ZAL.js";
137
137
  import {
138
138
  discoverSkills
139
- } from "./chunk-7V4KWIXL.js";
139
+ } from "./chunk-KHKKHDLD.js";
140
140
  import {
141
141
  pluginCatalogRuntime
142
- } from "./chunk-Y6EUAX5O.js";
142
+ } from "./chunk-YDUR3ZYW.js";
143
143
  import {
144
144
  buildOAuthTokenRequest,
145
145
  hasRequiredOAuthScope,
146
146
  parseOAuthTokenResponse
147
- } from "./chunk-H5SDC32F.js";
147
+ } from "./chunk-BXCX5QKA.js";
148
148
  import {
149
149
  createSlackResumeActor,
150
150
  isUserActor,
@@ -162,7 +162,7 @@ import {
162
162
  setTags,
163
163
  toOptionalString,
164
164
  withLogContext
165
- } from "./chunk-SIMN6AUL.js";
165
+ } from "./chunk-MAGNK5J4.js";
166
166
 
167
167
  // src/chat/slack/assistant-thread/status-render.ts
168
168
  var DEFAULT_STATUS_CONTEXTS = {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-Y6EUAX5O.js";
3
+ } from "./chunk-YDUR3ZYW.js";
4
4
  import {
5
5
  skillRoots
6
6
  } from "./chunk-TXKUKMVO.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-SIMN6AUL.js";
9
+ } from "./chunk-MAGNK5J4.js";
10
10
 
11
11
  // src/chat/skills.ts
12
12
  import fs from "fs/promises";
@@ -6,14 +6,14 @@ import {
6
6
  isStale,
7
7
  runNonInteractiveCommand,
8
8
  sleep
9
- } from "./chunk-KKI5K43Z.js";
9
+ } from "./chunk-NSXKRGRT.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-44W7JB5V.js";
12
+ } from "./chunk-2MK3QBGA.js";
13
13
  import {
14
14
  setSpanAttributes,
15
15
  withSpan
16
- } from "./chunk-SIMN6AUL.js";
16
+ } from "./chunk-MAGNK5J4.js";
17
17
 
18
18
  // src/chat/sandbox/resources.ts
19
19
  var configuredResources;
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-ZPGGVW34.js";
10
+ } from "./chunk-QB54UQUS.js";
11
11
  import {
12
12
  parseSandboxEgressAuthRequiredSignal,
13
13
  parseSandboxEgressPermissionDeniedSignal,
@@ -38,7 +38,7 @@ import {
38
38
  searchSlackUsers,
39
39
  selectPluginGrant,
40
40
  toMcpProviderError
41
- } from "./chunk-5LXHEN3P.js";
41
+ } from "./chunk-WQSHDTTI.js";
42
42
  import {
43
43
  RetryableDeliveryError,
44
44
  actorFromRun,
@@ -53,7 +53,7 @@ import {
53
53
  surfaceFromRun,
54
54
  toolInvocationDestination,
55
55
  uploadFilesToConversation
56
- } from "./chunk-3XPQV262.js";
56
+ } from "./chunk-DL2KLKVH.js";
57
57
  import {
58
58
  CooperativeTurnYieldError,
59
59
  NO_REPLY_MARKER,
@@ -65,7 +65,7 @@ import {
65
65
  isNoReplyMarker,
66
66
  isTurnInputCommitLostError,
67
67
  sanitizeAssistantText
68
- } from "./chunk-UEIDAG2O.js";
68
+ } from "./chunk-ELWOYVOY.js";
69
69
  import {
70
70
  AGENTS_REMOVAL_NOTICE,
71
71
  AGENTS_REPLACEMENT_NOTICE,
@@ -121,7 +121,7 @@ import {
121
121
  stripRuntimeTurnContext,
122
122
  trimTrailingAssistantMessages,
123
123
  truncateText
124
- } from "./chunk-6QQYL2XW.js";
124
+ } from "./chunk-5PKWYPFT.js";
125
125
  import {
126
126
  SCHEDULED_TASK_SYSTEM_ACTOR,
127
127
  WORKSPACE_SNAPSHOT_FAILED_EVENT,
@@ -163,13 +163,13 @@ import {
163
163
  workspaceSnapshotFinishedEvent,
164
164
  workspaceSnapshotWatch,
165
165
  writableEventTask
166
- } from "./chunk-Q3BTNRDK.js";
166
+ } from "./chunk-TXJSXBV5.js";
167
167
  import {
168
168
  parseSlackThreadId
169
- } from "./chunk-LINEEYW6.js";
169
+ } from "./chunk-A76OIMYN.js";
170
170
  import {
171
171
  appendAndEnqueueInboundMessage
172
- } from "./chunk-BQFWG7MB.js";
172
+ } from "./chunk-OWMPFXJA.js";
173
173
  import {
174
174
  SHORT_TITLE_MAX_LENGTH,
175
175
  ToolInputError,
@@ -177,7 +177,7 @@ import {
177
177
  generateShortTitle,
178
178
  hasAgentTurnUsage,
179
179
  resolveTaskTitle
180
- } from "./chunk-73RVLY6A.js";
180
+ } from "./chunk-7DHZP5KJ.js";
181
181
  import {
182
182
  bindSandboxFileSystem,
183
183
  createSandboxSession,
@@ -188,7 +188,7 @@ import {
188
188
  resolve,
189
189
  setSnapshotSpanAttributes,
190
190
  stopSession
191
- } from "./chunk-I7F3JVYE.js";
191
+ } from "./chunk-LA6R4A7Q.js";
192
192
  import {
193
193
  privateTraceResultAttributes
194
194
  } from "./chunk-UIE3R5XU.js";
@@ -198,7 +198,7 @@ import {
198
198
  } from "./chunk-X6GDDWQH.js";
199
199
  import {
200
200
  getTurnRequestDeadline
201
- } from "./chunk-FNAEGMGB.js";
201
+ } from "./chunk-BD2KT3OB.js";
202
202
  import {
203
203
  getVercelConversationWorkQueue
204
204
  } from "./chunk-DKIJ2RP5.js";
@@ -245,7 +245,7 @@ import {
245
245
  updateWorkspace,
246
246
  withSlackRetries,
247
247
  workspaceRepoCheckoutPath
248
- } from "./chunk-JYJG6LAG.js";
248
+ } from "./chunk-U2GPUYAL.js";
249
249
  import {
250
250
  JUNIOR_THREAD_STATE_TTL_MS
251
251
  } from "./chunk-3Y47VMHV.js";
@@ -255,13 +255,13 @@ import {
255
255
  getConversationStore,
256
256
  getDb,
257
257
  getSqlExecutor
258
- } from "./chunk-VGNL3QUM.js";
258
+ } from "./chunk-M76HMB7M.js";
259
259
  import {
260
260
  juniorArtifacts,
261
261
  juniorAttachments,
262
262
  juniorIdentities,
263
263
  juniorSchedulerRuns
264
- } from "./chunk-UJRD4NN4.js";
264
+ } from "./chunk-PW4P4JYF.js";
265
265
  import {
266
266
  SANDBOX_DATA_ROOT,
267
267
  SANDBOX_REPOS_ROOT,
@@ -292,12 +292,12 @@ import {
292
292
  throwSandboxOperationError,
293
293
  workspaceSnapshotNotReadyUserMessage,
294
294
  wrapSandboxSetupError
295
- } from "./chunk-KKI5K43Z.js";
295
+ } from "./chunk-NSXKRGRT.js";
296
296
  import {
297
297
  fenceLock,
298
298
  getStateAdapter,
299
299
  withLock
300
- } from "./chunk-44W7JB5V.js";
300
+ } from "./chunk-2MK3QBGA.js";
301
301
  import {
302
302
  KNOWN_CONVERSATION_EVENT_TYPES,
303
303
  contextProvenance,
@@ -330,7 +330,7 @@ import {
330
330
  resolveGatewayCredential,
331
331
  resolveGatewayModel,
332
332
  unwrapCurrentInstruction
333
- } from "./chunk-PJIU4AGA.js";
333
+ } from "./chunk-63NKKFJL.js";
334
334
  import {
335
335
  ModelProfileNotConfiguredError,
336
336
  TURN_REASONING_LEVELS,
@@ -349,16 +349,16 @@ import {
349
349
  toGenAiMessagesTraceAttributes,
350
350
  toGenAiPayloadMetadata,
351
351
  toGenAiPayloadTraceAttributes
352
- } from "./chunk-QHCI2E2A.js";
352
+ } from "./chunk-5NOPO64K.js";
353
353
  import {
354
354
  discoverSkills,
355
355
  findSkillByName,
356
356
  loadSkillsByName,
357
357
  parseSkillInvocation
358
- } from "./chunk-7V4KWIXL.js";
358
+ } from "./chunk-KHKKHDLD.js";
359
359
  import {
360
360
  pluginCatalogRuntime
361
- } from "./chunk-Y6EUAX5O.js";
361
+ } from "./chunk-YDUR3ZYW.js";
362
362
  import {
363
363
  CredentialUnavailableError,
364
364
  OAuthProviderError,
@@ -366,7 +366,7 @@ import {
366
366
  getOAuthProviderErrorAttributes,
367
367
  resolveAuthTokenPlaceholder,
368
368
  resolvePluginCommandEnv
369
- } from "./chunk-H5SDC32F.js";
369
+ } from "./chunk-BXCX5QKA.js";
370
370
  import {
371
371
  credentialContextForActor,
372
372
  credentialUserSubjectId
@@ -402,7 +402,7 @@ import {
402
402
  summarizeMessageText,
403
403
  withLogContext,
404
404
  withSpan
405
- } from "./chunk-SIMN6AUL.js";
405
+ } from "./chunk-MAGNK5J4.js";
406
406
  import {
407
407
  startInactiveSpan,
408
408
  withActiveSpan
@@ -13949,6 +13949,12 @@ function createLoadAttachmentTool(args) {
13949
13949
  if (!body) {
13950
13950
  throw new ToolInputError("Stored attachment contents are unavailable.");
13951
13951
  }
13952
+ const data = await readStream(body);
13953
+ if (data.byteLength !== attachment.bytes) {
13954
+ throw new Error(
13955
+ `Attachment ${attachment.id} read ${data.byteLength} bytes, expected ${attachment.bytes}.`
13956
+ );
13957
+ }
13952
13958
  const attachmentDir = path8.posix.join(ATTACHMENT_DIR, attachment.id);
13953
13959
  const sandboxPath = path8.posix.join(
13954
13960
  attachmentDir,
@@ -13963,9 +13969,7 @@ function createLoadAttachmentTool(args) {
13963
13969
  `Failed to create attachment directory: ${mkdir.stderr}`
13964
13970
  );
13965
13971
  }
13966
- await args.workspace.writeFiles([
13967
- { content: await readStream(body), path: sandboxPath }
13968
- ]);
13972
+ await args.workspace.writeFiles([{ content: data, path: sandboxPath }]);
13969
13973
  return {
13970
13974
  path: sandboxPath,
13971
13975
  filename: attachment.filename,