@sentry/junior 0.190.0 → 0.192.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 (97) hide show
  1. package/dist/{agent-hooks-3IG2FQW2.js → agent-hooks-3JY76L5X.js} +11 -11
  2. package/dist/api/activity.d.ts +3 -1
  3. package/dist/api/code/overview.d.ts +12 -0
  4. package/dist/api/locations/detail.d.ts +8 -0
  5. package/dist/api/locations/list.d.ts +5 -0
  6. package/dist/api/people/code.d.ts +6 -0
  7. package/dist/api/people/shared.d.ts +2 -0
  8. package/dist/api/reporting-window.d.ts +40 -0
  9. package/dist/api/schema/code.d.ts +14 -0
  10. package/dist/api/schema/conversation.d.ts +27 -0
  11. package/dist/api/schema/location.d.ts +15 -0
  12. package/dist/api/schema/person.d.ts +104 -0
  13. package/dist/api/schema/task.d.ts +15 -2
  14. package/dist/api/schema.d.ts +1 -1
  15. package/dist/api/schema.js +2 -2
  16. package/dist/api.js +536 -141
  17. package/dist/app.js +93 -130
  18. package/dist/{catalog-runtime-2OT7S3ZC.js → catalog-runtime-5JVLWXRY.js} +4 -4
  19. package/dist/chat/agent/resume.d.ts +0 -1
  20. package/dist/chat/agent/types.d.ts +0 -1
  21. package/dist/chat/agent-invocations/types.d.ts +4 -4
  22. package/dist/chat/providers/slack/runtime.d.ts +1 -2
  23. package/dist/chat/providers/slack/system-turn.d.ts +9 -4
  24. package/dist/chat/providers/slack/turn.d.ts +0 -1
  25. package/dist/chat/services/turn-router.d.ts +1 -1
  26. package/dist/chat/slack/dispatch-turn.d.ts +0 -1
  27. package/dist/chat/slack/timestamp-param.d.ts +1 -1
  28. package/dist/chat/task-execution/assistant-message.d.ts +7 -7
  29. package/dist/chat/task-execution/checkpoint.d.ts +0 -1
  30. package/dist/chat/task-execution/conversation-turn.d.ts +2 -2
  31. package/dist/chat/task-execution/state.d.ts +0 -3
  32. package/dist/chat/task-execution/store.d.ts +0 -1
  33. package/dist/chat/task-execution/turn-cursor.d.ts +0 -2
  34. package/dist/chat/task-execution/worker.d.ts +0 -1
  35. package/dist/chat/tasks/execution-stats.d.ts +12 -0
  36. package/dist/{chunk-Y4WL4OYD.js → chunk-3ADPXQBL.js} +1 -1
  37. package/dist/{chunk-F3K2267N.js → chunk-3O2NXVGB.js} +77 -35
  38. package/dist/{chunk-2MKHYSYL.js → chunk-3UJSII43.js} +3 -3
  39. package/dist/{chunk-RLYJYEIY.js → chunk-47JFLZSF.js} +5 -7
  40. package/dist/{chunk-T66GV7A3.js → chunk-4AFSQJD6.js} +2 -2
  41. package/dist/{chunk-DJZGQ7OL.js → chunk-4B4DQGOM.js} +22 -29
  42. package/dist/{chunk-OJFX2FP7.js → chunk-4CCQZHD3.js} +9 -11
  43. package/dist/{chunk-BUJU6C2J.js → chunk-4WIA45WD.js} +1 -1
  44. package/dist/{chunk-VWNIDTFR.js → chunk-4Z7B5WVV.js} +2 -2
  45. package/dist/{chunk-3J3BCB4J.js → chunk-5V4BAUCH.js} +1 -1
  46. package/dist/{chunk-663DQH5W.js → chunk-6FCKJDKS.js} +1 -1
  47. package/dist/{chunk-HI5KXE3C.js → chunk-6LX6KV5C.js} +3 -3
  48. package/dist/{chunk-67MMSYSE.js → chunk-7XO7PTZE.js} +1 -1
  49. package/dist/{chunk-OKAHLUSU.js → chunk-AKR6W7VV.js} +3 -3
  50. package/dist/{chunk-JV7U4665.js → chunk-ARSUYYQG.js} +1 -1
  51. package/dist/{chunk-IRQ3RSX3.js → chunk-BGLMT6KP.js} +3 -3
  52. package/dist/{chunk-2MRF22J4.js → chunk-BUTAWPUV.js} +50 -8
  53. package/dist/{chunk-62DRKZQU.js → chunk-EIYOABL4.js} +4 -4
  54. package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
  55. package/dist/{chunk-DVX6U6GI.js → chunk-EYNUOZCN.js} +1 -1
  56. package/dist/{chunk-4PKEJK5B.js → chunk-FGYWKKTJ.js} +1 -1
  57. package/dist/{chunk-YFU4DGZY.js → chunk-G4E5WIRL.js} +30 -9
  58. package/dist/{chunk-OON4IQHH.js → chunk-H5Q2T5VC.js} +1 -1
  59. package/dist/{chunk-ZFCO2TMB.js → chunk-IBO4YFFZ.js} +1 -1
  60. package/dist/{chunk-ECOR3OXY.js → chunk-ITTEDZGY.js} +8 -8
  61. package/dist/{chunk-4BLFIYVK.js → chunk-KR5F3QSP.js} +9 -12
  62. package/dist/{chunk-6BXUSF7J.js → chunk-LRTEMMCZ.js} +1 -1
  63. package/dist/{chunk-MNHJ4WLE.js → chunk-MB2CTEPD.js} +74 -4
  64. package/dist/{chunk-YKIAUKYH.js → chunk-OBN7UEQJ.js} +2 -2
  65. package/dist/{chunk-OYCOLHCR.js → chunk-PXP2M32M.js} +5 -5
  66. package/dist/{chunk-6H7YU6XH.js → chunk-PXUBRZBU.js} +1 -1
  67. package/dist/{chunk-REVH4BZU.js → chunk-PYVGXGKC.js} +2 -2
  68. package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
  69. package/dist/{chunk-CZXZKTAI.js → chunk-RWBZZMW6.js} +3 -3
  70. package/dist/{chunk-GWCFXTB6.js → chunk-SSR6YBWW.js} +6 -6
  71. package/dist/{chunk-7UJ6IJCK.js → chunk-SZ2O3CGS.js} +1 -1
  72. package/dist/{chunk-BGOLRC36.js → chunk-VF3EDS7P.js} +13 -11
  73. package/dist/{chunk-FVFJ57RK.js → chunk-YE6DVM43.js} +9 -8
  74. package/dist/{chunk-7Y7XMI6P.js → chunk-YRWGJ5OO.js} +5 -5
  75. package/dist/{chunk-W2C4TPLB.js → chunk-Z4DNJI5F.js} +5 -5
  76. package/dist/cli/chat.js +33 -33
  77. package/dist/cli/check.js +5 -5
  78. package/dist/cli/plugins.js +12 -12
  79. package/dist/cli/snapshot-create.js +9 -9
  80. package/dist/cli/upgrade.js +6 -6
  81. package/dist/db/schema/stats.d.ts +5 -1
  82. package/dist/{db-2IFDMDDY.js → db-LRM6AP66.js} +6 -6
  83. package/dist/instrumentation.js +3 -3
  84. package/dist/nitro.js +6 -6
  85. package/dist/{oauth-callback-server-SZSS2KH6.js → oauth-callback-server-BKCDVYVH.js} +29 -29
  86. package/dist/reporting-schema.d.ts +2 -2
  87. package/dist/{runner-2N4QU77X.js → runner-RUXGS3E6.js} +21 -21
  88. package/dist/{skills-VU2LZAKX.js → skills-DXP2RCJF.js} +5 -5
  89. package/dist/spawn-HH7GH7XT.js +42 -0
  90. package/dist/task-runner-H5I7R3LJ.js +36 -0
  91. package/dist/{validation-IJGHK7NI.js → validation-F4KYLIF2.js} +5 -5
  92. package/dist/version.js +1 -1
  93. package/dist/{work-DI45MLRL.js → work-UUNMNSML.js} +21 -21
  94. package/dist/{worker-FY7KWG2M.js → worker-PMIJ5NLD.js} +10 -10
  95. package/package.json +6 -6
  96. package/dist/spawn-3K7RV4T5.js +0 -42
  97. package/dist/task-runner-52DYFHW3.js +0 -36
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-OYCOLHCR.js";
10
+ } from "./chunk-PXP2M32M.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-FVFJ57RK.js";
41
+ } from "./chunk-YE6DVM43.js";
42
42
  import {
43
43
  RetryableDeliveryError,
44
44
  actorFromRun,
@@ -52,7 +52,7 @@ import {
52
52
  surfaceFromRun,
53
53
  toolInvocationDestination,
54
54
  uploadFilesToConversation
55
- } from "./chunk-GWCFXTB6.js";
55
+ } from "./chunk-SSR6YBWW.js";
56
56
  import {
57
57
  CooperativeTurnYieldError,
58
58
  NO_REPLY_MARKER,
@@ -65,7 +65,7 @@ import {
65
65
  isNoReplyMarker,
66
66
  isTurnInputCommitLostError,
67
67
  sanitizeAssistantText
68
- } from "./chunk-67MMSYSE.js";
68
+ } from "./chunk-7XO7PTZE.js";
69
69
  import {
70
70
  AGENTS_REMOVAL_NOTICE,
71
71
  AGENTS_REPLACEMENT_NOTICE,
@@ -119,7 +119,7 @@ import {
119
119
  stripRuntimeTurnContext,
120
120
  trimTrailingAssistantMessages,
121
121
  truncateText
122
- } from "./chunk-BGOLRC36.js";
122
+ } from "./chunk-VF3EDS7P.js";
123
123
  import {
124
124
  SCHEDULED_TASK_SYSTEM_ACTOR,
125
125
  WORKSPACE_SNAPSHOT_FAILED_EVENT,
@@ -160,13 +160,13 @@ import {
160
160
  workspaceSnapshotFinishedEvent,
161
161
  workspaceSnapshotWatch,
162
162
  writableEventTask
163
- } from "./chunk-62DRKZQU.js";
163
+ } from "./chunk-EIYOABL4.js";
164
164
  import {
165
165
  parseSlackThreadId
166
- } from "./chunk-BUJU6C2J.js";
166
+ } from "./chunk-4WIA45WD.js";
167
167
  import {
168
168
  appendAndEnqueueInboundMessage
169
- } from "./chunk-YFU4DGZY.js";
169
+ } from "./chunk-G4E5WIRL.js";
170
170
  import {
171
171
  SHORT_TITLE_MAX_LENGTH,
172
172
  ToolInputError,
@@ -174,7 +174,7 @@ import {
174
174
  generateShortTitle,
175
175
  hasAgentTurnUsage,
176
176
  resolveTaskTitle
177
- } from "./chunk-YKIAUKYH.js";
177
+ } from "./chunk-OBN7UEQJ.js";
178
178
  import {
179
179
  bindSandboxFileSystem,
180
180
  createSandboxSession,
@@ -185,7 +185,7 @@ import {
185
185
  resolve,
186
186
  setSnapshotSpanAttributes,
187
187
  stopSession
188
- } from "./chunk-2MKHYSYL.js";
188
+ } from "./chunk-3UJSII43.js";
189
189
  import {
190
190
  privateTraceResultAttributes
191
191
  } from "./chunk-UIE3R5XU.js";
