@sentry/junior 0.180.0 → 0.181.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 (71) hide show
  1. package/dist/{agent-hooks-DKDDRKZA.js → agent-hooks-IQUW6ERD.js} +11 -11
  2. package/dist/api/schema/workspace.d.ts +2 -0
  3. package/dist/api/schema.js +1 -1
  4. package/dist/api.js +32 -31
  5. package/dist/app.js +34 -34
  6. package/dist/{catalog-runtime-WXKGUF3W.js → catalog-runtime-PMQWNIXA.js} +4 -4
  7. package/dist/chat/plugins/agent-hooks.d.ts +1 -1
  8. package/dist/chat/services/turn-session-routing.d.ts +1 -0
  9. package/dist/chat/tools/types.d.ts +2 -0
  10. package/dist/chat/workspaces/types.d.ts +2 -0
  11. package/dist/{chunk-LGVQLNLS.js → chunk-3KCQEG6W.js} +8 -8
  12. package/dist/{chunk-CK6EINVZ.js → chunk-3KSSALN4.js} +5 -5
  13. package/dist/{chunk-VG722ONZ.js → chunk-3X55QRAG.js} +6 -6
  14. package/dist/{chunk-2YIRH4E3.js → chunk-4IX32NSL.js} +1 -1
  15. package/dist/{chunk-TKB25A3L.js → chunk-CZYNWPWD.js} +2 -1
  16. package/dist/{chunk-DHLOGWYH.js → chunk-D6ZD7VXP.js} +19 -8
  17. package/dist/{chunk-KCL6AWYW.js → chunk-DSA6WTRP.js} +19 -19
  18. package/dist/{chunk-RAZG3YHC.js → chunk-EBMRB6Z6.js} +1 -1
  19. package/dist/{chunk-VGPPWWHF.js → chunk-EM7EECT5.js} +2 -2
  20. package/dist/{chunk-6YCEWOLO.js → chunk-ETJTXYHY.js} +1 -1
  21. package/dist/{chunk-MXEUIGHO.js → chunk-EU7KJDOG.js} +1 -1
  22. package/dist/{chunk-5TUR4M3M.js → chunk-FWILPBVQ.js} +5 -5
  23. package/dist/{chunk-ZE2KOV3G.js → chunk-GPA3ZSYY.js} +1 -1
  24. package/dist/{chunk-SDBKZ5LV.js → chunk-GREV5PJK.js} +4 -4
  25. package/dist/{chunk-3ILJBWP7.js → chunk-GWFRPQNP.js} +17 -12
  26. package/dist/{chunk-DRHEGXTZ.js → chunk-HEBMSITT.js} +1 -1
  27. package/dist/{chunk-GUKXEPMX.js → chunk-HJ27A6YB.js} +1 -1
  28. package/dist/{chunk-IANUX7HX.js → chunk-HZHUMCNV.js} +1 -1
  29. package/dist/{chunk-QSO7B5JO.js → chunk-IJ6SS4WB.js} +1 -1
  30. package/dist/{chunk-2AYEVN7K.js → chunk-IKKETMQC.js} +3 -3
  31. package/dist/{chunk-FGC3PHNH.js → chunk-KKSVCHDO.js} +8 -1
  32. package/dist/{chunk-WVAMRKYG.js → chunk-KMBU4PJP.js} +3 -3
  33. package/dist/{chunk-U5EUCUBH.js → chunk-KQZX24QQ.js} +3 -3
  34. package/dist/{chunk-TC5DE5KJ.js → chunk-LCNPXLE7.js} +7 -7
  35. package/dist/{chunk-O4QYZTDK.js → chunk-LG5MYY6U.js} +6 -6
  36. package/dist/{chunk-EWHP2IRG.js → chunk-LZOQFC5F.js} +5 -5
  37. package/dist/{chunk-GPXAHUQH.js → chunk-NQTA72Q3.js} +6 -6
  38. package/dist/{chunk-5PUMIMNQ.js → chunk-PBKZQAUA.js} +53 -33
  39. package/dist/{chunk-GA5NS74S.js → chunk-PL57B6NC.js} +1 -1
  40. package/dist/{chunk-CP73FKME.js → chunk-PPYDHUEL.js} +13 -13
  41. package/dist/{chunk-L7LTGN4Z.js → chunk-Q2KY27IX.js} +4 -4
  42. package/dist/{chunk-S7YRTOSQ.js → chunk-RNMASWLP.js} +3 -3
  43. package/dist/{chunk-CCDXTDSY.js → chunk-TDT2R77B.js} +1 -1
  44. package/dist/{chunk-ZM7ZURJS.js → chunk-TJHSAHQN.js} +1 -1
  45. package/dist/{chunk-I6IFTAPF.js → chunk-XYTJUHRZ.js} +2 -2
  46. package/dist/cli/chat.js +32 -32
  47. package/dist/cli/check.js +5 -5
  48. package/dist/cli/plugins.js +12 -12
  49. package/dist/cli/snapshot-create.js +9 -9
  50. package/dist/cli/upgrade.js +6 -6
  51. package/dist/db/schema/snapshots.d.ts +17 -0
  52. package/dist/db/schema.d.ts +17 -0
  53. package/dist/{db-6SBHIAJK.js → db-QNPVCQPT.js} +6 -6
  54. package/dist/instrumentation.js +3 -3
  55. package/dist/nitro.js +6 -6
  56. package/dist/{oauth-callback-server-WSDQPZZS.js → oauth-callback-server-KYMPJOTC.js} +25 -25
  57. package/dist/{runner-GWTSWESR.js → runner-3RS2D2ZR.js} +18 -18
  58. package/dist/{skills-F32BPFYW.js → skills-5B3Y6XX6.js} +5 -5
  59. package/dist/spawn-VYARS3DU.js +37 -0
  60. package/dist/task-runner-4IXKKZHL.js +32 -0
  61. package/dist/{validation-62WO524A.js → validation-Q65QD27B.js} +5 -5
  62. package/dist/version.js +1 -1
  63. package/dist/{work-3C3CMZ24.js → work-DCMQWAAP.js} +18 -18
  64. package/dist/worker-QL3CHLZL.js +22 -0
  65. package/migrations/0035_workspace_snapshot_size_bytes.sql +2 -0
  66. package/migrations/meta/0035_snapshot.json +3048 -0
  67. package/migrations/meta/_journal.json +7 -0
  68. package/package.json +5 -5
  69. package/dist/spawn-X5BPP5OE.js +0 -37
  70. package/dist/task-runner-2FPBV5PP.js +0 -32
  71. package/dist/worker-MFAI6ZEK.js +0 -22
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-S7YRTOSQ.js";
8
+ } from "./chunk-RNMASWLP.js";
9
9
  import {
10
10
  juniorConversationAnnotations,
11
11
  juniorConversationEvents,
@@ -14,7 +14,7 @@ import {
14
14
  juniorUsers,
15
15
  juniorWorkspaceRepos,
16
16
  juniorWorkspaces
17
- } from "./chunk-FGC3PHNH.js";
17
+ } from "./chunk-KKSVCHDO.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT,
20
20
  getVercelSandboxCredentials,
