@sentry/junior 0.191.0 → 0.193.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/{agent-hooks-HIWWBBKO.js → agent-hooks-DWY3MZZ7.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 +50 -83
  18. package/dist/{catalog-runtime-4OKH4265.js → catalog-runtime-NAD44W5K.js} +4 -4
  19. package/dist/chat/agent/prompt.d.ts +1 -1
  20. package/dist/chat/agent-dispatch/types.d.ts +2 -1
  21. package/dist/chat/agent-dispatch/validation.d.ts +1 -1
  22. package/dist/chat/agent-invocations/types.d.ts +24 -28
  23. package/dist/chat/event-tasks/tool-support.d.ts +10 -1
  24. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  25. package/dist/chat/prompt.d.ts +4 -5
  26. package/dist/chat/services/turn-session-routing.d.ts +4 -3
  27. package/dist/chat/slack/tool-support/context.d.ts +3 -6
  28. package/dist/chat/source.d.ts +4 -6
  29. package/dist/chat/tasks/execution-stats.d.ts +12 -0
  30. package/dist/chat/tools/delete-event-task.d.ts +1 -1
  31. package/dist/chat/tools/types.d.ts +10 -9
  32. package/dist/chat/tools/update-event-task.d.ts +1 -1
  33. package/dist/{chunk-S7NSFCCW.js → chunk-2CYWEVOP.js} +4 -4
  34. package/dist/{chunk-6KISW5UY.js → chunk-3YZ2Q6AW.js} +2 -2
  35. package/dist/{chunk-X6PQKQTY.js → chunk-42N6CDWF.js} +4 -4
  36. package/dist/{chunk-Q32BSFN4.js → chunk-4UA5C7AM.js} +32 -25
  37. package/dist/{chunk-VGYZ3YZM.js → chunk-5E5SLAVD.js} +21 -21
  38. package/dist/{chunk-3PDR63SX.js → chunk-5LEVZYXF.js} +4 -4
  39. package/dist/{chunk-SEIZ2XLD.js → chunk-5S6AQFNG.js} +1 -1
  40. package/dist/{chunk-AWFSSFAX.js → chunk-AZVDODSP.js} +11 -11
  41. package/dist/{chunk-LOYTPSAK.js → chunk-BFP3ZKG6.js} +12 -8
  42. package/dist/{chunk-GQN4REF5.js → chunk-COCVPDWX.js} +11 -7
  43. package/dist/{chunk-CECRMPXJ.js → chunk-D4XQZOHB.js} +8 -8
  44. package/dist/{chunk-WNIVCR74.js → chunk-D5YQPCEG.js} +2 -2
  45. package/dist/{chunk-CCPOZMS4.js → chunk-DVU734PI.js} +3 -3
  46. package/dist/{chunk-EQZUBYRF.js → chunk-DXFUYLHX.js} +1 -1
  47. package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
  48. package/dist/{chunk-NK3UEKAW.js → chunk-FQ5HFSFR.js} +81 -33
  49. package/dist/{chunk-K2NKG42A.js → chunk-GTXQHZ2O.js} +5 -5
  50. package/dist/{chunk-BVWC5DBM.js → chunk-GUKGU6R7.js} +1 -1
  51. package/dist/{chunk-ZJRGWZZ2.js → chunk-GUMBIDDL.js} +74 -4
  52. package/dist/{chunk-DP6H3U2X.js → chunk-HMBTX5RK.js} +1 -1
  53. package/dist/{chunk-CUUE5MGF.js → chunk-IBXXTO3J.js} +3 -3
  54. package/dist/{chunk-YNRLCUCB.js → chunk-IOUUS6H4.js} +1 -1
  55. package/dist/{chunk-MFZOIKET.js → chunk-IQCL5JGL.js} +1 -1
  56. package/dist/{chunk-WCSXTDOL.js → chunk-K47OVEO4.js} +1 -1
  57. package/dist/{chunk-7PYCRKQL.js → chunk-KWXZMHJS.js} +3 -3
  58. package/dist/{chunk-5IMKUVMS.js → chunk-LG7Q4OW4.js} +9 -9
  59. package/dist/{chunk-HNMRX2EN.js → chunk-LXRTHE43.js} +6 -7
  60. package/dist/{chunk-RZS4F5K4.js → chunk-N6Q2PNSI.js} +3 -3
  61. package/dist/{chunk-BVYUIVXE.js → chunk-OICYQPKP.js} +1 -1
  62. package/dist/{chunk-NY5SJGJZ.js → chunk-PYBFVK6K.js} +73 -64
  63. package/dist/{chunk-ZNFNGDT7.js → chunk-QDU5MW2R.js} +1 -1
  64. package/dist/{chunk-QRNJO7DZ.js → chunk-QWY4KI2V.js} +1 -1
  65. package/dist/{chunk-L4JLLS6C.js → chunk-QY2IU47O.js} +1 -1
  66. package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
  67. package/dist/{chunk-SGRL7NV6.js → chunk-S5HS6WRH.js} +5 -5
  68. package/dist/{chunk-WBNQYVCM.js → chunk-THFNL3TL.js} +3 -4
  69. package/dist/{chunk-ZRN3OS7M.js → chunk-THYNA2QN.js} +1 -1
  70. package/dist/{chunk-TH6LMEOW.js → chunk-WH5VV2RW.js} +1 -1
  71. package/dist/{chunk-2JAWOTUT.js → chunk-WJJDQLVL.js} +2 -2
  72. package/dist/{chunk-KTW62MG5.js → chunk-ZFPEPWOO.js} +6 -6
  73. package/dist/cli/chat.js +33 -33
  74. package/dist/cli/check.js +5 -5
  75. package/dist/cli/plugins.js +12 -12
  76. package/dist/cli/snapshot-create.js +9 -9
  77. package/dist/cli/upgrade.js +6 -6
  78. package/dist/db/schema/agent-invocations.d.ts +16 -0
  79. package/dist/db/schema/stats.d.ts +5 -1
  80. package/dist/db/schema.d.ts +16 -0
  81. package/dist/{db-LG4ZEWA3.js → db-H5MDRQEY.js} +6 -6
  82. package/dist/instrumentation.js +3 -3
  83. package/dist/nitro.js +6 -6
  84. package/dist/{oauth-callback-server-KI7ZRTOG.js → oauth-callback-server-IOU3NUHT.js} +29 -29
  85. package/dist/reporting-schema.d.ts +2 -2
  86. package/dist/{runner-K2EOSAZQ.js → runner-FZ5ZHLFG.js} +21 -21
  87. package/dist/{skills-JTRDFKMA.js → skills-AR3WD6BX.js} +5 -5
  88. package/dist/spawn-ZU6JABR7.js +42 -0
  89. package/dist/task-runner-EEGGG2PM.js +36 -0
  90. package/dist/{validation-NBWURHAP.js → validation-VYE7TQY7.js} +5 -5
  91. package/dist/version.js +1 -1
  92. package/dist/{work-35TBEAUI.js → work-CTQFWYKE.js} +21 -21
  93. package/dist/{worker-F762M6XM.js → worker-6WQU3IT5.js} +10 -10
  94. package/package.json +5 -5
  95. package/dist/spawn-SRBETYCF.js +0 -42
  96. package/dist/task-runner-INQIQ4VF.js +0 -36
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getDb
3
- } from "./chunk-S7NSFCCW.js";
3
+ } from "./chunk-2CYWEVOP.js";
4
4
  import {
5
5
  juniorConversations,
6
6
  juniorTaskExecutions
7
- } from "./chunk-SEIZ2XLD.js";
7
+ } from "./chunk-5S6AQFNG.js";
8
8
  import {
9
9
  logWarn
10
- } from "./chunk-L4JLLS6C.js";
10
+ } from "./chunk-QY2IU47O.js";
11
11
 