@@ -195,7 +195,7 @@ import {
195
195
  } from "./chunk-X6GDDWQH.js";
196
196
  import {
197
197
  getTurnRequestDeadline
198
- } from "./chunk-7UJ6IJCK.js";
198
+ } from "./chunk-SZ2O3CGS.js";
199
199
  import {
200
200
  getVercelConversationWorkQueue
201
201
  } from "./chunk-DKIJ2RP5.js";
@@ -242,19 +242,19 @@ import {
242
242
  updateWorkspace,
243
243
  withSlackRetries,
244
244
  workspaceRepoCheckoutPath
245
- } from "./chunk-2MRF22J4.js";
245
+ } from "./chunk-BUTAWPUV.js";
246
246
  import {
247
247
  getConversationEventStore,
248
248
  getConversationMessageSearchStore,
249
249
  getConversationStore,
250
250
  getDb,
251
251
  getSqlExecutor
252
- } from "./chunk-OKAHLUSU.js";
252
+ } from "./chunk-AKR6W7VV.js";
253
253
  import {
254
254
  juniorArtifacts,
255
255
  juniorIdentities,
256
256
  juniorSchedulerRuns
257
- } from "./chunk-ZFCO2TMB.js";
257
+ } from "./chunk-IBO4YFFZ.js";
258
258
  import {
259
259
  SANDBOX_DATA_ROOT,
260
260
  SANDBOX_REPOS_ROOT,
@@ -285,12 +285,12 @@ import {
285
285
  throwSandboxOperationError,
286
286
  workspaceSnapshotNotReadyUserMessage,
287
287
  wrapSandboxSetupError
288
- } from "./chunk-HI5KXE3C.js";
288
+ } from "./chunk-6LX6KV5C.js";
289
289
  import {
290
290
  fenceLock,
291
291
  getStateAdapter,
292
292
  withLock
293
- } from "./chunk-6BXUSF7J.js";
293
+ } from "./chunk-LRTEMMCZ.js";
294
294
  import {
295
295
  KNOWN_CONVERSATION_EVENT_TYPES,
296
296
  contextProvenance,
@@ -323,7 +323,7 @@ import {
323
323
  resolveGatewayCredential,
324
324
  resolveGatewayModel,
325
325
  unwrapCurrentInstruction
326
- } from "./chunk-VWNIDTFR.js";
326
+ } from "./chunk-4Z7B5WVV.js";
327
327
  import {
328
328
  ModelProfileNotConfiguredError,
329
329
  TURN_REASONING_LEVELS,
@@ -340,16 +340,16 @@ import {
340
340
  toGenAiMessagesTraceAttributes,
341
341
  toGenAiPayloadMetadata,
342
342
  toGenAiPayloadTraceAttributes
343
- } from "./chunk-DVX6U6GI.js";
343
+ } from "./chunk-EYNUOZCN.js";
344
344
  import {
345
345
  discoverSkills,
346
346
  findSkillByName,
347
347
  loadSkillsByName,
348
348
  parseSkillInvocation
349
- } from "./chunk-REVH4BZU.js";
349
+ } from "./chunk-PYVGXGKC.js";
350
350
  import {
351
351
  pluginCatalogRuntime
352
- } from "./chunk-4PKEJK5B.js";
352
+ } from "./chunk-FGYWKKTJ.js";
353
353
  import {
354
354
  CredentialUnavailableError,
355
355
  OAuthProviderError,
@@ -357,7 +357,7 @@ import {
357
357
  getOAuthProviderErrorAttributes,
358
358
  resolveAuthTokenPlaceholder,
359
359
  resolvePluginCommandEnv
360
- } from "./chunk-663DQH5W.js";
360
+ } from "./chunk-6FCKJDKS.js";
361
361
  import {
362
362
  credentialContextForActor,
363
363
  credentialUserSubjectId
@@ -393,7 +393,7 @@ import {
393
393
  summarizeMessageText,
394
394
  withLogContext,
395
395
  withSpan
396
- } from "./chunk-Y4WL4OYD.js";
396
+ } from "./chunk-3ADPXQBL.js";
397
397
  import {
398
398
  startInactiveSpan,
399
399
  withActiveSpan
@@ -3220,10 +3220,6 @@ function createResourceEventInboundMessage(input) {
3220
3220
  delivery: "defer",
3221
3221
  source: "resource_event",
3222
3222
  receivedAtMs: input.receivedAtMs ?? Date.now(),
3223
- // TODO(dcramer): Store the final publish fact here after resource-event
3224
- // ingress loads the Conversation. Then remove the worker's Location-based
3225
- // publish default. Resource events only wake the mailbox until that change.
3226
- publishExternally: false,
3227
3223
  input: {
3228
3224
  text: input.text,
3229
3225
  authorId: RESOURCE_EVENT_AUTHOR_ID,
@@ -17881,7 +17877,6 @@ function createResumeState(args) {
17881
17877
  channelName: args.channelName,
17882
17878
  destination: args.destination,
17883
17879
  dispatchId: args.dispatchId,
17884
- publishExternally: args.publishExternally,
17885
17880
  source: args.runSource,
17886
17881
  actor: args.actor,
17887
17882
  surface: args.surface
@@ -18692,7 +18687,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
18692
18687
  slackConversation: run.slackConversation,
18693
18688
  slackActionToken: run.slackActionToken,
18694
18689
  destination: run.destination,
18695
- publishExternally: run.publishExternally,
18696
18690
  surface: run.surface,
18697
18691
  dispatch: run.dispatch,
18698
18692
  toolChannelId: run.toolChannelId
@@ -18847,7 +18841,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
18847
18841
  ...routing.dispatch?.id ? { dispatchId: routing.dispatch.id } : void 0,
18848
18842
  durability,
18849
18843
  recordActiveMcpProviders,
18850
- publishExternally: checkpoint.record?.publishExternally ?? routing.publishExternally ?? false,
18851
18844
  actor,
18852
18845
  runSource,
18853
18846
  conversationId,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AgentRunError,
3
3
  executeTurn
4
- } from "./chunk-IRQ3RSX3.js";
4
+ } from "./chunk-BGLMT6KP.js";
5
5
  import {
6
6
  ConversationTurnLifecycleService
7
- } from "./chunk-6H7YU6XH.js";
7
+ } from "./chunk-PXUBRZBU.js";
8
8
  import {
9
9
  getPersistedSandboxState,
10
10
  getPersistedThreadState,
11
11
  persistThreadStateById
12
- } from "./chunk-W2C4TPLB.js";
12
+ } from "./chunk-Z4DNJI5F.js";
13
13
  import {
14
14
  AgentInvocationBusyError,
15
15
  AgentInvocationLimitError,
@@ -18,32 +18,32 @@ import {
18
18
  agentBindingSchema,
19
19
  agentInvocationSchema,
20
20
  createAgentInvocationSchema
21
- } from "./chunk-OYCOLHCR.js";
21
+ } from "./chunk-PXP2M32M.js";
22
22
  import {
23
23
  TurnInputCommitLostError,
24
24
  getAssistantReplyText,
25
25
  getConversationTurnBoundaryError,
26
26
  isTurnInputCommitLostError
27
- } from "./chunk-67MMSYSE.js";
27
+ } from "./chunk-7XO7PTZE.js";
28
28
  import {
29
29
  failTurnRecord,
30
30
  getTerminalAssistantMessages,
31
31
  getTurnRecord,
32
32
  openConversationProjection,
33
33
  saveTurnCheckpoint
34
- } from "./chunk-BGOLRC36.js";
34
+ } from "./chunk-VF3EDS7P.js";
35
35
  import {
36
36
  appendAndEnqueueInboundMessage
37
- } from "./chunk-YFU4DGZY.js";
37
+ } from "./chunk-G4E5WIRL.js";
38
38
  import {
39
39
  getConversationEventStore,
40
40
  getConversationStore,
41
41
  getSqlExecutor
42
- } from "./chunk-OKAHLUSU.js";
42
+ } from "./chunk-AKR6W7VV.js";
43
43
  import {
44
44
  juniorAgentBindings,
45
45
  juniorAgentInvocations
46
- } from "./chunk-ZFCO2TMB.js";
46
+ } from "./chunk-IBO4YFFZ.js";
47
47
 