@@ -22,17 +22,17 @@ import {
22
22
  isSandboxMissingError,
23
23
  runNonInteractiveCommand,
24
24
  sleep
25
- } from "./chunk-WVAMRKYG.js";
25
+ } from "./chunk-KMBU4PJP.js";
26
26
  import {
27
27
  getStateAdapter
28
- } from "./chunk-GA5NS74S.js";
28
+ } from "./chunk-PL57B6NC.js";
29
29
  import {
30
30
  botConfig,
31
31
  completeObject,
32
32
  defaultModelId,
33
33
  embedTexts,
34
34
  getSlackBotToken
35
- } from "./chunk-I6IFTAPF.js";
35
+ } from "./chunk-XYTJUHRZ.js";
36
36
  import {
37
37
  isActorUserId,
38
38
  parseActorUserId,
@@ -48,7 +48,7 @@ import {
48
48
  setSpanAttributes,
49
49
  setSpanStatus,
50
50
  withSpan
51
- } from "./chunk-RAZG3YHC.js";
51
+ } from "./chunk-EBMRB6Z6.js";
52
52
 
53
53
  // src/chat/plugins/agent-hooks.ts
54
54
  import {
@@ -1733,6 +1733,7 @@ function snapshotFromRow(row) {
1733
1733
  id: row.snapshotId,
1734
1734
  generatedAt: row.generatedAt,
1735
1735
  buildDurationMs: row.buildDurationMs,
1736
+ sizeBytes: row.sizeBytes,
1736
1737
  profileHash: row.profileHash
1737
1738
  };
1738
1739
  }