12
12
  // src/chat/tasks/execution-stats.ts
13
13
  import {
@@ -139,6 +139,37 @@ async function readTaskExecutionDays(dayCount = 90, options = {}) {
139
139
  }
140
140
  return [...byDate.values()];
141
141
  }
142
+ async function readTaskExecutionHours(hourCount = 24, options = {}) {
143
+ const nowMs = options.nowMs ?? Date.now();
144
+ const end = new Date(nowMs);
145
+ end.setUTCMinutes(0, 0, 0);
146
+ const endMs = end.getTime() + 3599999;
147
+ const startMs = end.getTime() - (hourCount - 1) * 36e5;
148
+ const executionHour = sql`to_char(to_timestamp(${juniorTaskExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD"T"HH24')`;
149
+ const rows = await getDb().select({
150
+ count: count(),
151
+ date: executionHour,
152
+ kind: juniorTaskExecutions.kind
153
+ }).from(juniorTaskExecutions).where(
154
+ and(
155
+ gte(juniorTaskExecutions.executedAtMs, startMs),
156
+ lte(juniorTaskExecutions.executedAtMs, endMs),
157
+ eq(juniorTaskExecutions.status, "completed")
158
+ )
159
+ ).groupBy(executionHour, juniorTaskExecutions.kind).orderBy(asc(executionHour), asc(juniorTaskExecutions.kind));
160
+ const byHour = /* @__PURE__ */ new Map();
161
+ for (let offset = 0; offset < hourCount; offset += 1) {
162
+ const date = new Date(startMs + offset * 36e5).toISOString().slice(0, 13);
163
+ byHour.set(date, emptyDay(date));
164
+ }
165
+ for (const row of rows) {
166
+ const hour = byHour.get(row.date);
167
+ if (!hour) continue;
168
+ if (row.kind === "scheduled") hour.scheduled = row.count;
169
+ else if (row.kind === "event") hour.event = row.count;
170
+ }
171
+ return [...byHour.values()];
172
+ }
142
173
  async function readTaskExecutionByConversationId(args) {
143
174
  const namespace = args.namespace ?? "junior";
144
175
  const rows = await getDb().select({
@@ -273,13 +304,52 @@ async function readTaskExecutionStatusDays(args) {
273
304
  }
274
305
  return [...byDate.values()];
275
306
  }
307
+ async function readTaskExecutionStatusHours(args) {
308
+ const hourCount = args.hourCount ?? 24;
309
+ const namespace = args.namespace ?? "junior";
310
+ const nowMs = args.nowMs ?? Date.now();
311
+ const end = new Date(nowMs);
312
+ end.setUTCMinutes(0, 0, 0);
313
+ const endMs = end.getTime() + 3599999;
314
+ const startMs = end.getTime() - (hourCount - 1) * 36e5;
315
+ const executionHour = sql`to_char(to_timestamp(${juniorTaskExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD"T"HH24')`;
316
+ const rows = await getDb().select({
317
+ count: count(),
318
+ date: executionHour,
319
+ status: juniorTaskExecutions.status
320
+ }).from(juniorTaskExecutions).where(
321
+ and(
322
+ eq(juniorTaskExecutions.kind, args.kind),
323
+ eq(juniorTaskExecutions.namespace, namespace),
324
+ eq(juniorTaskExecutions.taskId, args.taskId),
325
+ gte(juniorTaskExecutions.executedAtMs, startMs),
326
+ lte(juniorTaskExecutions.executedAtMs, endMs),
327
+ inArray(juniorTaskExecutions.status, [...TASK_EXECUTION_STATUSES])
328
+ )
329
+ ).groupBy(executionHour, juniorTaskExecutions.status).orderBy(asc(executionHour), asc(juniorTaskExecutions.status));
330
+ const byHour = /* @__PURE__ */ new Map();
331
+ for (let offset = 0; offset < hourCount; offset += 1) {
332
+ const date = new Date(startMs + offset * 36e5).toISOString().slice(0, 13);
333
+ byHour.set(date, emptyStatusDay(date));
334
+ }
335
+ for (const row of rows) {
336
+ const hour = byHour.get(row.date);
337
+ if (!hour) continue;
338
+ if (row.status === "completed") hour.completed = row.count;
339
+ else if (row.status === "failed") hour.failed = row.count;
340
+ else if (row.status === "blocked") hour.blocked = row.count;
341
+ }
342
+ return [...byHour.values()];
343
+ }
276
344
 
277
345
  export {
278
346
  recordTaskExecution,
279
347
  readTaskExecutionSummaries,
280
348
  readTaskExecutionDays,
349
+ readTaskExecutionHours,
281
350
  readTaskExecutionByConversationId,
282
351
  readTaskExecutions,
283
352
  readTaskRuns,
284
- readTaskExecutionStatusDays
353
+ readTaskExecutionStatusDays,
354
+ readTaskExecutionStatusHours
285
355
  };
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-N7TMSOZH.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-L4JLLS6C.js";
8
+ } from "./chunk-QY2IU47O.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -6,14 +6,14 @@ import {
6
6
  isStale,
7
7
  runNonInteractiveCommand,
8
8
  sleep
9
- } from "./chunk-7PYCRKQL.js";
9
+ } from "./chunk-KWXZMHJS.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-YNRLCUCB.js";
12
+ } from "./chunk-IOUUS6H4.js";
13
13
  import {
14
14
  setSpanAttributes,
15
15
  withSpan
16
- } from "./chunk-L4JLLS6C.js";
16
+ } from "./chunk-QY2IU47O.js";
17
17
 