48
48
  // src/chat/agent-invocations/work.ts
49
49
  import { z } from "zod";
@@ -314,7 +314,6 @@ function buildAgentInvocationInboundMessage(invocation, nowMs = Date.now()) {
314
314
  }
315
315
  },
316
316
  receivedAtMs: nowMs,
317
- publishExternally: false,
318
317
  source: "internal"
319
318
  };
320
319
  }
@@ -590,7 +589,6 @@ function createAgentInvocationWorker(agentRunner) {
590
589
  actor: invocation.actor,
591
590
  credentialContext: invocation.credentialContext,
592
591
  destination: invocation.destination,
593
- publishExternally: context.publishExternally,
594
592
  source: invocation.source,
595
593
  ...location ? { location } : void 0,
596
594
  surface: "internal",
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-N7TMSOZH.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-Y4WL4OYD.js";
8
+ } from "./chunk-3ADPXQBL.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -7,7 +7,7 @@ import {
7
7
  toCanonicalInputMessage,
8
8
  toCanonicalOutputMessage,
9
9
  toGenAiMessagesTraceAttributes
10
- } from "./chunk-DVX6U6GI.js";
10
+ } from "./chunk-EYNUOZCN.js";
11
11
  import {
12
12
  extractGenAiUsageAttributes,
13
13
  logException,
@@ -15,7 +15,7 @@ import {
15
15
  normalizeGenAiFinishReason,
16
16
  serializeGenAiAttribute,
17
17
  withSpan
18
- } from "./chunk-Y4WL4OYD.js";
18
+ } from "./chunk-3ADPXQBL.js";
19
19
 
