@sentry/junior 0.193.0 → 0.195.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 (99) hide show
  1. package/dist/{agent-hooks-DWY3MZZ7.js → agent-hooks-VIBTIP5F.js} +11 -11
  2. package/dist/api/activity.d.ts +9 -1
  3. package/dist/api/code/overview.d.ts +12 -0
  4. package/dist/api/conversations/aggregate.d.ts +2 -0
  5. package/dist/api/conversations/list.d.ts +1 -1
  6. package/dist/api/conversations/projection.d.ts +1 -1
  7. package/dist/api/locations/detail.d.ts +9 -1
  8. package/dist/api/locations/list.d.ts +5 -0
  9. package/dist/api/people/code.d.ts +6 -0
  10. package/dist/api/people/shared.d.ts +9 -1
  11. package/dist/api/reporting-window.d.ts +39 -1
  12. package/dist/api/schema/code.d.ts +12 -0
  13. package/dist/api/schema/conversation.d.ts +28 -3
  14. package/dist/api/schema/location.d.ts +14 -1
  15. package/dist/api/schema/person.d.ts +15 -1
  16. package/dist/api/schema/task.d.ts +83 -8
  17. package/dist/api/schema.d.ts +2 -2
  18. package/dist/api/schema.js +3 -1
  19. package/dist/api.js +320 -222
  20. package/dist/app.js +108 -39
  21. package/dist/{catalog-runtime-NAD44W5K.js → catalog-runtime-6E6SGRZK.js} +4 -4
  22. package/dist/chat/agent/resume.d.ts +2 -0
  23. package/dist/chat/config.d.ts +2 -0
  24. package/dist/chat/conversations/history.d.ts +4 -2
  25. package/dist/chat/event-tasks/store.d.ts +27 -17
  26. package/dist/chat/resource-events/notification.d.ts +2 -1
  27. package/dist/chat/services/automated-turn-limit.d.ts +110 -0
  28. package/dist/chat/services/turn-limit.d.ts +11 -1
  29. package/dist/chat/slack/automated-turn-limit-notice.d.ts +38 -0
  30. package/dist/chat/slack/{source-link.d.ts → location-url.d.ts} +1 -1
  31. package/dist/chat/task-execution/checkpoint.d.ts +2 -0
  32. package/dist/chat/task-execution/turn-cursor.d.ts +3 -0
  33. package/dist/chat/tasks/execution-stats.d.ts +15 -2
  34. package/dist/chat/tasks/read.d.ts +5 -2
  35. package/dist/chat/usage.d.ts +4 -0
  36. package/dist/{chunk-GUKGU6R7.js → chunk-3VWIZVK7.js} +1 -1
  37. package/dist/{chunk-THYNA2QN.js → chunk-5HNXLP4W.js} +1 -1
  38. package/dist/{chunk-GUMBIDDL.js → chunk-5NR7N567.js} +194 -43
  39. package/dist/{chunk-N6Q2PNSI.js → chunk-6GGDBXXP.js} +3 -3
  40. package/dist/{chunk-HMBTX5RK.js → chunk-6TRQLG3D.js} +1 -1
  41. package/dist/{chunk-IOUUS6H4.js → chunk-7MYXH5LA.js} +1 -1
  42. package/dist/{chunk-WH5VV2RW.js → chunk-7PQMTME5.js} +1 -1
  43. package/dist/{chunk-5E5SLAVD.js → chunk-7UED4D5T.js} +23 -25
  44. package/dist/{chunk-4UA5C7AM.js → chunk-BJZML4RT.js} +8 -8
  45. package/dist/{chunk-QDU5MW2R.js → chunk-C4NY6L7S.js} +1 -1
  46. package/dist/{chunk-DVU734PI.js → chunk-CE2P6TOV.js} +3 -3
  47. package/dist/{chunk-BFP3ZKG6.js → chunk-DTYOEHUP.js} +148 -19
  48. package/dist/{chunk-S5HS6WRH.js → chunk-FE3Y4KES.js} +5 -5
  49. package/dist/{chunk-PYBFVK6K.js → chunk-FEZIEEOP.js} +985 -569
  50. package/dist/{chunk-5S6AQFNG.js → chunk-FPQPYJEG.js} +23 -29
  51. package/dist/{chunk-42N6CDWF.js → chunk-HE5PZAPS.js} +4 -4
  52. package/dist/{chunk-QY2IU47O.js → chunk-HUQOXMDG.js} +1 -1
  53. package/dist/{chunk-IQCL5JGL.js → chunk-I4RH3KLJ.js} +1 -1
  54. package/dist/{chunk-LXRTHE43.js → chunk-JBSCMOLR.js} +5 -5
  55. package/dist/{chunk-OICYQPKP.js → chunk-KBPWC7NU.js} +1 -1
  56. package/dist/{chunk-2CYWEVOP.js → chunk-KQ3GZGBK.js} +88 -68
  57. package/dist/{chunk-GTXQHZ2O.js → chunk-KUQRWV53.js} +5 -5
  58. package/dist/{chunk-IBXXTO3J.js → chunk-L62JVQPL.js} +3 -3
  59. package/dist/{chunk-KWXZMHJS.js → chunk-LM7UE523.js} +3 -3
  60. package/dist/{chunk-WJJDQLVL.js → chunk-LMYRF6HX.js} +6 -2
  61. package/dist/{chunk-AZVDODSP.js → chunk-N67T4VY3.js} +9 -9
  62. package/dist/{chunk-D4XQZOHB.js → chunk-OQHO62VA.js} +8 -8
  63. package/dist/{chunk-FQ5HFSFR.js → chunk-PFQRZ4IB.js} +9 -6
  64. package/dist/{chunk-LG7Q4OW4.js → chunk-PYTRZZ4V.js} +8 -8
  65. package/dist/{chunk-THFNL3TL.js → chunk-QHJZSYKY.js} +2 -2
  66. package/dist/{chunk-5LEVZYXF.js → chunk-QKHZF2LH.js} +4 -4
  67. package/dist/{chunk-EYIMZY5O.js → chunk-QPZL2IYT.js} +100 -9
  68. package/dist/{chunk-D5YQPCEG.js → chunk-R5BGW4WR.js} +24 -2
  69. package/dist/{chunk-COCVPDWX.js → chunk-R5OHONYU.js} +6 -6
  70. package/dist/{chunk-DXFUYLHX.js → chunk-RKA22BQP.js} +1 -1
  71. package/dist/{chunk-3YZ2Q6AW.js → chunk-RQO67SAO.js} +2 -2
  72. package/dist/{chunk-ZFPEPWOO.js → chunk-RZ3PBNDV.js} +60 -29
  73. package/dist/{chunk-K47OVEO4.js → chunk-VYDIA2UL.js} +1 -1
  74. package/dist/{chunk-QWY4KI2V.js → chunk-X3PBQ4BK.js} +1 -1
  75. package/dist/cli/chat.js +33 -33
  76. package/dist/cli/check.js +5 -5
  77. package/dist/cli/plugins.js +12 -12
  78. package/dist/cli/snapshot-create.js +9 -9
  79. package/dist/cli/upgrade.js +6 -6
  80. package/dist/db/schema/event-tasks.d.ts +21 -0
  81. package/dist/db/schema.d.ts +19 -0
  82. package/dist/{db-H5MDRQEY.js → db-FVCSDROR.js} +6 -6
  83. package/dist/instrumentation.js +3 -3
  84. package/dist/nitro.js +6 -6
  85. package/dist/{oauth-callback-server-IOU3NUHT.js → oauth-callback-server-Z5PXTDOE.js} +29 -29
  86. package/dist/{runner-FZ5ZHLFG.js → runner-RHYU7OGV.js} +21 -21
  87. package/dist/{skills-AR3WD6BX.js → skills-QTN73DN5.js} +5 -5
  88. package/dist/spawn-R56OWLUH.js +42 -0
  89. package/dist/task-runner-LLJZTLRP.js +36 -0
  90. package/dist/{validation-VYE7TQY7.js → validation-2ZK7GA6N.js} +5 -5
  91. package/dist/version.js +1 -1
  92. package/dist/{work-CTQFWYKE.js → work-7IBKSZRU.js} +21 -21
  93. package/dist/{worker-6WQU3IT5.js → worker-RNVQVCO7.js} +10 -10
  94. package/migrations/0038_event_task_status.sql +5 -0
  95. package/migrations/meta/0038_snapshot.json +3323 -0
  96. package/migrations/meta/_journal.json +8 -1
  97. package/package.json +4 -4
  98. package/dist/spawn-ZU6JABR7.js +0 -42
  99. package/dist/task-runner-EEGGG2PM.js +0 -36
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-2CYWEVOP.js";
8
+ } from "./chunk-KQ3GZGBK.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-5S6AQFNG.js";
19
+ } from "./chunk-FPQPYJEG.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-KWXZMHJS.js";
27
+ } from "./chunk-LM7UE523.js";
28
28
  import {
29
29
  getStateAdapter
30
- } from "./chunk-IOUUS6H4.js";
30
+ } from "./chunk-7MYXH5LA.js";
31
31
  import {
32
32
  botConfig,
33
33
  completeObject,
34
34
  embedTexts,
35
35
  getSlackBotToken
36
- } from "./chunk-WJJDQLVL.js";
36
+ } from "./chunk-LMYRF6HX.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-QY2IU47O.js";
55
+ } from "./chunk-HUQOXMDG.js";
56
56
 