@@ -1799,6 +1800,7 @@ async function setWorkspaceSnapshot(workspaceId, snapshot, options) {
1799
1800
  status: "ready",
1800
1801
  snapshotId: snapshot.id,
1801
1802
  buildDurationMs: snapshot.buildDurationMs,
1803
+ sizeBytes: snapshot.sizeBytes,
1802
1804
  generatedAt: snapshot.generatedAt,
1803
1805
  buildStartedAt: null,
1804
1806
  buildPhase: null,
@@ -1877,6 +1879,7 @@ async function setWorkspaceSnapshotBuild(workspaceId, build, options = {}) {
1877
1879
  status: build.status,
1878
1880
  snapshotId: null,
1879
1881
  buildDurationMs: null,
1882
+ sizeBytes: null,
1880
1883
  generatedAt: null,
1881
1884
  buildStartedAt: build.startedAt,
1882
1885
  buildPhase: build.phase,
@@ -2221,7 +2224,10 @@ function systemPromptPluginContext(plugin) {
2221
2224
  };
2222
2225
  }
2223
2226
  function pluginInvocationContext(context) {
2224
- const common = { conversationId: context.conversationId };
2227
+ const common = {
2228
+ conversationId: context.conversationId,
2229
+ locationId: context.locationId
2230
+ };
2225
2231
  switch (context.source.platform) {
2226
2232
  case "slack": {
2227
2233
  if (context.destination.platform !== "slack") {
@@ -2259,6 +2265,7 @@ function invocationPluginContext(plugin, context, turnId) {
2259
2265
  const common = {
2260
2266
  ...base,
2261
2267
  conversationId: context.conversationId,
2268
+ locationId: context.locationId,
2262
2269
  embedder: createPluginEmbedder(plugin.manifest.name),
2263
2270
  ...context.conversationId && turnId ? {
2264
2271
  events: createPluginConversationEvents({
@@ -2271,7 +2278,10 @@ function invocationPluginContext(plugin, context, turnId) {
2271
2278
  model: createPluginModel(plugin.manifest.name, plugin.model),
2272
2279
  source: context.source,
2273
2280
  text: context.userText ?? "",
2274
- state: createPluginState(plugin.manifest.name)
2281
+ state: createPluginState(plugin.manifest.name),
2282
+ users: {
2283
+ resolveActor: context.resolveActorIdentity ?? (async () => void 0)
2284
+ }
2275
2285
  };
2276
2286
  return {
2277
2287
  ...common,
@@ -2621,6 +2631,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2621
2631
  ...basePluginContext(plugin),
2622
2632
  ...annotations ? { annotations } : void 0,
2623
2633
  conversationId: context.conversationId,
2634
+ locationId: context.locationId,
2624
2635
  userText: context.userText,
2625
2636
  embedder: createPluginEmbedder(pluginName),
2626
2637
  egress: context.egress,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  buildSentryConversationUrl,
6
6
  deleteWebAuthorization
7
- } from "./chunk-MXEUIGHO.js";
7
+ } from "./chunk-EU7KJDOG.js";
8
8
  import {
9
9
  buildDeliveredTurnStatePatch,
10
10
  finalizeFailedTurnReplyWithEvent,
@@ -15,11 +15,11 @@ import {
15
15
  getTurnUserSlackMessageTs,
16
16
  persistAuthPauseTurnState,
17
17
  requireTurnFailureEventId
18
- } from "./chunk-EWHP2IRG.js";
18
+ } from "./chunk-LZOQFC5F.js";
19
19
  import {
20
20
  resolveTurnSessionRouting,
21
21
  scheduleSessionCompletedPluginTasks
22
- } from "./chunk-3ILJBWP7.js";
22
+ } from "./chunk-GWFRPQNP.js";
23
23
  import {
24
24
  ConversationTurnLifecycleService
25
25
  } from "./chunk-M3QYTBQ6.js";
@@ -30,7 +30,7 @@ import {
30
30
  getPersistedSandboxState,
31
31
  getPersistedThreadState,
32
32
  persistThreadStateById
33
- } from "./chunk-5TUR4M3M.js";
33
+ } from "./chunk-FWILPBVQ.js";
34
34
  import {
35
35
  createUserTokenStore,
36
36
  deleteMcpAuthSession,
@@ -41,7 +41,7 @@ import {
41
41
  lookupSlackUserProfile,
42
42
  resolvePluginOAuthAccount,
43
43
  runAgentWithTimeout
44
- } from "./chunk-LGVQLNLS.js";
44
+ } from "./chunk-3KCQEG6W.js";
45
45
  import {
46
46
  RetryableDeliveryError
47
47
  } from "./chunk-RF6J3DIO.js";
@@ -57,17 +57,17 @@ import {
57
57
  removeReactionFromMessage,
58
58
  resolveBaseUrl,
59
59
  truncateStatusText
60
- } from "./chunk-O4QYZTDK.js";
60
+ } from "./chunk-LG5MYY6U.js";
61
61
  import {
62
62
  parseSlackThreadId,
63
63
  readSlackRawMessageContext,
64
64
  resolveSlackChannelIdFromMessage,
65
65
  resolveSlackChannelIdFromThreadId
66
- } from "./chunk-CCDXTDSY.js";
66
+ } from "./chunk-TDT2R77B.js";
67
67
  import {
68
68
  ensureConversationWake,
69
69
  requestConversationWork
70
- } from "./chunk-L7LTGN4Z.js";
70
+ } from "./chunk-Q2KY27IX.js";
71
71
  import {
72
72
  CooperativeTurnYieldError,
73
73
  clearPendingAuth,
@@ -76,7 +76,7 @@ import {
76
76
  isCooperativeTurnYieldError,
77
77
  isPendingAuthLatestRequest,
78
78
  markTurnFailed
79
- } from "./chunk-GUKXEPMX.js";
79
+ } from "./chunk-HJ27A6YB.js";
80
80
  import {
81
81
  TurnSliceLimitExceededError,
82
82
  abandonTurnRecord,
@@ -96,13 +96,13 @@ import {
96
96
  recordTurnSummary,
97
97
  saveTurnCheckpoint,
98
98
  turnHasReply
99
- } from "./chunk-GPXAHUQH.js";
99
+ } from "./chunk-NQTA72Q3.js";
100
100
  import {
101
101
  getVercelConversationWorkQueue
102
102
  } from "./chunk-DKIJ2RP5.js";
103
103
  import {
104
104
  getTurnRequestDeadline
105
- } from "./chunk-ZE2KOV3G.js";
105
+ } from "./chunk-GPA3ZSYY.js";
106
106
  import {
107
107
  SlackActionError,
108
108
  getDashboardConversationLink,
@@ -111,18 +111,18 @@ import {
111
111
  getSlackClient,
112
112
  isDmChannel,
113
113
  normalizeSlackConversationId
114
- } from "./chunk-DHLOGWYH.js";
114
+ } from "./chunk-D6ZD7VXP.js";
115
115
  import {
116
116
  getConversationEventStore,
117
117
  getSqlExecutor,
118
118
  requireSlackDestination,
119
119
  upsertIdentity,
120
120
  upsertLinkedIdentity
121
- } from "./chunk-S7YRTOSQ.js";
121
+ } from "./chunk-RNMASWLP.js";
122
122
  import {
123
123
  acquireActiveLock,
124
124
  getStateAdapter
125
- } from "./chunk-GA5NS74S.js";
125
+ } from "./chunk-PL57B6NC.js";
126
126
  import {
127
127
  botConfig,
128
128
  defaultModelId,
@@ -130,18 +130,18 @@ import {
130
130
  getChatConfig,
131
131
  getRuntimeMetadata,
132
132
  normalizeSlackEmojiName
133
- } from "./chunk-I6IFTAPF.js";
133
+ } from "./chunk-XYTJUHRZ.js";
134
134
  import {
135
135
  discoverSkills
136
- } from "./chunk-VGPPWWHF.js";
136
+ } from "./chunk-EM7EECT5.js";
137
137
  import {
138
138
  pluginCatalogRuntime
139
- } from "./chunk-DRHEGXTZ.js";
139
+ } from "./chunk-HEBMSITT.js";
140
140
  import {
141
141
  buildOAuthTokenRequest,
142
142
  hasRequiredOAuthScope,
143
143
  parseOAuthTokenResponse
144
- } from "./chunk-2YIRH4E3.js";
144
+ } from "./chunk-4IX32NSL.js";
145
145
  import {
146
146
  createSlackResumeActor,
147
147
  isUserActor,
@@ -160,7 +160,7 @@ import {
160
160
  setTags,
161
161
  toOptionalString,
162
162
  withLogContext
163
- } from "./chunk-RAZG3YHC.js";
163
+ } from "./chunk-EBMRB6Z6.js";
164
164
 