18
18
  // src/chat/sandbox/resources.ts
19
19
  var configuredResources;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-2JAWOTUT.js";
3
+ } from "./chunk-WJJDQLVL.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-2JAWOTUT.js";
4
+ } from "./chunk-WJJDQLVL.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  abandonTurnRecord,
3
3
  extractAssistantText
4
- } from "./chunk-KTW62MG5.js";
4
+ } from "./chunk-ZFPEPWOO.js";
5
5
  import {
6
6
  buildDeterministicTurnId
7
7
  } from "./chunk-DA2KGZZI.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-2JAWOTUT.js";
3
+ } from "./chunk-WJJDQLVL.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-EQZUBYRF.js";
6
+ } from "./chunk-DXFUYLHX.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-L4JLLS6C.js";
10
+ } from "./chunk-QY2IU47O.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -1,41 +1,41 @@
1
1
  import {
2
2
  healthReportSchema
3
- } from "./chunk-UTL3MHPC.js";
3
+ } from "./chunk-RC745GGZ.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-DP6H3U2X.js";
6
+ } from "./chunk-HMBTX5RK.js";
7
7
  import {
8
8
  appendAndEnqueueExclusiveInboundMessage,
9
9
  appendAndEnqueueInboundMessage
10
- } from "./chunk-3PDR63SX.js";
10
+ } from "./chunk-5LEVZYXF.js";
11
11
  import {
12
12
  buildDeterministicTurnId
13
13
  } from "./chunk-DA2KGZZI.js";