57
57
  // src/chat/plugins/agent-hooks.ts
58
58
  import {
@@ -3523,6 +3523,9 @@ function createPluginHookRunner(input = {}) {
3523
3523
  name: tool.name,
3524
3524
  input: nextInput
3525
3525
  },
3526
+ users: {
3527
+ resolveActor: async () => input.actor ? await readActorIdentity(input.actor) : void 0
3528
+ },
3526
3529
  env: {
3527
3530
  get(key) {
3528
3531
  return env[key] ?? normalizeEnv(nextInput.env)[key];
@@ -3,39 +3,39 @@ import {
3
3
  } from "./chunk-RC745GGZ.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-HMBTX5RK.js";
6
+ } from "./chunk-6TRQLG3D.js";
7
7
  import {
8
8
  appendAndEnqueueExclusiveInboundMessage,
9
9
  appendAndEnqueueInboundMessage
10
- } from "./chunk-5LEVZYXF.js";
10
+ } from "./chunk-QKHZF2LH.js";
11
11
  import {
12
12
  buildDeterministicTurnId
13
13
  } from "./chunk-DA2KGZZI.js";
14
14
  import {
15
15
  normalizeSlackConversationId
16
- } from "./chunk-FQ5HFSFR.js";
16
+ } from "./chunk-PFQRZ4IB.js";
17
17
  import {
18
18
  getConversationStore,
19
19
  getDb
20
- } from "./chunk-2CYWEVOP.js";
20
+ } from "./chunk-KQ3GZGBK.js";
21
21
  import {
22
22
  juniorConversationParticipants,
23
23
  juniorConversations,
24
24
  juniorIdentities,
25
25
  juniorUsers
26
- } from "./chunk-5S6AQFNG.js";
26
+ } from "./chunk-FPQPYJEG.js";
27
27
  import {
28
28
  juniorDestinations
29
29
  } from "./chunk-VFUK3X5B.js";