165
165
  // src/chat/slack/assistant-thread/status-render.ts
166
166
  var DEFAULT_STATUS_CONTEXTS = {
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-PEQXYSSE.js";
13
13
  import {
14
14
  JUNIOR_VERSION
15
- } from "./chunk-ZM7ZURJS.js";
15
+ } from "./chunk-TJHSAHQN.js";
16
16
 
17
17
  // src/deployment.ts
18
18
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-DRHEGXTZ.js";
3
+ } from "./chunk-HEBMSITT.js";
4
4
  import {
5
5
  skillRoots
6
6
  } from "./chunk-TXKUKMVO.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-RAZG3YHC.js";
9
+ } from "./chunk-EBMRB6Z6.js";
10
10
 
11
11
  // src/chat/skills.ts
12
12
  import fs from "fs/promises";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-RAZG3YHC.js";
3
+ } from "./chunk-EBMRB6Z6.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-GA5NS74S.js";
3
+ } from "./chunk-PL57B6NC.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-PEQXYSSE.js";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-GPXAHUQH.js";
3
+ } from "./chunk-NQTA72Q3.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-S7YRTOSQ.js";
9
+ } from "./chunk-RNMASWLP.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-FGC3PHNH.js";
12
+ } from "./chunk-KKSVCHDO.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-GA5NS74S.js";
15
+ } from "./chunk-PL57B6NC.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-RAZG3YHC.js";
23
+ } from "./chunk-EBMRB6Z6.js";
24
24
 
