@sentry/junior 0.138.0 → 0.140.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-SCR74Q3E.js → agent-hooks-BFTDRFUO.js} +10 -10
- package/dist/api/schema/task.d.ts +104 -1
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +9 -1
- package/dist/api.js +198 -54
- package/dist/app.js +374 -607
- package/dist/{catalog-runtime-IU3QF4GG.js → catalog-runtime-RK664S5T.js} +6 -6
- package/dist/chat/agent/request.d.ts +12 -2
- package/dist/chat/credentials/context.d.ts +14 -0
- package/dist/chat/resource-events/actor.d.ts +23 -0
- package/dist/chat/scheduled-tasks/telemetry.d.ts +7 -0
- package/dist/chat/scheduled-tasks/tool-support.d.ts +10 -2
- package/dist/chat/scheduled-tasks/tools/create.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/list.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/update.d.ts +4 -2
- package/dist/chat/scheduled-tasks/types.d.ts +1 -1
- package/dist/chat/slack/dashboard-link.d.ts +2 -0
- package/dist/chat/state/turn-session-keys.d.ts +2 -2
- package/dist/chat/state/turn-session.d.ts +16 -12
- package/dist/chat/tasks/execution-stats.d.ts +34 -3
- package/dist/chat/tasks/read.d.ts +3 -1
- package/dist/chunk-3B7O3GNU.js +207 -0
- package/dist/{chunk-N7WARMC6.js → chunk-3CUBAGA3.js} +7 -7
- package/dist/{chunk-5MXWHTCK.js → chunk-4PIT6O7A.js} +17 -8
- package/dist/{chunk-DCLLQGS6.js → chunk-557HLSNH.js} +8 -3
- package/dist/{chunk-SD3OFRWY.js → chunk-5KAZMR5U.js} +6 -6
- package/dist/{chunk-ZBSMCXKV.js → chunk-5YAWB2AX.js} +7 -6
- package/dist/{chunk-FEUNPTGV.js → chunk-A6BI25J3.js} +434 -12
- package/dist/{chunk-5LTJ4ITU.js → chunk-AA2EPMUF.js} +4 -4
- package/dist/{chunk-TUUDXEXU.js → chunk-BMFRFSTM.js} +68 -79
- package/dist/{chunk-C7ZVPO4Z.js → chunk-CPPTBHQN.js} +1 -1
- package/dist/{chunk-ZXNTJJIE.js → chunk-D3X2PI3D.js} +2 -2
- package/dist/{chunk-LPVUNO2W.js → chunk-DMDOKRPC.js} +7 -7
- package/dist/{chunk-TCS76X5D.js → chunk-HEFBGCCU.js} +2 -2
- package/dist/{chunk-EPBBYMNE.js → chunk-HUO3UTAQ.js} +1 -1
- package/dist/{chunk-KFRHRSCJ.js → chunk-I3OZR3HG.js} +2 -2
- package/dist/{chunk-BOLJOV5T.js → chunk-J5H65GY2.js} +1 -1
- package/dist/{chunk-RZIBSCYC.js → chunk-MYVCHWDG.js} +39 -23
- package/dist/{chunk-QS527AV5.js → chunk-N2I7W2VS.js} +1 -1
- package/dist/{chunk-JNNJZURV.js → chunk-NPL66ZWL.js} +1 -1
- package/dist/{chunk-A7WCHXZV.js → chunk-OGNL2QY7.js} +4 -4
- package/dist/{chunk-77VDLF3Z.js → chunk-RUIXF3YQ.js} +10 -0
- package/dist/{chunk-BYW4B4PR.js → chunk-S3FAOKQU.js} +2 -2
- package/dist/chunk-TGIKZJ3Y.js +115 -0
- package/dist/{chunk-YU5QUF67.js → chunk-TKTZ4L4Z.js} +1 -1
- package/dist/{chunk-VPZFVJND.js → chunk-UXMRN2ZX.js} +1 -1
- package/dist/{chunk-HIWJWWMT.js → chunk-VRDHAITB.js} +3 -3
- package/dist/{chunk-SIPKWSXK.js → chunk-WSWM6A3R.js} +3 -3
- package/dist/{chunk-FNLBTB4K.js → chunk-WTGLUX4K.js} +1 -1
- package/dist/{chunk-PB3CXNVL.js → chunk-XROWZSOY.js} +1 -1
- package/dist/{chunk-TDJCLNDH.js → chunk-XX2QNQN4.js} +147 -86
- package/dist/{chunk-KDCHVT25.js → chunk-YB363QGA.js} +9 -2
- package/dist/{chunk-HCIVH3JS.js → chunk-YWM6MJT4.js} +29 -1
- package/dist/{chunk-E5UYAIKJ.js → chunk-Z2A7BDHT.js} +17 -19
- package/dist/cli/chat.js +33 -33
- package/dist/cli/check.js +7 -7
- package/dist/cli/plugins.js +14 -14
- package/dist/cli/snapshot-create.js +10 -10
- package/dist/cli/upgrade.js +8 -8
- package/dist/db/schema/task-executions.d.ts +23 -2
- package/dist/db/schema.d.ts +20 -1
- package/dist/{db-UO2IWXGA.js → db-QOGYDDQM.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-MAQI43LX.js → oauth-callback-server-CT4RMGCP.js} +22 -21
- package/dist/{runner-PIUQEXKE.js → runner-PHMLHNLX.js} +18 -16
- package/dist/{sandbox-egress-signals-A5HWIQH4.js → sandbox-egress-signals-EKPAVWQL.js} +2 -2
- package/dist/{skills-4ARJADHQ.js → skills-AYRM4QGF.js} +7 -7
- package/dist/spawn-OGRQFUNK.js +38 -0
- package/dist/{validation-S3EE3HWL.js → validation-M5JNGRGL.js} +7 -7
- package/dist/version.js +1 -1
- package/dist/{work-UARRUAW3.js → work-LZWE6HK4.js} +18 -18
- package/dist/{worker-DOCIRVD3.js → worker-KOGPXFYK.js} +10 -10
- package/migrations/0022_task_execution_status.sql +3 -0
- package/migrations/meta/0022_snapshot.json +2186 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/chunk-ELKW5FIB.js +0 -233
- package/dist/spawn-G2AWPMCT.js +0 -38
|
@@ -4,19 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
canRouteResourceEvents,
|
|
6
6
|
getPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4PIT6O7A.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WSWM6A3R.js";
|
|
11
11
|
import {
|
|
12
12
|
juniorEventTasks,
|
|
13
13
|
juniorSchedulerRuns,
|
|
14
14
|
juniorSchedulerTasks,
|
|
15
15
|
juniorStats
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-557HLSNH.js";
|
|
17
17
|
import {
|
|
18
18
|
juniorDestinations
|
|
19
19
|
} from "./chunk-VFUK3X5B.js";
|
|
20
|
+
import {
|
|
21
|
+
logInfo
|
|
22
|
+
} from "./chunk-NPL66ZWL.js";
|
|
20
23
|
|
|
21
24
|
// src/chat/event-tasks/store.ts
|
|
22
25
|
import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
|
|
@@ -698,6 +701,41 @@ function getNextRunAtMs(task, scheduledForMs, afterMs = scheduledForMs) {
|
|
|
698
701
|
});
|
|
699
702
|
}
|
|
700
703
|
|
|
704
|
+
// src/chat/scheduled-tasks/telemetry.ts
|
|
705
|
+
function scheduledTaskAttributes(task, extras = {}) {
|
|
706
|
+
return {
|
|
707
|
+
"app.task.id": task.id,
|
|
708
|
+
"app.task.type": "scheduled",
|
|
709
|
+
"app.task.status": task.status,
|
|
710
|
+
"app.task.schedule.kind": task.schedule.kind,
|
|
711
|
+
"app.task.schedule.timezone": task.schedule.timezone,
|
|
712
|
+
"app.task.credential_mode": task.credentialMode,
|
|
713
|
+
"app.task.destination.channel_id": task.destination.channelId,
|
|
714
|
+
"app.task.destination.team_id": task.destination.teamId,
|
|
715
|
+
"app.task.destination.visibility": task.conversationAccess.visibility,
|
|
716
|
+
"app.task.destination.audience": task.conversationAccess.audience,
|
|
717
|
+
"messaging.destination.name": task.destination.channelId,
|
|
718
|
+
...typeof task.nextRunAtMs === "number" ? { "app.task.next_run_at": new Date(task.nextRunAtMs).toISOString() } : {},
|
|
719
|
+
...extras
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
function scheduledTaskRunAttributes(task, run, extras = {}) {
|
|
723
|
+
return scheduledTaskAttributes(task, {
|
|
724
|
+
"app.task.run.id": run.id,
|
|
725
|
+
"app.task.run.status": run.status,
|
|
726
|
+
"app.task.run.scheduled_for": new Date(run.scheduledForMs).toISOString(),
|
|
727
|
+
...run.dispatchId ? { "app.dispatch.id": run.dispatchId } : {},
|
|
728
|
+
...run.resultMessageTs ? { "app.task.result_message_ts": run.resultMessageTs } : {},
|
|
729
|
+
...extras
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
function logScheduledTaskRunSkipped(task, run, extras = {}) {
|
|
733
|
+
logInfo(
|
|
734
|
+
"scheduled_task.run.skipped",
|
|
735
|
+
scheduledTaskRunAttributes(task, run, extras)
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
|
|
701
739
|
// src/chat/scheduled-tasks/types.ts
|
|
702
740
|
import { z as z5 } from "zod";
|
|
703
741
|
var scheduledTaskCredentialModeSchema = z5.enum(["system", "creator"]);
|
|
@@ -762,7 +800,7 @@ var taskRecordFields = {
|
|
|
762
800
|
schedule: taskScheduleSchema,
|
|
763
801
|
// TODO(v0.131.0): Remove paused decoding and SQL list filtering after
|
|
764
802
|
// v0.129.x workers can no longer overlap upgrades.
|
|
765
|
-
status: z6.enum(["active", "blocked", "deleted", "paused"]),
|
|
803
|
+
status: z6.enum(["active", "blocked", "completed", "deleted", "paused"]),
|
|
766
804
|
statusReason: z6.string().optional(),
|
|
767
805
|
task: taskSpecSchema,
|
|
768
806
|
updatedAtMs: z6.number(),
|
|
@@ -814,12 +852,15 @@ function buildRunId(taskId, scheduledForMs) {
|
|
|
814
852
|
}
|
|
815
853
|
var schedulerTaskIndexSchema = z6.array(z6.string().min(1));
|
|
816
854
|
function statusAfterTerminalOccurrence(args) {
|
|
817
|
-
if (args.blocked) {
|
|
855
|
+
if (args.blocked || args.outcome === "blocked") {
|
|
818
856
|
return "blocked";
|
|
819
857
|
}
|
|
820
858
|
if (args.nextRunAtMs) {
|
|
821
859
|
return args.previousStatus ?? "active";
|
|
822
860
|
}
|
|
861
|
+
if (args.outcome === "completed") {
|
|
862
|
+
return "completed";
|
|
863
|
+
}
|
|
823
864
|
return "deleted";
|
|
824
865
|
}
|
|
825
866
|
function isStalePendingRun(run, nowMs) {
|
|
@@ -1110,7 +1151,11 @@ async function listPublicScheduledTasksForTeams(db, teamIds, limit) {
|
|
|
1110
1151
|
).where(
|
|
1111
1152
|
and3(
|
|
1112
1153
|
inArray2(juniorSchedulerTasks.teamId, teamIds),
|
|
1113
|
-
notInArray(juniorSchedulerTasks.status, [
|
|
1154
|
+
notInArray(juniorSchedulerTasks.status, [
|
|
1155
|
+
"completed",
|
|
1156
|
+
"deleted",
|
|
1157
|
+
"paused"
|
|
1158
|
+
]),
|
|
1114
1159
|
eq2(juniorDestinations.visibility, "public")
|
|
1115
1160
|
)
|
|
1116
1161
|
).orderBy(
|
|
@@ -1184,99 +1229,111 @@ var SqlSchedulerStore = class {
|
|
|
1184
1229
|
return await listTasksForTeamFromSql(this.db, teamId);
|
|
1185
1230
|
}
|
|
1186
1231
|
async claimDueRun(args) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1232
|
+
const skippedRuns = [];
|
|
1233
|
+
const claimed = await withSqlLock(
|
|
1234
|
+
this.db,
|
|
1235
|
+
"junior:scheduler:claim",
|
|
1236
|
+
async (db) => {
|
|
1237
|
+
const rows = await db.select({
|
|
1238
|
+
creatorIdentityId: juniorSchedulerTasks.creatorIdentityId,
|
|
1239
|
+
record: juniorSchedulerTasks.record
|
|
1240
|
+
}).from(juniorSchedulerTasks).where(
|
|
1241
|
+
and3(
|
|
1242
|
+
eq2(juniorSchedulerTasks.status, "active"),
|
|
1243
|
+
or2(
|
|
1244
|
+
and3(
|
|
1245
|
+
isNotNull(juniorSchedulerTasks.runNowAtMs),
|
|
1246
|
+
lte2(juniorSchedulerTasks.runNowAtMs, args.nowMs)
|
|
1247
|
+
),
|
|
1248
|
+
and3(
|
|
1249
|
+
isNotNull(juniorSchedulerTasks.nextRunAtMs),
|
|
1250
|
+
lte2(juniorSchedulerTasks.nextRunAtMs, args.nowMs)
|
|
1251
|
+
)
|
|
1202
1252
|
)
|
|
1203
1253
|
)
|
|
1204
|
-
)
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
asc3(juniorSchedulerTasks.id)
|
|
1208
|
-
);
|
|
1209
|
-
for (const row of rows) {
|
|
1210
|
-
const task = parseSqlTaskRow(row);
|
|
1211
|
-
if (!task) {
|
|
1212
|
-
continue;
|
|
1213
|
-
}
|
|
1214
|
-
const scheduledForMs = getDueRunAtMs(task, args.nowMs);
|
|
1215
|
-
if (scheduledForMs === void 0) {
|
|
1216
|
-
continue;
|
|
1217
|
-
}
|
|
1218
|
-
const runId = buildRunId(task.id, scheduledForMs);
|
|
1219
|
-
const incompleteRuns = await listIncompleteRunsForTasksFromSql(db, [
|
|
1220
|
-
task
|
|
1221
|
-
]);
|
|
1222
|
-
const incompleteRun = incompleteRuns.find((run2) => run2.id === runId);
|
|
1223
|
-
const blockingRun = incompleteRuns.find(
|
|
1224
|
-
(run2) => run2.id !== runId && !isStalePendingRun(run2, args.nowMs)
|
|
1254
|
+
).orderBy(
|
|
1255
|
+
asc3(juniorSchedulerTasks.createdAtMs),
|
|
1256
|
+
asc3(juniorSchedulerTasks.id)
|
|
1225
1257
|
);
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
if (incompleteRun) {
|
|
1230
|
-
if (!isStalePendingRun(incompleteRun, args.nowMs)) {
|
|
1258
|
+
for (const row of rows) {
|
|
1259
|
+
const task = parseSqlTaskRow(row);
|
|
1260
|
+
if (!task) {
|
|
1231
1261
|
continue;
|
|
1232
1262
|
}
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
await
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1263
|
+
const scheduledForMs = getDueRunAtMs(task, args.nowMs);
|
|
1264
|
+
if (scheduledForMs === void 0) {
|
|
1265
|
+
continue;
|
|
1266
|
+
}
|
|
1267
|
+
const runId = buildRunId(task.id, scheduledForMs);
|
|
1268
|
+
const incompleteRuns = await listIncompleteRunsForTasksFromSql(db, [
|
|
1269
|
+
task
|
|
1270
|
+
]);
|
|
1271
|
+
const incompleteRun = incompleteRuns.find((run2) => run2.id === runId);
|
|
1272
|
+
const blockingRun = incompleteRuns.find(
|
|
1273
|
+
(run2) => run2.id !== runId && !isStalePendingRun(run2, args.nowMs)
|
|
1274
|
+
);
|
|
1275
|
+
if (blockingRun) {
|
|
1276
|
+
continue;
|
|
1277
|
+
}
|
|
1278
|
+
if (incompleteRun) {
|
|
1279
|
+
if (!isStalePendingRun(incompleteRun, args.nowMs)) {
|
|
1280
|
+
continue;
|
|
1281
|
+
}
|
|
1282
|
+
const reclaimed = {
|
|
1283
|
+
...incompleteRun,
|
|
1284
|
+
attempt: incompleteRun.attempt + 1,
|
|
1285
|
+
claimedAtMs: args.nowMs
|
|
1286
|
+
};
|
|
1287
|
+
await upsertSqlRun(db, reclaimed);
|
|
1288
|
+
return reclaimed;
|
|
1289
|
+
}
|
|
1290
|
+
const existingRun = await getRunFromSql(db, runId);
|
|
1291
|
+
if (existingRun) {
|
|
1292
|
+
continue;
|
|
1293
|
+
}
|
|
1294
|
+
if (isMissedRunTooOld({ nowMs: args.nowMs, scheduledForMs })) {
|
|
1295
|
+
const skipped = await this.skipMissedRun(db, {
|
|
1296
|
+
nowMs: args.nowMs,
|
|
1297
|
+
scheduledForMs,
|
|
1298
|
+
task
|
|
1299
|
+
});
|
|
1300
|
+
if (skipped) {
|
|
1301
|
+
skippedRuns.push(skipped);
|
|
1302
|
+
}
|
|
1303
|
+
continue;
|
|
1304
|
+
}
|
|
1305
|
+
const run = buildScheduledRun({
|
|
1306
|
+
claimedAtMs: args.nowMs,
|
|
1248
1307
|
scheduledForMs,
|
|
1249
1308
|
task
|
|
1250
1309
|
});
|
|
1251
|
-
|
|
1310
|
+
await upsertSqlRun(db, run);
|
|
1311
|
+
return run;
|
|
1252
1312
|
}
|
|
1253
|
-
|
|
1254
|
-
claimedAtMs: args.nowMs,
|
|
1255
|
-
scheduledForMs,
|
|
1256
|
-
task
|
|
1257
|
-
});
|
|
1258
|
-
await upsertSqlRun(db, run);
|
|
1259
|
-
return run;
|
|
1313
|
+
return void 0;
|
|
1260
1314
|
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1315
|
+
);
|
|
1316
|
+
for (const skipped of skippedRuns) {
|
|
1317
|
+
logScheduledTaskRunSkipped(skipped.task, skipped.run, {
|
|
1318
|
+
"app.task.run.error": skipped.errorMessage
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
return claimed;
|
|
1263
1322
|
}
|
|
1264
1323
|
async skipMissedRun(db, args) {
|
|
1265
1324
|
const current = await getTaskFromSql(db, args.task.id);
|
|
1266
1325
|
if (!current || current.status !== "active" || getDueRunAtMs(current, args.nowMs) !== args.scheduledForMs) {
|
|
1267
|
-
return;
|
|
1326
|
+
return void 0;
|
|
1268
1327
|
}
|
|
1269
1328
|
const duplicateOf = await this.findStaleRecoveryCanonicalTask(db, current);
|
|
1270
1329
|
const errorMessage = duplicateOf ? `Duplicate stale scheduled task was skipped without dispatch. Canonical task: ${duplicateOf.id}.` : "Scheduled occurrence was more than 24 hours late and was skipped without dispatch.";
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
})
|
|
1279
|
-
);
|
|
1330
|
+
const skipped = buildSkippedScheduledRun({
|
|
1331
|
+
completedAtMs: args.nowMs,
|
|
1332
|
+
errorMessage,
|
|
1333
|
+
scheduledForMs: args.scheduledForMs,
|
|
1334
|
+
task: current
|
|
1335
|
+
});
|
|
1336
|
+
await upsertSqlRun(db, skipped);
|
|
1280
1337
|
const isRunNow = current.runNowAtMs === args.scheduledForMs;
|
|
1281
1338
|
let nextRunAtMs;
|
|
1282
1339
|
if (!duplicateOf) {
|
|
@@ -1295,6 +1352,7 @@ var SqlSchedulerStore = class {
|
|
|
1295
1352
|
},
|
|
1296
1353
|
current
|
|
1297
1354
|
);
|
|
1355
|
+
return { errorMessage, run: skipped, task: current };
|
|
1298
1356
|
}
|
|
1299
1357
|
async findStaleRecoveryCanonicalTask(db, task) {
|
|
1300
1358
|
const fingerprint = taskDedupeFingerprint(task);
|
|
@@ -1374,7 +1432,7 @@ var SqlSchedulerStore = class {
|
|
|
1374
1432
|
async updateTaskAfterRun(args) {
|
|
1375
1433
|
await withSqlLock(this.db, taskLockKey(args.run.taskId), async (db) => {
|
|
1376
1434
|
const current = await getTaskFromSql(db, args.run.taskId);
|
|
1377
|
-
if (!current || current.status === "deleted") {
|
|
1435
|
+
if (!current || current.status === "deleted" || current.status === "completed") {
|
|
1378
1436
|
return;
|
|
1379
1437
|
}
|
|
1380
1438
|
const isRunNow = current.runNowAtMs === args.run.scheduledForMs;
|
|
@@ -1395,8 +1453,8 @@ var SqlSchedulerStore = class {
|
|
|
1395
1453
|
nextRunAtMs: nextRunAtMs2,
|
|
1396
1454
|
runNowAtMs: void 0,
|
|
1397
1455
|
status: statusAfterTerminalOccurrence({
|
|
1398
|
-
blocked: args.status === "blocked",
|
|
1399
1456
|
nextRunAtMs: nextRunAtMs2,
|
|
1457
|
+
outcome: args.status,
|
|
1400
1458
|
previousStatus: current.status
|
|
1401
1459
|
}),
|
|
1402
1460
|
statusReason: args.status === "blocked" ? args.errorMessage : void 0,
|
|
@@ -1426,8 +1484,8 @@ var SqlSchedulerStore = class {
|
|
|
1426
1484
|
lastRunAtMs: args.run.scheduledForMs,
|
|
1427
1485
|
nextRunAtMs,
|
|
1428
1486
|
status: statusAfterTerminalOccurrence({
|
|
1429
|
-
|
|
1430
|
-
|
|
1487
|
+
nextRunAtMs,
|
|
1488
|
+
outcome: args.status
|
|
1431
1489
|
}),
|
|
1432
1490
|
statusReason: args.status === "blocked" ? args.errorMessage : void 0,
|
|
1433
1491
|
updatedAtMs: args.nowMs
|
|
@@ -1491,6 +1549,9 @@ export {
|
|
|
1491
1549
|
getZonedDateTimeParts,
|
|
1492
1550
|
resolveLocalScheduleAtMs,
|
|
1493
1551
|
getFirstRunAtMs,
|
|
1552
|
+
scheduledTaskAttributes,
|
|
1553
|
+
scheduledTaskRunAttributes,
|
|
1554
|
+
logScheduledTaskRunSkipped,
|
|
1494
1555
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
1495
1556
|
listPublicScheduledTasksForTeams,
|
|
1496
1557
|
createSchedulerSqlStore,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JUNIOR_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CPPTBHQN.js";
|
|
4
4
|
|
|
5
5
|
// src/deployment.ts
|
|
6
6
|
var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
|
|
@@ -15,7 +15,14 @@ function toOptionalTrimmed(value) {
|
|
|
15
15
|
return trimmed ? trimmed : void 0;
|
|
16
16
|
}
|
|
17
17
|
function getDeploymentServiceVersion() {
|
|
18
|
-
|
|
18
|
+
const configuredRelease = toOptionalTrimmed(process.env.SENTRY_RELEASE);
|
|
19
|
+
if (configuredRelease) {
|
|
20
|
+
return configuredRelease;
|
|
21
|
+
}
|
|
22
|
+
const deploymentRevision = toOptionalTrimmed(
|
|
23
|
+
process.env.VERCEL_GIT_COMMIT_SHA
|
|
24
|
+
);
|
|
25
|
+
return deploymentRevision ? `${JUNIOR_VERSION}+${deploymentRevision}` : void 0;
|
|
19
26
|
}
|
|
20
27
|
function getDeploymentTelemetryAttributes() {
|
|
21
28
|
const attributes = {};
|
|
@@ -615,7 +615,7 @@ var scheduledTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
|
615
615
|
kind: z7.literal("scheduled"),
|
|
616
616
|
nextRunAt: z7.string().datetime().optional(),
|
|
617
617
|
schedule: z7.string().min(1),
|
|
618
|
-
status: z7.enum(["active", "blocked"])
|
|
618
|
+
status: z7.enum(["active", "blocked", "completed"])
|
|
619
619
|
}).strict();
|
|
620
620
|
var eventTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
621
621
|
events: z7.array(z7.string().min(1)).min(1),
|
|
@@ -642,6 +642,30 @@ var taskParamsSchema = z7.object({
|
|
|
642
642
|
id: z7.string().min(1),
|
|
643
643
|
kind: z7.enum(["scheduled", "event"])
|
|
644
644
|
}).strict();
|
|
645
|
+
var taskExecutionStatusSchema = z7.enum([
|
|
646
|
+
"blocked",
|
|
647
|
+
"completed",
|
|
648
|
+
"failed"
|
|
649
|
+
]);
|
|
650
|
+
var taskExecutionSchema = z7.object({
|
|
651
|
+
conversationId: z7.string().min(1).optional(),
|
|
652
|
+
executedAt: z7.string().datetime(),
|
|
653
|
+
executionId: z7.string().min(1),
|
|
654
|
+
status: taskExecutionStatusSchema,
|
|
655
|
+
title: z7.string().min(1).optional()
|
|
656
|
+
}).strict();
|
|
657
|
+
var taskExecutionStatusDaySchema = z7.object({
|
|
658
|
+
blocked: z7.number().int().nonnegative(),
|
|
659
|
+
completed: z7.number().int().nonnegative(),
|
|
660
|
+
date: z7.string().min(1),
|
|
661
|
+
failed: z7.number().int().nonnegative()
|
|
662
|
+
}).strict();
|
|
663
|
+
var taskExecutionListSchema = z7.object({
|
|
664
|
+
executionDays: z7.array(taskExecutionStatusDaySchema),
|
|
665
|
+
executions: z7.array(taskExecutionSchema),
|
|
666
|
+
task: taskSummarySchema,
|
|
667
|
+
truncated: z7.boolean()
|
|
668
|
+
}).strict();
|
|
645
669
|
|
|
646
670
|
// src/api/schema/stats.ts
|
|
647
671
|
import { z as z8 } from "zod";
|
|
@@ -697,6 +721,10 @@ export {
|
|
|
697
721
|
taskSummarySchema,
|
|
698
722
|
taskListSchema,
|
|
699
723
|
taskParamsSchema,
|
|
724
|
+
taskExecutionStatusSchema,
|
|
725
|
+
taskExecutionSchema,
|
|
726
|
+
taskExecutionStatusDaySchema,
|
|
727
|
+
taskExecutionListSchema,
|
|
700
728
|
statSchema,
|
|
701
729
|
statsReportSchema
|
|
702
730
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ensureConversationWake,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AA2EPMUF.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
requireTurnFailureEventId,
|
|
18
18
|
resolveTurnSessionRouting,
|
|
19
19
|
scheduleSessionCompletedPluginTasks
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A6BI25J3.js";
|
|
21
21
|
import {
|
|
22
22
|
ConversationTurnLifecycleService
|
|
23
23
|
} from "./chunk-Q6QZTTLS.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getMcpProviderErrorAttributes,
|
|
36
36
|
getMcpStoredOAuthCredentials,
|
|
37
37
|
resolvePluginOAuthAccount
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3CUBAGA3.js";
|
|
39
39
|
import {
|
|
40
40
|
RetryableDeliveryError
|
|
41
41
|
} from "./chunk-R776HKPK.js";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
removeReactionFromMessage,
|
|
52
52
|
resolveBaseUrl,
|
|
53
53
|
truncateStatusText
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-5KAZMR5U.js";
|
|
55
55
|
import {
|
|
56
56
|
TurnSliceLimitExceededError,
|
|
57
57
|
abandonAgentTurnSessionRecord,
|
|
@@ -82,32 +82,32 @@ import {
|
|
|
82
82
|
recordDeliveredAssistantMessage,
|
|
83
83
|
turnHasReply,
|
|
84
84
|
updateConversationStats
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-BMFRFSTM.js";
|
|
86
86
|
import {
|
|
87
87
|
parseSlackThreadId,
|
|
88
88
|
readSlackRawMessageContext,
|
|
89
89
|
resolveSlackChannelIdFromMessage,
|
|
90
90
|
resolveSlackChannelIdFromThreadId
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-WTGLUX4K.js";
|
|
92
92
|
import {
|
|
93
93
|
getDashboardConversationLink,
|
|
94
94
|
getPluginSlackConversationLink
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-4PIT6O7A.js";
|
|
96
96
|
import {
|
|
97
97
|
SlackActionError,
|
|
98
98
|
getHeaderString,
|
|
99
99
|
getSlackClient,
|
|
100
100
|
isDmChannel,
|
|
101
101
|
normalizeSlackConversationId
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-HEFBGCCU.js";
|
|
103
103
|
import {
|
|
104
104
|
getConversationEventStore,
|
|
105
105
|
requireSlackDestination
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-WSWM6A3R.js";
|
|
107
107
|
import {
|
|
108
108
|
acquireActiveLock,
|
|
109
109
|
getStateAdapter
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-J5H65GY2.js";
|
|
111
111
|
import {
|
|
112
112
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
113
113
|
botConfig,
|
|
@@ -116,18 +116,18 @@ import {
|
|
|
116
116
|
getRuntimeMetadata,
|
|
117
117
|
normalizeSlackEmojiName,
|
|
118
118
|
standardModelId
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-S3FAOKQU.js";
|
|
120
120
|
import {
|
|
121
121
|
discoverSkills
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-D3X2PI3D.js";
|
|
123
123
|
import {
|
|
124
124
|
pluginCatalogRuntime
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-N2I7W2VS.js";
|
|
126
126
|
import {
|
|
127
127
|
buildOAuthTokenRequest,
|
|
128
128
|
hasRequiredOAuthScope,
|
|
129
129
|
parseOAuthTokenResponse
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-I3OZR3HG.js";
|
|
131
131
|
import {
|
|
132
132
|
createSlackResumeActor,
|
|
133
133
|
isUserActor
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
setTags,
|
|
144
144
|
toOptionalString,
|
|
145
145
|
withLogContext
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-NPL66ZWL.js";
|
|
147
147
|
import {
|
|
148
148
|
homeDir
|
|
149
149
|
} from "./chunk-H4HBKISO.js";
|
|
@@ -2044,7 +2044,6 @@ async function resumeAuthorizedMcpTurn(args) {
|
|
|
2044
2044
|
let actor;
|
|
2045
2045
|
try {
|
|
2046
2046
|
actor = createSlackResumeActor({
|
|
2047
|
-
actor: isUserActor(lockedSessionRecord.actor) ? lockedSessionRecord.actor : void 0,
|
|
2048
2047
|
teamId: destination.teamId,
|
|
2049
2048
|
userId: authSession.userId
|
|
2050
2049
|
});
|
|
@@ -2053,7 +2052,7 @@ async function resumeAuthorizedMcpTurn(args) {
|
|
|
2053
2052
|
conversationId: authSession.conversationId,
|
|
2054
2053
|
expectedVersion: lockedSessionRecord.version,
|
|
2055
2054
|
sessionId: lockedSessionId,
|
|
2056
|
-
errorMessage: "
|
|
2055
|
+
errorMessage: "Unable to rebuild Slack actor for OAuth resume"
|
|
2057
2056
|
});
|
|
2058
2057
|
return false;
|
|
2059
2058
|
}
|
|
@@ -2678,7 +2677,6 @@ async function resumeOAuthSessionRecordTurn(stored, options) {
|
|
|
2678
2677
|
let actor;
|
|
2679
2678
|
try {
|
|
2680
2679
|
actor = createSlackResumeActor({
|
|
2681
|
-
actor: isUserActor(lockedSessionRecord.actor) ? lockedSessionRecord.actor : void 0,
|
|
2682
2680
|
teamId: destination.teamId,
|
|
2683
2681
|
userId: lockedUserMessage.author.userId
|
|
2684
2682
|
});
|
|
@@ -2687,7 +2685,7 @@ async function resumeOAuthSessionRecordTurn(stored, options) {
|
|
|
2687
2685
|
conversationId: stored.resumeConversationId,
|
|
2688
2686
|
expectedVersion: lockedSessionRecord.version,
|
|
2689
2687
|
sessionId: lockedSessionId,
|
|
2690
|
-
errorMessage: "
|
|
2688
|
+
errorMessage: "Unable to rebuild Slack actor for OAuth resume"
|
|
2691
2689
|
});
|
|
2692
2690
|
return false;
|
|
2693
2691
|
}
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-MYVCHWDG.js";
|
|
5
|
+
import "../chunk-DMDOKRPC.js";
|
|
6
6
|
import "../chunk-DIB4GX3G.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-3CUBAGA3.js";
|
|
8
8
|
import "../chunk-R776HKPK.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-5KAZMR5U.js";
|
|
10
|
+
import "../chunk-BMFRFSTM.js";
|
|
11
11
|
import "../chunk-3Y47VMHV.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-HUO3UTAQ.js";
|
|
13
13
|
import "../chunk-5IDFPCON.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-OGNL2QY7.js";
|
|
15
|
+
import "../chunk-XX2QNQN4.js";
|
|
16
|
+
import "../chunk-WTGLUX4K.js";
|
|
17
17
|
import "../chunk-CDQ4YIZM.js";
|
|
18
18
|
import "../chunk-PDO5BLNM.js";
|
|
19
19
|
import "../chunk-UIE3R5XU.js";
|
|
20
20
|
import {
|
|
21
21
|
loadAppPluginSet
|
|
22
22
|
} from "../chunk-Y2CM7HXH.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-4PIT6O7A.js";
|
|
24
|
+
import "../chunk-HEFBGCCU.js";
|
|
25
|
+
import "../chunk-WSWM6A3R.js";
|
|
26
|
+
import "../chunk-557HLSNH.js";
|
|
27
27
|
import "../chunk-EM225ITJ.js";
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-J5H65GY2.js";
|
|
29
|
+
import "../chunk-S3FAOKQU.js";
|
|
30
30
|
import "../chunk-VFUK3X5B.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-UXMRN2ZX.js";
|
|
32
|
+
import "../chunk-D3X2PI3D.js";
|
|
33
|
+
import "../chunk-N2I7W2VS.js";
|
|
34
|
+
import "../chunk-I3OZR3HG.js";
|
|
35
|
+
import "../chunk-RUIXF3YQ.js";
|
|
36
36
|
import "../chunk-HZF5P5UN.js";
|
|
37
37
|
import "../chunk-F3B2YJ76.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-NPL66ZWL.js";
|
|
39
39
|
import "../chunk-6GWA276C.js";
|
|
40
40
|
import "../chunk-OOUNJNMR.js";
|
|
41
41
|
import "../chunk-H4HBKISO.js";
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-YB363QGA.js";
|
|
43
|
+
import "../chunk-CPPTBHQN.js";
|
|
44
44
|
import "../chunk-MLKGABMK.js";
|
|
45
45
|
|
|
46
46
|
// src/cli/chat.ts
|
|
@@ -163,10 +163,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
163
163
|
databaseModule
|
|
164
164
|
] = await Promise.all([
|
|
165
165
|
import("../plugins-HW4VWW6G.js"),
|
|
166
|
-
import("../agent-hooks-
|
|
167
|
-
import("../catalog-runtime-
|
|
168
|
-
import("../validation-
|
|
169
|
-
import("../db-
|
|
166
|
+
import("../agent-hooks-BFTDRFUO.js"),
|
|
167
|
+
import("../catalog-runtime-RK664S5T.js"),
|
|
168
|
+
import("../validation-M5JNGRGL.js"),
|
|
169
|
+
import("../db-QOGYDDQM.js")
|
|
170
170
|
]);
|
|
171
171
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
172
172
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -232,14 +232,14 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
232
232
|
await configureLocalChatPlugins(pluginSet);
|
|
233
233
|
const { setExperimentalFeatures } = await import("../experimental-HH6OM6UH.js");
|
|
234
234
|
setExperimentalFeatures({ subagents: true });
|
|
235
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
236
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
235
|
+
const { runLocalAgentTurn } = await import("../runner-PHMLHNLX.js");
|
|
236
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CT4RMGCP.js");
|
|
237
237
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
238
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
239
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
240
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
238
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-EKPAVWQL.js");
|
|
239
|
+
const { bindSpawnAgent } = await import("../spawn-OGRQFUNK.js");
|
|
240
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-LZWE6HK4.js");
|
|
241
241
|
const { createLocalConversationWork } = await import("../conversation-work-KATFHLG3.js");
|
|
242
|
-
const { processConversationWork } = await import("../worker-
|
|
242
|
+
const { processConversationWork } = await import("../worker-KOGPXFYK.js");
|
|
243
243
|
let agentRunner;
|
|
244
244
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
245
245
|
if (!agentRunner) {
|