30
30
  import {
31
31
  getSlackBotToken
32
- } from "./chunk-WJJDQLVL.js";
32
+ } from "./chunk-LMYRF6HX.js";
33
33
  import {
34
34
  canExposeConversationPayload
35
- } from "./chunk-OICYQPKP.js";
35
+ } from "./chunk-KBPWC7NU.js";
36
36
  import {
37
37
  logWarn
38
- } from "./chunk-QY2IU47O.js";
38
+ } from "./chunk-HUQOXMDG.js";
39
39
 
40
40
  // src/handlers/health.ts
41
41
  function readHealthReport() {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-AZVDODSP.js";
3
+ } from "./chunk-N67T4VY3.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
7
- } from "./chunk-COCVPDWX.js";
7
+ } from "./chunk-R5OHONYU.js";
8
8
 
9
9
  // src/chat/agent-invocations/spawn.ts
10
10
  function bindSpawnAgent(run, options) {
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-2CYWEVOP.js";
11
+ } from "./chunk-KQ3GZGBK.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-IOUUS6H4.js";
15
+ } from "./chunk-7MYXH5LA.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-WJJDQLVL.js";
18
+ } from "./chunk-LMYRF6HX.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-N7TMSOZH.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-QY2IU47O.js";
26
+ } from "./chunk-HUQOXMDG.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -14,8 +14,11 @@ import { z } from "zod";
14
14
 