25
25
  // src/chat/state/conversation.ts
26
26
  function defaultConversationState() {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-I6IFTAPF.js";
4
+ } from "./chunk-XYTJUHRZ.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -19,23 +19,23 @@ import {
19
19
  releaseConversationWork,
20
20
  requestAnotherSlice,
21
21
  startConversationWork
22
- } from "./chunk-L7LTGN4Z.js";
22
+ } from "./chunk-Q2KY27IX.js";
23
23
  import {
24
24
  ConversationQueueMessageRejectedError
25
25
  } from "./chunk-JAL3CH4G.js";
26
26
  import {
27
27
  getTurnRequestDeadline
28
- } from "./chunk-ZE2KOV3G.js";
28
+ } from "./chunk-GPA3ZSYY.js";
29
29
  import {
30
30
  getChatConfig,
31
31
  isProviderRetryError
32
- } from "./chunk-I6IFTAPF.js";
32
+ } from "./chunk-XYTJUHRZ.js";
33
33
  import {
34
34
  logException,
35
35
  logInfo,
36
36
  logWarn,
37
37
  withLogContext
38
- } from "./chunk-RAZG3YHC.js";
38
+ } from "./chunk-EBMRB6Z6.js";
39
39
 
40
40
  // src/chat/task-execution/worker.ts