20
20
  // src/chat/services/provider-error.ts
21
21
  var ProviderError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-4PKEJK5B.js";
3
+ } from "./chunk-FGYWKKTJ.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-Y4WL4OYD.js";
15
+ } from "./chunk-3ADPXQBL.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-VWNIDTFR.js";
3
+ } from "./chunk-4Z7B5WVV.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-4PKEJK5B.js";
6
+ } from "./chunk-FGYWKKTJ.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-Y4WL4OYD.js";
10
+ } from "./chunk-3ADPXQBL.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  abandonTurnRecord,
3
3
  extractAssistantText
4
- } from "./chunk-BGOLRC36.js";
4
+ } from "./chunk-VF3EDS7P.js";
5
5
  import {
6
6
  buildDeterministicTurnId
7
7
  } from "./chunk-DA2KGZZI.js";
@@ -8,7 +8,7 @@ import {
8
8
  juniorConversations,
9
9
  juniorIdentities,
10
10
  juniorUsers
11
- } from "./chunk-ZFCO2TMB.js";
11
+ } from "./chunk-IBO4YFFZ.js";
12
12
  import {
13
13
  conversationEventDataSchema,
14
14
  decodeStoredConversationEvent,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-VFUK3X5B.js";
21
21
  import {
22
22
  getChatConfig
23
- } from "./chunk-VWNIDTFR.js";
23
+ } from "./chunk-4Z7B5WVV.js";
24
24
  import {
25
25
  parseActorUserId,
26
26
  parseSlackChannelReferenceId,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-N7TMSOZH.js";
29
29
  import {
30
30
  normalizeIdentityEmail
31
- } from "./chunk-Y4WL4OYD.js";
31
+ } from "./chunk-3ADPXQBL.js";
32
32
 