15
15
  // src/api/reporting-window.ts
16
16
  var HOUR_MS = 60 * 60 * 1e3;
17
+ var SIX_HOUR_MS = 6 * HOUR_MS;
17
18
  var DAY_MS = 24 * HOUR_MS;
18
19
  var WINDOW_HOURS = 24;
20
+ var WINDOW_SEVEN_DAY_HOURS = 7 * 24;
21
+ var WINDOW_SIX_HOURS = 7 * 4;
19
22
  function startOfUtcDay(valueMs) {
20
23
  const date = new Date(valueMs);
21
24
  date.setUTCHours(0, 0, 0, 0);
@@ -26,6 +29,11 @@ function startOfUtcHour(valueMs) {
26
29
  date.setUTCMinutes(0, 0, 0);
27
30
  return date;
28
31
  }
32
+ function startOfUtcSixHour(valueMs) {
33
+ const date = startOfUtcHour(valueMs);
34
+ date.setUTCHours(Math.floor(date.getUTCHours() / 6) * 6, 0, 0, 0);
35
+ return date;
36
+ }
29
37
  function utcDayKey(value) {
30
38
  const date = typeof value === "number" ? new Date(value) : value;
31
39
  return date.toISOString().slice(0, 10);
@@ -34,6 +42,11 @@ function utcHourKey(value) {
34
42
  const date = typeof value === "number" ? new Date(value) : value;
35
43
  return date.toISOString().slice(0, 13);
36
44
  }
45
+ function utcSixHourKey(value) {
46
+ return utcHourKey(startOfUtcSixHour(
47
+ typeof value === "number" ? value : value.getTime()
48
+ ));
49
+ }
37
50
  function trailingUtcDayWindow(nowMs, dayCount) {
38
51
  const end = startOfUtcDay(nowMs);
39
52
  const start = new Date(end);
@@ -45,6 +58,11 @@ function trailingUtcHourWindow(nowMs, hourCount = WINDOW_HOURS) {
45
58
  const start = new Date(end.getTime() - (hourCount - 1) * HOUR_MS);
46
59
  return { end, start };
47
60
  }
61
+ function trailingUtcSixHourWindow(nowMs, bucketCount = WINDOW_SIX_HOURS) {
62
+ const end = startOfUtcSixHour(nowMs);
63
+ const start = new Date(end.getTime() - (bucketCount - 1) * SIX_HOUR_MS);
64
+ return { end, start };
65
+ }
48
66
  function fillUtcDays(args) {
49
67
  const { end, start } = trailingUtcDayWindow(args.nowMs, args.count);
50
68
  const items = [];
@@ -64,6 +82,39 @@ function fillUtcHours(args) {
64
82
  }
65
83
  return items;
66
84
  }
85
+ function fillUtcSixHours(args) {
86
+ const bucketCount = args.count ?? WINDOW_SIX_HOURS;
87
+ const { end, start } = trailingUtcSixHourWindow(args.nowMs, bucketCount);
88
+ const items = [];
89
+ for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setTime(cursor.getTime() + SIX_HOUR_MS)) {
90
+ const date = utcSixHourKey(cursor);
91
+ items.push(args.rows.get(date) ?? args.empty(date));
92
+ }
93
+ return items;
94
+ }
95
+ function sumUtcHoursIntoSixHours(args) {
96
+ const bucketCount = args.count ?? WINDOW_SIX_HOURS;
97
+ const bySix = /* @__PURE__ */ new Map();
98
+ for (const hour of args.hours) {
99
+ const key = utcSixHourKey(Date.parse(`${hour.date}:00:00.000Z`));
100
+ const current = bySix.get(key) ?? args.empty(key);
101
+ const next = { ...current, date: key };
102
+ for (const [field, value] of Object.entries(hour)) {
103
+ if (field === "date") continue;
104
+ if (typeof value === "number") {
105
+ const prior = next[field];
106
+ next[field] = (typeof prior === "number" ? prior : 0) + value;
107
+ }
108
+ }
109
+ bySix.set(key, next);
110
+ }
111
+ return fillUtcSixHours({
112
+ count: bucketCount,
113
+ empty: args.empty,
114
+ nowMs: args.nowMs,
115
+ rows: bySix
116
+ });
117
+ }
67
118
 
68
119
  // src/api/activity.ts
69
120
  var dailyConversationActivitySchema = z.object({
@@ -93,11 +144,20 @@ function activityDays(days, nowMs, count) {
93
144
  }
94
145
  function activityHours(hours, nowMs) {
95
146
  return fillUtcHours({
147
+ count: WINDOW_SEVEN_DAY_HOURS,
96
148
  empty: emptyActivityDay,
97
149
  nowMs,
98
150
  rows: hours
99
151
  });
100
152
  }
153
+ function activitySixHours(hours, nowMs) {
154
+ const series = hours instanceof Map ? activityHours(hours, nowMs) : [...hours];
155
+ return sumUtcHoursIntoSixHours({
156
+ empty: emptyActivityDay,
157
+ hours: series,
158
+ nowMs
159
+ });
160
+ }
101
161
 
102
162
  // src/api/schema/code.ts
103
163
  import { z as z2 } from "zod";
@@ -146,6 +206,7 @@ var codeChangeSummaryReportSchema = z2.object({
146
206
  var codeOverviewReportSchema = z2.object({
147
207
  activityDays: z2.array(codeActivityDaySchema),
148
208
  activityHours: z2.array(codeActivityDaySchema).optional(),
209
+ activitySixHours: z2.array(codeActivityDaySchema).optional(),
149
210
  changes: z2.array(codeChangeSummaryReportSchema),
150
211
  generatedAt: z2.string(),
151
212
  repositories: z2.array(codeRepositorySummarySchema),
@@ -156,6 +217,7 @@ var codeOverviewReportSchema = z2.object({
156
217
  var codePersonReportSchema = z2.object({
157
218
  activityDays: z2.array(codeActivityDaySchema),
158
219
  activityHours: z2.array(codeActivityDaySchema).optional(),
220
+ activitySixHours: z2.array(codeActivityDaySchema).optional(),
159
221
  generatedAt: z2.string(),
160
222
  summary: codeChangeSummarySchema,
161
223
  windowEnd: z2.string(),
@@ -320,7 +382,7 @@ var conversationSummaryReportSchema = z3.object({
320
382
  channelNameRedacted: z3.boolean().optional(),
321
383
  locationId: z3.string().optional(),
322
384
  sentryTraceUrl: z3.string().optional(),
323
- sourceUrl: z3.string().url().optional(),
385
+ locationUrl: z3.string().url().optional(),
324
386
  traceId: z3.string().optional(),
325
387
  /**
326
388
  * Plugin-owned resource links for this conversation.
@@ -709,6 +771,7 @@ var guardianStatsSchema = z3.object({
709
771
  deny: z3.number(),
710
772
  metricDays: z3.array(guardianMetricDaySchema),
711
773
  metricHours: z3.array(guardianMetricDaySchema).optional(),
774
+ metricSixHours: z3.array(guardianMetricDaySchema).optional(),
712
775
  requests: z3.number()
713
776
  }).strict();
714
777
  var conversationStatsReportSchema = z3.object({
@@ -721,6 +784,7 @@ var conversationStatsReportSchema = z3.object({
721
784
  guardian: guardianStatsSchema,
722
785
  metricDays: z3.array(conversationMetricDaySchema),
723
786
  metricHours: z3.array(conversationMetricDaySchema).optional(),
787
+ metricSixHours: z3.array(conversationMetricDaySchema).optional(),
724
788
  locations: z3.array(conversationStatsItemSchema),
725
789
  actors: z3.array(conversationStatsItemSchema),
726
790
  source: z3.literal("conversation_index"),
@@ -780,6 +844,7 @@ var actorSummaryReportSchema = actorTotalsReportSchema.extend({
780
844
  var actorDirectoryReportSchema = z4.object({
781
845
  activityDays: z4.array(peopleActivityDayReportSchema),
782
846
  activityHours: z4.array(peopleActivityDayReportSchema).optional(),
847
+ activitySixHours: z4.array(peopleActivityDayReportSchema).optional(),
783
848
  generatedAt: z4.string(),
784
849
  people: z4.array(actorSummaryReportSchema),
785
850
  source: z4.literal("conversation_index"),
@@ -789,6 +854,7 @@ var actorDirectoryReportSchema = z4.object({
789
854
  var actorProfileReportSchema = z4.object({
790
855
  activityDays: z4.array(actorActivityDayReportSchema),
791
856
  activityHours: z4.array(actorActivityDayReportSchema).optional(),
857
+ activitySixHours: z4.array(actorActivityDayReportSchema).optional(),
792
858
  generatedAt: z4.string(),
793
859
  locations: z4.array(peopleConversationStatsItemSchema),
794
860
  recentConversations: z4.array(conversationSummaryReportSchema),
@@ -830,6 +896,7 @@ var locationActivityDayReportSchema = z5.object({
830
896
  var locationDirectoryReportSchema = z5.object({
831
897
  activityDays: z5.array(locationActivityDayReportSchema),
832
898
  activityHours: z5.array(locationActivityDayReportSchema).optional(),
899
+ activitySixHours: z5.array(locationActivityDayReportSchema).optional(),
833
900
  generatedAt: z5.string(),
834
901
  locations: z5.array(locationSummaryReportSchema),
835
902
  privateActivity: conversationStatsItemSchema,
@@ -840,6 +907,7 @@ var locationDirectoryReportSchema = z5.object({
840
907
  var locationDetailReportSchema = locationSummaryReportSchema.extend({
841
908
  activityDays: z5.array(dailyConversationActivitySchema),
842
909
  activityHours: z5.array(dailyConversationActivitySchema).optional(),
910
+ activitySixHours: z5.array(dailyConversationActivitySchema).optional(),
843
911
  actors: z5.array(locationActorSummaryReportSchema),
844
912
  generatedAt: z5.string(),
845
913
  recentConversations: z5.array(conversationSummaryReportSchema),
@@ -918,6 +986,12 @@ var taskDestinationSchema = z9.object({
918
986
  teamId: z9.string().min(1),
919
987
  visibility: z9.enum(["private", "public"])
920
988
  }).strict();
989
+ var taskRunWindowsSchema = z9.object({
990
+ 1: z9.number().int().nonnegative(),
991
+ 7: z9.number().int().nonnegative(),
992
+ 30: z9.number().int().nonnegative(),
993
+ 90: z9.number().int().nonnegative()
994
+ }).strict();
921
995
  var taskSummaryBaseSchema = z9.object({
922
996
  createdAt: z9.string().datetime(),
923
997
  createdBy: z9.string().min(1),
@@ -928,7 +1002,7 @@ var taskSummaryBaseSchema = z9.object({
928
1002
  lastConversationId: z9.string().min(1).optional(),
929
1003
  lastRunAt: z9.string().datetime().optional(),
930
1004
  ownedByViewer: z9.boolean(),
931
- runsLast7Days: z9.number().int().nonnegative(),
1005
+ runs: taskRunWindowsSchema,
932
1006
  /** Short display title; falls back from instruction when unset. */
933
1007
  title: z9.string().min(1),
934
1008
  totalRuns: z9.number().int().nonnegative()
@@ -952,6 +1026,8 @@ var taskSummarySchema = z9.discriminatedUnion("kind", [
952
1026
  ]);
953
1027
  var taskMetricBucketSchema = z9.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
954
1028
  var taskExecutionDaySchema = z9.object({
1029
+ /** Linked conversation spend for executions in this bucket. */
1030
+ costUsd: z9.number().finite().nonnegative(),
955
1031
  date: taskMetricBucketSchema,
956
1032
  event: z9.number().int().nonnegative(),
957
1033
  scheduled: z9.number().int().nonnegative()
@@ -959,6 +1035,7 @@ var taskExecutionDaySchema = z9.object({
959
1035
  var taskListSchema = z9.object({
960
1036
  executionDays: z9.array(taskExecutionDaySchema),
961
1037
  executionHours: z9.array(taskExecutionDaySchema).optional(),
1038
+ executionSixHours: z9.array(taskExecutionDaySchema).optional(),
962
1039
  tasks: z9.array(taskSummarySchema),
963
1040
  truncated: z9.boolean()
964
1041
  }).strict();
@@ -973,10 +1050,16 @@ var taskExecutionStatusSchema = z9.enum([
973
1050
  ]);
974
1051
  var taskExecutionSchema = z9.object({
975
1052
  conversationId: z9.string().min(1).optional(),
1053
+ /** Estimated model cost for the linked conversation, when known. */
1054
+ costUsd: z9.number().finite().nonnegative().optional(),
1055
+ /** Cumulative conversation runtime in milliseconds, when known. */
1056
+ durationMs: z9.number().finite().nonnegative().optional(),
976
1057
  executedAt: z9.string().datetime(),
977
1058
  executionId: z9.string().min(1),
978
1059
  status: taskExecutionStatusSchema,
979
- title: z9.string().min(1).optional()
1060
+ title: z9.string().min(1).optional(),
1061
+ /** Cumulative conversation token total, when known. */
1062
+ totalTokens: z9.number().int().nonnegative().optional()
980
1063
  }).strict();
981
1064
  var taskExecutionStatusDaySchema = z9.object({
982
1065
  blocked: z9.number().int().nonnegative(),
@@ -987,6 +1070,7 @@ var taskExecutionStatusDaySchema = z9.object({
987
1070
  var taskExecutionListSchema = z9.object({
988
1071
  executionDays: z9.array(taskExecutionStatusDaySchema),
989
1072
  executionHours: z9.array(taskExecutionStatusDaySchema).optional(),
1073
+ executionSixHours: z9.array(taskExecutionStatusDaySchema).optional(),
990
1074
  executions: z9.array(taskExecutionSchema),
991
1075
  task: taskSummarySchema,
992
1076
  truncated: z9.boolean()
@@ -1044,23 +1128,29 @@ export {
1044
1128
  conversationEventPageSchema,
1045
1129
  conversationFeedSchema,
1046
1130
  conversationStatsReportSchema,
1047
- codeChangeSummarySchema,
1048
- codeActivityDaySchema,
1049
- codeRepositorySummarySchema,
1050
- codeChangeSummaryReportSchema,
1051
- codeOverviewReportSchema,
1052
- codePersonReportSchema,
1053
1131
  HOUR_MS,
1054
1132
  DAY_MS,
1133
+ WINDOW_SEVEN_DAY_HOURS,
1134
+ startOfUtcHour,
1055
1135
  utcDayKey,
1056
1136
  utcHourKey,
1057
1137
  trailingUtcDayWindow,
1058
1138
  trailingUtcHourWindow,
1139
+ trailingUtcSixHourWindow,
1059
1140
  fillUtcDays,
1060
1141
  fillUtcHours,
1142
+ fillUtcSixHours,
1143
+ sumUtcHoursIntoSixHours,
1144
+ codeChangeSummarySchema,
1145
+ codeActivityDaySchema,
1146
+ codeRepositorySummarySchema,
1147
+ codeChangeSummaryReportSchema,
1148
+ codeOverviewReportSchema,
1149
+ codePersonReportSchema,
1061
1150
  dailyConversationActivitySchema,
1062
1151
  activityDays,
1063
1152
  activityHours,
1153
+ activitySixHours,
1064
1154
  locationParamsSchema,
1065
1155
  locationActivityDayReportSchema,
1066
1156
  locationDirectoryReportSchema,
@@ -1075,6 +1165,7 @@ export {
1075
1165
  createdPersonalTokenSchema,
1076
1166
  personalTokenParamsSchema,
1077
1167
  revokePersonalTokenResponseSchema,
1168
+ taskRunWindowsSchema,
1078
1169
  scheduledTaskSummarySchema,
1079
1170
  eventTaskSummarySchema,
1080
1171
  taskSummarySchema,
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-PDO5BLNM.js";
4
4
  import {
5
5
  botConfig
6
- } from "./chunk-WJJDQLVL.js";
6
+ } from "./chunk-LMYRF6HX.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-QY2IU47O.js";
9
+ } from "./chunk-HUQOXMDG.js";
10
10
 
11
11
  // src/chat/conversations/structured-events.ts
12
12
  import {
@@ -174,6 +174,26 @@ function getComponentTotal(usage) {
174
174
  }
175
175
  return total;
176
176
  }
177
+ function agentTurnCostUsd(usage) {
178
+ if (!usage?.cost) return void 0;
179
+ const total = getFiniteCost(usage.cost.total);
180
+ if (total !== void 0) return total;
181
+ let componentTotal = 0;
182
+ let hasComponent = false;
183
+ for (const field of COST_COMPONENT_FIELDS) {
184
+ const value = getFiniteCost(usage.cost[field]);
185
+ if (value === void 0) continue;
186
+ hasComponent = true;
187
+ componentTotal = addCost(componentTotal, value);
188
+ }
189
+ return hasComponent ? componentTotal : void 0;
190
+ }
191
+ function agentTurnTotalTokens(usage) {
192
+ if (!usage) return void 0;
193
+ const componentTotal = getComponentTotal(usage);
194
+ if (componentTotal !== void 0) return componentTotal;
195
+ return getFiniteCount(usage.totalTokens);
196
+ }
177
197
  function addAgentTurnUsage(...usages) {
178
198
  const components = {};
179
199
  let componentTotal;
@@ -307,5 +327,7 @@ export {
307
327
  ToolInputError,
308
328
  agentTurnUsageSchema,
309
329
  hasAgentTurnUsage,
330
+ agentTurnCostUsd,
331
+ agentTurnTotalTokens,
310
332
  addAgentTurnUsage
311
333
  };
@@ -8,19 +8,19 @@ import {
8
8
  isDmChannel,
9
9
  normalizeSlackConversationId,
10
10
  withSlackRetries
11
- } from "./chunk-FQ5HFSFR.js";
11
+ } from "./chunk-PFQRZ4IB.js";
12
12
  import {
13
13
  parseDestination
14
- } from "./chunk-2CYWEVOP.js";
14
+ } from "./chunk-KQ3GZGBK.js";
15
15
  import {
16
16
  getStateAdapter
17
- } from "./chunk-IOUUS6H4.js";
17
+ } from "./chunk-7MYXH5LA.js";
18
18
  import {
19
19
  normalizeSlackEmojiName
20
- } from "./chunk-WJJDQLVL.js";
20
+ } from "./chunk-LMYRF6HX.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-DXFUYLHX.js";
23
+ } from "./chunk-RKA22BQP.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-QY2IU47O.js";
32
+ } from "./chunk-HUQOXMDG.js";
33
33
 
34
34
  // src/chat/agent/types.ts
35
35
  var RetryableDeliveryError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-QWY4KI2V.js";
3
+ } from "./chunk-X3PBQ4BK.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-DXFUYLHX.js";
3
+ } from "./chunk-RKA22BQP.js";
4
4
  import {
5
5
  skillRoots
6
6
  } from "./chunk-TXKUKMVO.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-QY2IU47O.js";
9
+ } from "./chunk-HUQOXMDG.js";
10
10
 
11
11
  // src/chat/skills.ts
12
12
  import fs from "fs/promises";