41
41
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState
4
- } from "./chunk-5TUR4M3M.js";
4
+ } from "./chunk-FWILPBVQ.js";
5
5
  import {
6
6
  pluginTaskId,
7
7
  pluginTaskParamsSchema,
8
8
  sendVercelPluginTask
9
- } from "./chunk-U5EUCUBH.js";
9
+ } from "./chunk-KQZX24QQ.js";
10
10
  import {
11
11
  getPiMessageRole,
12
12
  getTurnRecord,
@@ -16,15 +16,16 @@ import {
16
16
  isToolResultMessage,
17
17
  normalizeToolNameFromResult,
18
18
  stripRuntimeTurnContext
19
- } from "./chunk-GPXAHUQH.js";
19
+ } from "./chunk-NQTA72Q3.js";
20
20
  import {
21
21
  createPluginConversationEvents,
22
22
  createPluginEmbedder,
23
23
  createPluginLogger,
24
24
  createPluginModel,
25
25
  createPluginState,
26
- getPlugins
27
- } from "./chunk-DHLOGWYH.js";
26
+ getPlugins,
27
+ readActorIdentity
28
+ } from "./chunk-D6ZD7VXP.js";
28
29
  import {
29
30
  JUNIOR_THREAD_STATE_TTL_MS
30
31
  } from "./chunk-3Y47VMHV.js";
@@ -32,14 +33,14 @@ import {
32
33
  getConversationStore,
33
34
  getDb,
34
35
  sameActorIdentity
35
- } from "./chunk-S7YRTOSQ.js";
36
+ } from "./chunk-RNMASWLP.js";
36
37
  import {
37
38
  juniorConversations,
38
39
  juniorTaskExecutions
39
- } from "./chunk-FGC3PHNH.js";
40
+ } from "./chunk-KKSVCHDO.js";
40
41
  import {
41
42
  getStateAdapter
42
- } from "./chunk-GA5NS74S.js";
43
+ } from "./chunk-PL57B6NC.js";
43
44
  import {
44
45
  credentialSubjectSchema
45
46
  } from "./chunk-CEMMLV5L.js";
@@ -48,14 +49,14 @@ import {
48
49
  } from "./chunk-N7TMSOZH.js";
49
50
  import {
50
51
  logWarn
51
- } from "./chunk-RAZG3YHC.js";
52
+ } from "./chunk-EBMRB6Z6.js";
52
53
 
53
54
  // src/chat/plugins/task-runner.ts
54
55
  import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
55
56
 
56
57
  // src/chat/services/turn-session-routing.ts
57
58
  async function resolveTurnSessionRouting(args) {
58
- const conversationStore = args.conversationStore ?? (await import("./db-6SBHIAJK.js")).getConversationStore();
59
+ const conversationStore = args.conversationStore ?? (await import("./db-QNPVCQPT.js")).getConversationStore();
59
60
  const conversation = await conversationStore.get({
60
61
  conversationId: args.conversationId
61
62
  });
@@ -66,6 +67,7 @@ async function resolveTurnSessionRouting(args) {
66
67
  }
67
68
  return {
68
69
  destination: conversation.destination,
70
+ ...conversation.location ? { locationId: conversation.location.id } : void 0,
69
71
  source: conversation.sessionSource
70
72
  };
71
73
  }
@@ -887,6 +889,7 @@ async function loadPluginRun(params) {
887
889
  conversationId: params.conversationId
888
890
  });
889
891
  const runActor = record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
892
+ const actorUser = runActor ? (await readActorIdentity(runActor))?.user : void 0;
890
893
  const runEntries = turnMessagesWithProvenance(record).map(
891
894
  ({ message, provenance }) => runTranscriptEntry(message, provenance, runActor)
892
895
  ).filter((entry) => Boolean(entry));
@@ -901,11 +904,13 @@ async function loadPluginRun(params) {
901
904
  (entry) => entry.type !== "message" || !runMessageTexts.has(entry.text)
902
905
  );