14
14
  import {
15
15
  normalizeSlackConversationId
16
- } from "./chunk-NK3UEKAW.js";
16
+ } from "./chunk-FQ5HFSFR.js";
17
17
  import {
18
18
  getConversationStore,
19
19
  getDb
20
- } from "./chunk-S7NSFCCW.js";
20
+ } from "./chunk-2CYWEVOP.js";
21
21
  import {
22
22
  juniorConversationParticipants,
23
23
  juniorConversations,
24
24
  juniorIdentities,
25
25
  juniorUsers
26
- } from "./chunk-SEIZ2XLD.js";
26
+ } from "./chunk-5S6AQFNG.js";
27
27
  import {
28
28
  juniorDestinations
29
29
  } from "./chunk-VFUK3X5B.js";
30
30
  import {
31
31
  getSlackBotToken
32
- } from "./chunk-2JAWOTUT.js";
32
+ } from "./chunk-WJJDQLVL.js";
33
33
  import {
34
34
  canExposeConversationPayload
35
- } from "./chunk-BVYUIVXE.js";
35
+ } from "./chunk-OICYQPKP.js";
36
36
  import {
37
37
  logWarn
38
- } from "./chunk-L4JLLS6C.js";
38
+ } from "./chunk-QY2IU47O.js";
39
39
 
40
40
  // src/handlers/health.ts
41
41
  function readHealthReport() {
@@ -7,23 +7,23 @@ import {
7
7
  import {
8
8
  formatProviderLabel,
9
9
  startOAuthFlow
10
- } from "./chunk-GQN4REF5.js";
10
+ } from "./chunk-COCVPDWX.js";
11
11
  import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink
14
- } from "./chunk-WCSXTDOL.js";
14
+ } from "./chunk-K47OVEO4.js";
15
15
  import {
16
16
  recordAuthorizationRequested
17
- } from "./chunk-KTW62MG5.js";
17
+ } from "./chunk-ZFPEPWOO.js";
18
18
  import {
19
19
  AGENT_INVOCATION_MAILBOX_STATUSES
20
- } from "./chunk-SEIZ2XLD.js";
20
+ } from "./chunk-5S6AQFNG.js";
21
21
  import {
22
22
  TURN_REASONING_LEVELS
23
23
  } from "./chunk-D4YV5TDV.js";
24
24
  import {
25
25
  pluginCatalogRuntime
26
- } from "./chunk-EQZUBYRF.js";
26
+ } from "./chunk-DXFUYLHX.js";
27
27
  import {
28
28
  credentialContextSchema
29
29
  } from "./chunk-CEMMLV5L.js";
@@ -302,8 +302,7 @@ var createAgentInvocationSchema = z.object({
302
302
  idempotencyKey: exactStringSchema,
303
303
  input: exactStringSchema,
304
304
  parentConversationId: exactStringSchema,
305
- reasoningLevel: z.enum(TURN_REASONING_LEVELS).optional(),
306
- source: sourceSchema
305
+ reasoningLevel: z.enum(TURN_REASONING_LEVELS).optional()
307
306
  }).strict();
308
307
 
309
308
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runWithTurnRequestDeadline
3
- } from "./chunk-MFZOIKET.js";
3
+ } from "./chunk-IQCL5JGL.js";
4
4
  import {
5
5
  QUEUE_SIGNATURE_MAX_AGE_MS,
6
6
  createVercelQueueClient,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-7H2VZTWN.js";
10
10
  import {
11
11
  logWarn
12
- } from "./chunk-L4JLLS6C.js";
12
+ } from "./chunk-QY2IU47O.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-INQIQ4VF.js");
132
+ const { processPluginTask } = await import("./task-runner-EEGGG2PM.js");
133
133
  await processPluginTask(message);
134
134
  },
135
135
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-L4JLLS6C.js";
3
+ } from "./chunk-QY2IU47O.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";