33
33
  // src/chat/conversations/sql/store.ts
34
34
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.190.0",
4
+ version: "0.192.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ConversationTurnLifecycleService
3
- } from "./chunk-6H7YU6XH.js";
3
+ } from "./chunk-PXUBRZBU.js";
4
4
  import {
5
5
  runAgentWithTimeout
6
- } from "./chunk-GWCFXTB6.js";
6
+ } from "./chunk-SSR6YBWW.js";
7
7
  import {
8
8
  getConversationEventStore
9
- } from "./chunk-OKAHLUSU.js";
9
+ } from "./chunk-AKR6W7VV.js";
10
10
 
11
11
  // src/chat/runtime/turn-execution.ts
12
12
  var AgentRunError = class extends Error {
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-OKAHLUSU.js";
8
+ } from "./chunk-AKR6W7VV.js";
9
9
  import {
10
10
  juniorCodeChanges,
11
11
  juniorCodeRepositories,
@@ -16,7 +16,7 @@ import {
16
16
  juniorUsers,
17
17
  juniorWorkspaceRepos,
18
18
  juniorWorkspaces
19
- } from "./chunk-ZFCO2TMB.js";
19
+ } from "./chunk-IBO4YFFZ.js";
20
20
  import {
21
21
  SANDBOX_WORKSPACE_ROOT,
22
22
  getVercelSandboxCredentials,
@@ -24,16 +24,16 @@ import {
24
24
  isSandboxMissingError,
25
25
  runNonInteractiveCommand,
26
26
  sleep
27
- } from "./chunk-HI5KXE3C.js";
27
+ } from "./chunk-6LX6KV5C.js";
28
28
  import {
29
29
  getStateAdapter
30
- } from "./chunk-6BXUSF7J.js";
30
+ } from "./chunk-LRTEMMCZ.js";
31
31
  import {
32
32
  botConfig,
33
33
  completeObject,
34
34
  embedTexts,
35
35
  getSlackBotToken
36
- } from "./chunk-VWNIDTFR.js";
36
+ } from "./chunk-4Z7B5WVV.js";
37
37
  import {
38
38
  defaultModelId
39
39
  } from "./chunk-D4YV5TDV.js";