903
906
  return pluginRunContextSchema.parse({
907
+ ...actorUser ? { actorUserId: actorUser.id } : void 0,
904
908
  completedAtMs: record.updatedAtMs,
905
909
  conversationId: record.conversationId,
906
910
  destination: routing.destination,
907
- // Derived from the full run provenance on the record, not the sliced or
908
- // stripped transcript, so it reflects every committed instruction actor.
911
+ ...routing.locationId ? { locationId: routing.locationId } : void 0,
912
+ // Read Actors from the full run record, not the shorter transcript.
913
+ // This includes every Actor that supplied an instruction.
909
914
  actors: record.actors,
910
915
  ...runActor ? { actor: runActor } : void 0,
911
916
  runId: record.turnId,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-2YIRH4E3.js";
3
+ } from "./chunk-4IX32NSL.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  abandonTurnRecord,
3
3
  extractAssistantText
4
- } from "./chunk-GPXAHUQH.js";
4
+ } from "./chunk-NQTA72Q3.js";
5
5
 
6
6
  // src/chat/state/turn-id.ts
7
7
  function buildDeterministicTurnId(messageId) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-TC5DE5KJ.js";
3
+ } from "./chunk-LCNPXLE7.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-DRHEGXTZ.js";
3
+ } from "./chunk-HEBMSITT.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -6,14 +6,14 @@ import {
6
6
  isStale,
7
7
  runNonInteractiveCommand,
8
8
  sleep
9
- } from "./chunk-WVAMRKYG.js";
9
+ } from "./chunk-KMBU4PJP.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-GA5NS74S.js";
12
+ } from "./chunk-PL57B6NC.js";
13
13
  import {
14
14
  setSpanAttributes,
15
15
  withSpan
16
- } from "./chunk-RAZG3YHC.js";
16
+ } from "./chunk-EBMRB6Z6.js";
17
17
 
18
18
  // src/chat/sandbox/resources.ts
19
19
  var configuredResources;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFUK3X5B.js";
5
5
  import {
6
6
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
7
- } from "./chunk-I6IFTAPF.js";
7
+ } from "./chunk-XYTJUHRZ.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";
@@ -655,6 +655,7 @@ var juniorSchedulerRuns = pgTable16(
655
655
  // src/db/schema/snapshots.ts
656
656
  import { sql as sql6 } from "drizzle-orm";
657
657
  import {
658
+ bigint as bigint4,
658
659
  check as check2,
659
660
  index as index13,
660
661
  integer as integer6,
@@ -699,6 +700,8 @@ var juniorSnapshots = pgTable18(
699
700
  // Ready artifact facts.
700
701
  snapshotId: text18("snapshot_id"),
701
702
  buildDurationMs: integer6("build_duration_ms"),
703
+ // Provider snapshot size when the capture response includes it.
704
+ sizeBytes: bigint4("size_bytes", { mode: "number" }),
702
705
  generatedAt: timestamptz("generated_at"),
703
706
  // Builder references for check-in and snapshot-owner cleanup.
704
707
  buildStartedAt: timestamptz("build_started_at"),
@@ -730,6 +733,10 @@ var juniorSnapshots = pgTable18(
730
733
  "junior_snapshots_build_duration_check",
731
734
  sql6`${table.buildDurationMs} is null or ${table.buildDurationMs} >= 0`
732
735
  ),
736
+ check2(
737
+ "junior_snapshots_size_bytes_check",
738
+ sql6`${table.sizeBytes} is null or ${table.sizeBytes} >= 0`
739
+ ),
733
740
  // Provider snapshot ids are unique. Nulls stay allowed for in-flight rows.
734
741
  uniqueIndex8("junior_snapshots_snapshot_id_uidx").on(table.snapshotId),
735
742
  index13("junior_snapshots_workspace_idx").on(table.workspaceId),
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-I6IFTAPF.js";
3
+ } from "./chunk-XYTJUHRZ.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-DRHEGXTZ.js";
6
+ } from "./chunk-HEBMSITT.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-RAZG3YHC.js";
10
+ } from "./chunk-EBMRB6Z6.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-7H2VZTWN.js";
7
7
  import {
8
8
  runWithTurnRequestDeadline
9
- } from "./chunk-ZE2KOV3G.js";
9
+ } from "./chunk-GPA3ZSYY.js";
10
10
  import {
11
11
  logWarn
12
- } from "./chunk-RAZG3YHC.js";
12
+ } from "./chunk-EBMRB6Z6.js";
13
13
 
