@sentry/junior 0.194.0 → 0.196.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.
- package/dist/{agent-hooks-IDX764FD.js → agent-hooks-IQLRR4RC.js} +13 -13
- package/dist/api/activity.d.ts +9 -1
- package/dist/api/code/overview.d.ts +12 -0
- package/dist/api/locations/detail.d.ts +8 -0
- package/dist/api/locations/list.d.ts +5 -0
- package/dist/api/people/code.d.ts +6 -0
- package/dist/api/people/shared.d.ts +9 -1
- package/dist/api/reporting-window.d.ts +39 -1
- package/dist/api/schema/code.d.ts +12 -0
- package/dist/api/schema/conversation.d.ts +25 -0
- package/dist/api/schema/location.d.ts +13 -0
- package/dist/api/schema/person.d.ts +14 -0
- package/dist/api/schema/task.d.ts +12 -0
- package/dist/api/schema.js +3 -3
- package/dist/api.js +244 -65
- package/dist/app.d.ts +8 -2
- package/dist/app.js +166 -70
- package/dist/{catalog-runtime-MICXEBLK.js → catalog-runtime-EM7V2F4I.js} +4 -4
- package/dist/chat/agent/handoff.d.ts +73 -0
- package/dist/chat/config.d.ts +3 -2
- package/dist/chat/event-tasks/store.d.ts +27 -17
- package/dist/chat/model-profile.d.ts +12 -0
- package/dist/chat/no-reply.d.ts +4 -3
- package/dist/chat/resource-events/notification.d.ts +2 -1
- package/dist/chat/services/automated-turn-limit.d.ts +110 -0
- package/dist/chat/services/subscribed-decision.d.ts +8 -0
- package/dist/chat/slack/automated-turn-limit-notice.d.ts +38 -0
- package/dist/chat/tasks/execution-stats.d.ts +2 -1
- package/dist/chat/tasks/read.d.ts +5 -2
- package/dist/chat/tools/types.d.ts +6 -2
- package/dist/{chunk-U76RWMFR.js → chunk-5XSEOJPC.js} +87 -14
- package/dist/{chunk-OEQOAONV.js → chunk-6LQNW2CJ.js} +7 -7
- package/dist/{chunk-GFBR4S3Q.js → chunk-7NL7T6VU.js} +1 -1
- package/dist/{chunk-CFGBKPWQ.js → chunk-7TUDDW3Y.js} +3 -3
- package/dist/{chunk-RFE7DCZK.js → chunk-B5WJBVHY.js} +2 -2
- package/dist/{chunk-S7GX44BU.js → chunk-BXIVMNLR.js} +1 -1
- package/dist/{chunk-QMEF4Z7R.js → chunk-CNI74T7U.js} +6 -6
- package/dist/{chunk-X76JVHQ4.js → chunk-CTS72G4B.js} +1 -1
- package/dist/{chunk-G35QGPO2.js → chunk-DFWJJOW3.js} +2 -6
- package/dist/{chunk-INTBMGNX.js → chunk-EEUFKVCD.js} +22 -22
- package/dist/{chunk-H4DCWLTR.js → chunk-EFNUCRB5.js} +8 -8
- package/dist/{chunk-V4HXV5MY.js → chunk-EQBHN4JK.js} +1 -1
- package/dist/{chunk-JOI3DHML.js → chunk-ES7KCEND.js} +1 -1
- package/dist/{chunk-WWXJUURQ.js → chunk-G6YRPYDC.js} +1 -1
- package/dist/{chunk-WMJS5DDV.js → chunk-GZ336GZ5.js} +148 -19
- package/dist/{chunk-IME5OW4Y.js → chunk-I7GEGEHZ.js} +1 -1
- package/dist/{chunk-2NL3Y47F.js → chunk-J357NJQ5.js} +5 -5
- package/dist/{chunk-53IEEFFP.js → chunk-KJGH3KWA.js} +3 -3
- package/dist/{chunk-ELCYG6UU.js → chunk-KZX7LORG.js} +3 -3
- package/dist/{chunk-YSLIB7ER.js → chunk-LBN67OZR.js} +83 -7
- package/dist/{chunk-73JEAQRT.js → chunk-LCAM2P7H.js} +4 -4
- package/dist/{chunk-VOB2DKO6.js → chunk-LGXI6PWX.js} +24 -13
- package/dist/{chunk-P2P6MUQ4.js → chunk-LSPUMNZK.js} +2 -2
- package/dist/{chunk-AWZS5SVX.js → chunk-N2MSPOGG.js} +8 -8
- package/dist/{chunk-CCTYK5RH.js → chunk-NE2UQMC7.js} +10 -7
- package/dist/{chunk-D4YV5TDV.js → chunk-NHJU2ZAL.js} +11 -0
- package/dist/{chunk-G4RARFNT.js → chunk-OVWAO5KY.js} +1194 -726
- package/dist/{chunk-XRDSML3K.js → chunk-P3LE2CSJ.js} +2 -2
- package/dist/{chunk-KNIAWMBU.js → chunk-PI6VXVBK.js} +1 -1
- package/dist/{chunk-XLWZRHX5.js → chunk-PIZJBSGZ.js} +23 -29
- package/dist/{chunk-GY5SEFVL.js → chunk-QAINJHI4.js} +5 -5
- package/dist/{chunk-XND3J6AT.js → chunk-RAWYH7TW.js} +1 -1
- package/dist/{chunk-ENWIHU54.js → chunk-RFNMWONZ.js} +6 -6
- package/dist/{chunk-E53C73ML.js → chunk-S74KAE77.js} +4 -4
- package/dist/{chunk-7ANA7PBB.js → chunk-SR5FS2JP.js} +3 -3
- package/dist/{chunk-F2KSURTJ.js → chunk-VKLQ2M7V.js} +9 -9
- package/dist/{chunk-NWWDFHXP.js → chunk-VRHZXY5X.js} +1 -1
- package/dist/{chunk-6H2MKVV5.js → chunk-VSOO3Y6M.js} +1 -1
- package/dist/{chunk-NPO24LAN.js → chunk-VVU7GHIZ.js} +9 -9
- package/dist/{chunk-IOGDKPVU.js → chunk-VXAQTJSR.js} +1 -1
- package/dist/{chunk-ADEACKAH.js → chunk-XNXKRWWI.js} +11 -4
- package/dist/cli/chat.js +35 -35
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +14 -14
- package/dist/cli/snapshot-create.js +10 -10
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/event-tasks.d.ts +21 -0
- package/dist/db/schema.d.ts +19 -0
- package/dist/{db-3IEVINAY.js → db-YTM7ZXPK.js} +8 -8
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +7 -7
- package/dist/{oauth-callback-server-N7L2BB4L.js → oauth-callback-server-OXW4KQLQ.js} +31 -31
- package/dist/{runner-PTTZV3WU.js → runner-RJY5RNJO.js} +23 -23
- package/dist/{skills-POMWS2RR.js → skills-WZV6NLFY.js} +5 -5
- package/dist/spawn-J7SQJLYF.js +42 -0
- package/dist/task-runner-SMUQ5464.js +36 -0
- package/dist/{validation-U6LOMXR7.js → validation-XS5ZHV3W.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-FHA3BS4L.js → work-LJMSDEY3.js} +23 -23
- package/dist/worker-NMFZ7A2N.js +24 -0
- package/migrations/0038_event_task_status.sql +5 -0
- package/migrations/meta/0038_snapshot.json +3323 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +4 -4
- package/dist/spawn-R75MXXKE.js +0 -42
- package/dist/task-runner-OQLRHADB.js +0 -36
- package/dist/worker-GR4UNVVP.js +0 -24
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
conversationTurnFailureCodeSchema,
|
|
6
6
|
conversationTurnFailureReasonSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7NL7T6VU.js";
|
|
8
8
|
import {
|
|
9
9
|
juniorDestinationKindSchema
|
|
10
10
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -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(),
|
|
@@ -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),
|
|
@@ -967,6 +1035,7 @@ var taskExecutionDaySchema = z9.object({
|
|
|
967
1035
|
var taskListSchema = z9.object({
|
|
968
1036
|
executionDays: z9.array(taskExecutionDaySchema),
|
|
969
1037
|
executionHours: z9.array(taskExecutionDaySchema).optional(),
|
|
1038
|
+
executionSixHours: z9.array(taskExecutionDaySchema).optional(),
|
|
970
1039
|
tasks: z9.array(taskSummarySchema),
|
|
971
1040
|
truncated: z9.boolean()
|
|
972
1041
|
}).strict();
|
|
@@ -1001,6 +1070,7 @@ var taskExecutionStatusDaySchema = z9.object({
|
|
|
1001
1070
|
var taskExecutionListSchema = z9.object({
|
|
1002
1071
|
executionDays: z9.array(taskExecutionStatusDaySchema),
|
|
1003
1072
|
executionHours: z9.array(taskExecutionStatusDaySchema).optional(),
|
|
1073
|
+
executionSixHours: z9.array(taskExecutionStatusDaySchema).optional(),
|
|
1004
1074
|
executions: z9.array(taskExecutionSchema),
|
|
1005
1075
|
task: taskSummarySchema,
|
|
1006
1076
|
truncated: z9.boolean()
|
|
@@ -1058,23 +1128,29 @@ export {
|
|
|
1058
1128
|
conversationEventPageSchema,
|
|
1059
1129
|
conversationFeedSchema,
|
|
1060
1130
|
conversationStatsReportSchema,
|
|
1061
|
-
codeChangeSummarySchema,
|
|
1062
|
-
codeActivityDaySchema,
|
|
1063
|
-
codeRepositorySummarySchema,
|
|
1064
|
-
codeChangeSummaryReportSchema,
|
|
1065
|
-
codeOverviewReportSchema,
|
|
1066
|
-
codePersonReportSchema,
|
|
1067
1131
|
HOUR_MS,
|
|
1068
1132
|
DAY_MS,
|
|
1133
|
+
WINDOW_SEVEN_DAY_HOURS,
|
|
1134
|
+
startOfUtcHour,
|
|
1069
1135
|
utcDayKey,
|
|
1070
1136
|
utcHourKey,
|
|
1071
1137
|
trailingUtcDayWindow,
|
|
1072
1138
|
trailingUtcHourWindow,
|
|
1139
|
+
trailingUtcSixHourWindow,
|
|
1073
1140
|
fillUtcDays,
|
|
1074
1141
|
fillUtcHours,
|
|
1142
|
+
fillUtcSixHours,
|
|
1143
|
+
sumUtcHoursIntoSixHours,
|
|
1144
|
+
codeChangeSummarySchema,
|
|
1145
|
+
codeActivityDaySchema,
|
|
1146
|
+
codeRepositorySummarySchema,
|
|
1147
|
+
codeChangeSummaryReportSchema,
|
|
1148
|
+
codeOverviewReportSchema,
|
|
1149
|
+
codePersonReportSchema,
|
|
1075
1150
|
dailyConversationActivitySchema,
|
|
1076
1151
|
activityDays,
|
|
1077
1152
|
activityHours,
|
|
1153
|
+
activitySixHours,
|
|
1078
1154
|
locationParamsSchema,
|
|
1079
1155
|
locationActivityDayReportSchema,
|
|
1080
1156
|
locationDirectoryReportSchema,
|
|
@@ -19,23 +19,23 @@ import {
|
|
|
19
19
|
releaseConversationWork,
|
|
20
20
|
requestAnotherSlice,
|
|
21
21
|
startConversationWork
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-S74KAE77.js";
|
|
23
23
|
import {
|
|
24
24
|
getTurnRequestDeadline
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VRHZXY5X.js";
|
|
26
26
|
import {
|
|
27
27
|
ConversationQueueMessageRejectedError
|
|
28
28
|
} from "./chunk-JAL3CH4G.js";
|
|
29
29
|
import {
|
|
30
30
|
getChatConfig,
|
|
31
31
|
isProviderRetryError
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5XSEOJPC.js";
|
|
33
33
|
import {
|
|
34
34
|
logException,
|
|
35
35
|
logInfo,
|
|
36
36
|
logWarn,
|
|
37
37
|
withLogContext
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CTS72G4B.js";
|
|
39
39
|
|
|
40
40
|
// src/chat/task-execution/worker.ts
|
|
41
41
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
agentTurnCostUsd,
|
|
3
3
|
agentTurnTotalTokens
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B5WJBVHY.js";
|
|
5
5
|
import {
|
|
6
6
|
getDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XNXKRWWI.js";
|
|
8
8
|
import {
|
|
9
9
|
juniorConversations,
|
|
10
10
|
juniorTaskExecutions
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PIZJBSGZ.js";
|
|
12
12
|
import {
|
|
13
13
|
logWarn
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CTS72G4B.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/tasks/execution-stats.ts
|
|
17
17
|
import {
|
|
@@ -258,7 +258,7 @@ async function readTaskExecutionDays(dayCount = 90, options = {}) {
|
|
|
258
258
|
}
|
|
259
259
|
return [...byDate.values()];
|
|
260
260
|
}
|
|
261
|
-
async function readTaskExecutionHours(hourCount = 24, options = {}) {
|
|
261
|
+
async function readTaskExecutionHours(hourCount = 7 * 24, options = {}) {
|
|
262
262
|
const nowMs = options.nowMs ?? Date.now();
|
|
263
263
|
const end = new Date(nowMs);
|
|
264
264
|
end.setUTCMinutes(0, 0, 0);
|
|
@@ -349,14 +349,25 @@ async function readTaskExecutions(args) {
|
|
|
349
349
|
return rows.map((row) => mapTaskExecutionRecord(row));
|
|
350
350
|
}
|
|
351
351
|
async function readTaskRuns(args) {
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
const tasks = args.tasks ?? [];
|
|
353
|
+
const conversationIds = [
|
|
354
|
+
...new Set(
|
|
355
|
+
(args.conversationIds ?? []).filter(
|
|
356
|
+
(conversationId) => conversationId.trim().length > 0
|
|
357
|
+
)
|
|
358
358
|
)
|
|
359
|
-
|
|
359
|
+
];
|
|
360
|
+
if (tasks.length === 0 && conversationIds.length === 0) return [];
|
|
361
|
+
const namespace = args.namespace ?? "junior";
|
|
362
|
+
const selectors = [
|
|
363
|
+
...tasks.map(
|
|
364
|
+
(task) => and(
|
|
365
|
+
eq(juniorTaskExecutions.kind, task.kind),
|
|
366
|
+
eq(juniorTaskExecutions.taskId, task.taskId)
|
|
367
|
+
)
|
|
368
|
+
),
|
|
369
|
+
...conversationIds.length > 0 ? [inArray(juniorTaskExecutions.conversationId, conversationIds)] : []
|
|
370
|
+
];
|
|
360
371
|
const rows = await getDb().select({
|
|
361
372
|
conversationId: juniorTaskExecutions.conversationId,
|
|
362
373
|
durationMs: juniorConversations.durationMs,
|
|
@@ -441,7 +452,7 @@ async function readTaskExecutionStatusDays(args) {
|
|
|
441
452
|
return [...byDate.values()];
|
|
442
453
|
}
|
|
443
454
|
async function readTaskExecutionStatusHours(args) {
|
|
444
|
-
const hourCount = args.hourCount ?? 24;
|
|
455
|
+
const hourCount = args.hourCount ?? 7 * 24;
|
|
445
456
|
const namespace = args.namespace ?? "junior";
|
|
446
457
|
const nowMs = args.nowMs ?? Date.now();
|
|
447
458
|
const end = new Date(nowMs);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G6YRPYDC.js";
|
|
4
4
|
import {
|
|
5
5
|
skillRoots
|
|
6
6
|
} from "./chunk-TXKUKMVO.js";
|
|
7
7
|
import {
|
|
8
8
|
logWarn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CTS72G4B.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/skills.ts
|
|
12
12
|
import fs from "fs/promises";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveBaseUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RFNMWONZ.js";
|
|
4
4
|
import {
|
|
5
5
|
createPluginLogger,
|
|
6
6
|
getPlugins,
|
|
7
7
|
getSlackClient,
|
|
8
8
|
withSlackRetries
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NE2UQMC7.js";
|
|
10
10
|
import {
|
|
11
11
|
getDb,
|
|
12
12
|
parseDestination
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XNXKRWWI.js";
|
|
14
14
|
import {
|
|
15
15
|
sleep
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SR5FS2JP.js";
|
|
17
17
|
import {
|
|
18
18
|
acquireActiveLock,
|
|
19
19
|
getStateAdapter
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EQBHN4JK.js";
|
|
21
21
|
import {
|
|
22
22
|
pluginCatalogRuntime
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-G6YRPYDC.js";
|
|
24
24
|
import {
|
|
25
25
|
fetchWithBoundedOAuthErrorBodies
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BXIVMNLR.js";
|
|
27
27
|
import {
|
|
28
28
|
isRecord
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-CTS72G4B.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/capabilities/router.ts
|
|
32
32
|
var ProviderCredentialRouter = class {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getConversationEventStore,
|
|
6
6
|
getDb,
|
|
7
7
|
getSqlExecutor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XNXKRWWI.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-
|
|
19
|
+
} from "./chunk-PIZJBSGZ.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_WORKSPACE_ROOT,
|
|
22
22
|
getVercelSandboxCredentials,
|
|
@@ -24,19 +24,19 @@ import {
|
|
|
24
24
|
isSandboxMissingError,
|
|
25
25
|
runNonInteractiveCommand,
|
|
26
26
|
sleep
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SR5FS2JP.js";
|
|
28
28
|
import {
|
|
29
29
|
getStateAdapter
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EQBHN4JK.js";
|
|
31
31
|
import {
|
|
32
32
|
botConfig,
|
|
33
33
|
completeObject,
|
|
34
34
|
embedTexts,
|
|
35
35
|
getSlackBotToken
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5XSEOJPC.js";
|
|
37
37
|
import {
|
|
38
38
|
defaultModelId
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-NHJU2ZAL.js";
|
|
40
40
|
import {
|
|
41
41
|
isActorUserId,
|
|
42
42
|
parseActorUserId,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setSpanAttributes,
|
|
53
53
|
setSpanStatus,
|
|
54
54
|
withSpan
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-CTS72G4B.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];
|
|
@@ -14,6 +14,15 @@ function parseTurnReasoningLevel(value) {
|
|
|
14
14
|
// src/chat/model-profile.ts
|
|
15
15
|
import { z as z2 } from "zod";
|
|
16
16
|
var modelProfileSchema = z2.string().regex(/^[a-z][a-z0-9_-]*$/);
|
|
17
|
+
function formatModelProfile(profile, description) {
|
|
18
|
+
const text = description?.trim();
|
|
19
|
+
return text ? `"${profile}": ${text}` : `"${profile}"`;
|
|
20
|
+
}
|
|
21
|
+
function formatModelProfiles(profiles, profileNames) {
|
|
22
|
+
return profileNames.map(
|
|
23
|
+
(profile) => `- ${formatModelProfile(profile, profiles[profile]?.description)}`
|
|
24
|
+
).join("\n");
|
|
25
|
+
}
|
|
17
26
|
var ModelProfileNotConfiguredError = class extends Error {
|
|
18
27
|
constructor(profile) {
|
|
19
28
|
super(`Model profile "${profile}" is not configured`);
|
|
@@ -38,6 +47,8 @@ export {
|
|
|
38
47
|
TURN_REASONING_LEVELS,
|
|
39
48
|
parseTurnReasoningLevel,
|
|
40
49
|
modelProfileSchema,
|
|
50
|
+
formatModelProfile,
|
|
51
|
+
formatModelProfiles,
|
|
41
52
|
ModelProfileNotConfiguredError,
|
|
42
53
|
modelIdForProfile,
|
|
43
54
|
defaultModelId,
|