@@ -52,7 +52,7 @@ import {
52
52
  setSpanAttributes,
53
53
  setSpanStatus,
54
54
  withSpan
55
- } from "./chunk-Y4WL4OYD.js";
55
+ } from "./chunk-3ADPXQBL.js";
56
56
 
57
57
  // src/chat/plugins/agent-hooks.ts
58
58
  import {
@@ -211,7 +211,7 @@ import { z } from "zod";
211
211
  var DAY_MS = 24 * 60 * 60 * 1e3;
212
212
  var costRowSchema = z.object({
213
213
  costUsd: z.number().finite().nonnegative(),
214
- date: z.string().date(),
214
+ date: z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),
215
215
  events: z.number().int().nonnegative()
216
216
  }).strict();
217
217
  function startOfUtcDay(value) {
@@ -231,6 +231,48 @@ function registeredEventName(plugin, eventName) {
231
231
  }
232
232
  function createPluginConversationEventStats(plugin, now = Date.now) {
233
233
  return {
234
+ async costsByHour(input) {
235
+ const eventName = registeredEventName(plugin, input.eventName);
236
+ const hourCount = input.hours ?? 24;
237
+ const end = new Date(now());
238
+ end.setUTCMinutes(0, 0, 0);
239
+ const start = new Date(end.getTime() - (hourCount - 1) * 60 * 60 * 1e3);
240
+ const endExclusive = new Date(end.getTime() + 60 * 60 * 1e3);
241
+ const date = sql`TO_CHAR(
242
+ ${juniorConversationEvents.createdAt} AT TIME ZONE 'UTC',
243
+ 'YYYY-MM-DD"T"HH24'
244
+ )`;
245
+ const cost = sql`CASE
246
+ WHEN jsonb_typeof(${juniorConversationEvents.payload}->'content'->'costUsd') = 'number'
247
+ THEN (${juniorConversationEvents.payload}->'content'->>'costUsd')::double precision
248
+ ELSE 0
249
+ END`;
250
+ const rows = await getDb().select({
251
+ costUsd: sql`SUM(${cost})::double precision`.mapWith(Number),
252
+ date,
253
+ events: sql`COUNT(*)::integer`.mapWith(Number)
254
+ }).from(juniorConversationEvents).where(
255
+ and2(
256
+ eq2(juniorConversationEvents.type, "structured_event"),
257
+ sql`${juniorConversationEvents.payload}->>'namespace' = ${plugin.manifest.name}`,
258
+ sql`${juniorConversationEvents.payload}->>'name' = ${eventName}`,
259
+ gte(juniorConversationEvents.createdAt, start),
260
+ lt(juniorConversationEvents.createdAt, endExclusive)
261
+ )
262
+ ).groupBy(date);
263
+ const byHour = new Map(
264
+ z.array(costRowSchema).parse(rows).map((row) => [row.date, row])
265
+ );
266
+ return Array.from({ length: hourCount }, (_, index) => {
267
+ const hour = new Date(start.getTime() + index * 60 * 60 * 1e3);
268
+ const key = hour.toISOString().slice(0, 13);
269
+ return byHour.get(key) ?? {
270
+ costUsd: 0,
271
+ date: key,
272
+ events: 0
273
+ };
274
+ });
275
+ },
234
276
  async costsByDay(input) {
235
277
  const eventName = registeredEventName(plugin, input.eventName);
236
278
  const end = startOfUtcDay(now());
@@ -3191,7 +3233,7 @@ function sanitizeOperationalReport(args) {
3191
3233
  sanitizedWidget.emptyText = emptyText;
3192
3234
  }
3193
3235
  const timeRangeDays = widget.timeRangeDays?.filter(
3194
- (days) => days === 7 || days === 30 || days === 90
3236
+ (days) => days === 1 || days === 7 || days === 30 || days === 90
3195
3237
  );
3196
3238
  if (timeRangeDays?.length) {
3197
3239
  sanitizedWidget.timeRangeDays = [...new Set(timeRangeDays)];
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-YKIAUKYH.js";
3
+ } from "./chunk-OBN7UEQJ.js";
4
4
  import {
5
5
  getPlugins
6
- } from "./chunk-2MRF22J4.js";
6
+ } from "./chunk-BUTAWPUV.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-OKAHLUSU.js";
9
+ } from "./chunk-AKR6W7VV.js";
10
10
  import {
11
11
  juniorAttachments,
12
12
  juniorConversations,
@@ -14,7 +14,7 @@ import {
14
14
  juniorSchedulerRuns,
15
15
  juniorSchedulerTasks,
16
16
  juniorStats
17
- } from "./chunk-ZFCO2TMB.js";
17
+ } from "./chunk-IBO4YFFZ.js";
18
18
  import {
19
19
  juniorDestinations
20
20
  } from "./chunk-VFUK3X5B.js";