14
14
  // src/chat/plugins/task-queue.ts
15
15
  import { createHash } from "crypto";
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
129
129
  onRejected: logPluginTaskQueueMessageRejected,
130
130
  // Load the runner on first use so this module can send without a cycle.
131
131
  run: async (message) => {
132
- const { processPluginTask } = await import("./task-runner-2FPBV5PP.js");
132
+ const { processPluginTask } = await import("./task-runner-4IXKKZHL.js");
133
133
  await processPluginTask(message);
134
134
  },
135
135
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -5,7 +5,7 @@ import {
5
5
  getPersistedSandboxState,
6
6
  getPersistedThreadState,
7
7
  persistThreadStateById
8
- } from "./chunk-5TUR4M3M.js";
8
+ } from "./chunk-FWILPBVQ.js";
9
9
  import {
10
10
  AgentInvocationBusyError,
11
11
  AgentInvocationLimitError,
@@ -14,32 +14,32 @@ import {
14
14
  agentBindingSchema,
15
15
  agentInvocationSchema,
16
16
  createAgentInvocationSchema
17
- } from "./chunk-VG722ONZ.js";
17
+ } from "./chunk-3X55QRAG.js";
18
18
  import {
19
19
  appendAndEnqueueInboundMessage
20
- } from "./chunk-L7LTGN4Z.js";
20
+ } from "./chunk-Q2KY27IX.js";
21
21
  import {
22
22
  TurnInputCommitLostError,
23
23
  getAssistantReplyText,
24
24
  getConversationTurnBoundaryError,
25
25
  isTurnInputCommitLostError
26
- } from "./chunk-GUKXEPMX.js";
26
+ } from "./chunk-HJ27A6YB.js";
27
27
  import {
28
28
  failTurnRecord,
29
29
  getTerminalAssistantMessages,
30
30
  getTurnRecord,
31
31
  openConversationProjection,
32
32
  saveTurnCheckpoint
33
- } from "./chunk-GPXAHUQH.js";
33
+ } from "./chunk-NQTA72Q3.js";
34
34
  import {
35
35
  getConversationEventStore,
36
36
  getConversationStore,
37
37
  getSqlExecutor
38
- } from "./chunk-S7YRTOSQ.js";
38
+ } from "./chunk-RNMASWLP.js";
39
39
  import {
40
40
  juniorAgentBindings,
41
41
  juniorAgentInvocations
42
- } from "./chunk-FGC3PHNH.js";
42
+ } from "./chunk-KKSVCHDO.js";
43
43
 
44
44
  // src/chat/agent-invocations/work.ts
45
45
  import { z } from "zod";
@@ -5,19 +5,19 @@ import {
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId,
7
7
  withSlackRetries
8
- } from "./chunk-DHLOGWYH.js";
8
+ } from "./chunk-D6ZD7VXP.js";
9
9
  import {
10
10
  parseDestination
11
- } from "./chunk-S7YRTOSQ.js";
11
+ } from "./chunk-RNMASWLP.js";
12
12
  import {
13
13
  getStateAdapter
14
- } from "./chunk-GA5NS74S.js";
14
+ } from "./chunk-PL57B6NC.js";
15
15
  import {
16
16
  normalizeSlackEmojiName
17
- } from "./chunk-I6IFTAPF.js";
17
+ } from "./chunk-XYTJUHRZ.js";
18
18
  import {
19
19
  pluginCatalogRuntime
20
- } from "./chunk-DRHEGXTZ.js";
20
+ } from "./chunk-HEBMSITT.js";
21
21
  import {
22
22
  parseSlackMessageTs,
23
23
  parseSlackUserId
@@ -26,7 +26,7 @@ import {
26
26
  isRecord,
27
27
  logInfo,
28
28
  logWarn
29
- } from "./chunk-RAZG3YHC.js";
29
+ } from "./chunk-EBMRB6Z6.js";
30
30
 
31
31
  // src/chat/slack/outbound.ts
32
32
  var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;