@sentry/junior-scheduler 0.60.0 → 0.61.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/index.js +18 -56
- package/package.json +2 -2
- package/src/schedule-tools.ts +19 -60
package/dist/index.js
CHANGED
|
@@ -948,15 +948,6 @@ import {
|
|
|
948
948
|
var TASK_ID_PREFIX = "sched";
|
|
949
949
|
var MAX_LISTED_TASKS = 50;
|
|
950
950
|
var DEFAULT_SCHEDULE_TIMEZONE = "America/Los_Angeles";
|
|
951
|
-
var ACTIVE_DESTINATION_GUIDELINE = "Only manage tasks for the active Slack DM or channel; never target an existing thread, another channel, or another user's DM.";
|
|
952
|
-
var ACTIVE_TASK_ID_GUIDELINE = "Use only task IDs returned from this active destination.";
|
|
953
|
-
var RECURRING_GUIDELINE = "Omit recurrence for one-time requests like 'in 1 minute', 'tomorrow', or a specific date; provide recurrence only for requests that explicitly repeat.";
|
|
954
|
-
var recurrenceInputSchema = Type.Union([
|
|
955
|
-
Type.Literal("daily"),
|
|
956
|
-
Type.Literal("weekly"),
|
|
957
|
-
Type.Literal("monthly"),
|
|
958
|
-
Type.Literal("yearly")
|
|
959
|
-
]);
|
|
960
951
|
function throwToolInputError(error) {
|
|
961
952
|
throw new AgentPluginToolInputError(error);
|
|
962
953
|
}
|
|
@@ -1147,29 +1138,23 @@ function parseNextRunAtMs(nextRunAtIso) {
|
|
|
1147
1138
|
}
|
|
1148
1139
|
function createSlackScheduleCreateTaskTool(context) {
|
|
1149
1140
|
return tool({
|
|
1150
|
-
description: "Create a
|
|
1151
|
-
promptSnippet: "create future or recurring Junior work here",
|
|
1152
|
-
promptGuidelines: [
|
|
1153
|
-
"Use only when the user explicitly asks Junior to do work later or on a recurring cadence.",
|
|
1154
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
1155
|
-
RECURRING_GUIDELINE,
|
|
1156
|
-
"When the user's scheduling intent is clear, create the task immediately without asking for confirmation.",
|
|
1157
|
-
"Ask for confirmation only when the task contract, schedule, or active destination is ambiguous.",
|
|
1158
|
-
"Recurring tasks can run at most once per day; use only daily, weekly, monthly, or yearly recurrence frequencies.",
|
|
1159
|
-
"Provide next_run_at as an exact ISO timestamp computed from the user's requested schedule.",
|
|
1160
|
-
"Provide recurrence only for repeating schedules."
|
|
1161
|
-
],
|
|
1141
|
+
description: "Create a future or recurring Junior task in the active Slack conversation. Use only when the user explicitly asks Junior to do work later or on a recurring cadence. Only manage tasks for the active Slack DM or channel; never target threads, other channels, or another user's DM. When the task, schedule, and destination are clear, create it without asking for confirmation; ask only when one of those is ambiguous.",
|
|
1162
1142
|
inputSchema: Type.Object({
|
|
1163
1143
|
task: Type.String({ minLength: 1, maxLength: 4e3 }),
|
|
1164
1144
|
schedule: Type.String({ minLength: 1, maxLength: 300 }),
|
|
1165
|
-
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80 })),
|
|
1145
|
+
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80, description: "IANA timezone, e.g. 'America/Los_Angeles'. Defaults to the channel's configured timezone." })),
|
|
1166
1146
|
next_run_at: Type.Optional(
|
|
1167
1147
|
Type.String({
|
|
1168
1148
|
minLength: 1,
|
|
1169
1149
|
description: "Exact next run time as an ISO timestamp, computed from the user's requested schedule."
|
|
1170
1150
|
})
|
|
1171
1151
|
),
|
|
1172
|
-
recurrence: Type.Optional(
|
|
1152
|
+
recurrence: Type.Optional(Type.Union([
|
|
1153
|
+
Type.Literal("daily"),
|
|
1154
|
+
Type.Literal("weekly"),
|
|
1155
|
+
Type.Literal("monthly"),
|
|
1156
|
+
Type.Literal("yearly")
|
|
1157
|
+
], { description: "Provide only for explicitly repeating schedules; omit for one-time requests like 'in 1 minute', 'tomorrow', or a specific date. Recurring tasks run at most once per day: use daily, weekly, monthly, or yearly only." }))
|
|
1173
1158
|
}),
|
|
1174
1159
|
execute: async (input) => {
|
|
1175
1160
|
const destination = requireActiveDestination(context);
|
|
@@ -1227,12 +1212,7 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
1227
1212
|
}
|
|
1228
1213
|
function createSlackScheduleListTasksTool(context) {
|
|
1229
1214
|
return tool({
|
|
1230
|
-
description: "List scheduled Junior tasks for the active Slack conversation.",
|
|
1231
|
-
promptSnippet: "list schedules for this Slack destination",
|
|
1232
|
-
promptGuidelines: [
|
|
1233
|
-
"Use when the user asks what is scheduled here or needs task IDs before editing, deleting, or running schedules.",
|
|
1234
|
-
ACTIVE_DESTINATION_GUIDELINE
|
|
1235
|
-
],
|
|
1215
|
+
description: "List scheduled Junior tasks for the active Slack conversation. Use when the user asks what is scheduled here, or when task IDs are needed before editing, deleting, or running schedules. Only manages tasks for the active Slack DM or channel.",
|
|
1236
1216
|
annotations: { readOnlyHint: true, destructiveHint: false },
|
|
1237
1217
|
inputSchema: Type.Object({}),
|
|
1238
1218
|
execute: async () => {
|
|
@@ -1254,32 +1234,22 @@ function createSlackScheduleListTasksTool(context) {
|
|
|
1254
1234
|
}
|
|
1255
1235
|
function createSlackScheduleUpdateTaskTool(context) {
|
|
1256
1236
|
return tool({
|
|
1257
|
-
description: "Edit, pause, resume, or reschedule
|
|
1258
|
-
promptSnippet: "edit/pause/resume one schedule in this Slack destination",
|
|
1259
|
-
promptGuidelines: [
|
|
1260
|
-
ACTIVE_TASK_ID_GUIDELINE,
|
|
1261
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
1262
|
-
RECURRING_GUIDELINE,
|
|
1263
|
-
"Do not move scheduled tasks across conversations.",
|
|
1264
|
-
"Provide next_run_at as an exact ISO timestamp when changing the next run.",
|
|
1265
|
-
"Set recurrence to null when converting a recurring task to one-time.",
|
|
1266
|
-
"Set status to active, paused, or blocked when the user asks to resume, pause, or block a task."
|
|
1267
|
-
],
|
|
1237
|
+
description: "Edit, pause, resume, or reschedule an existing Junior scheduled task in the active Slack conversation. Use only task IDs returned for this destination. Do not move scheduled tasks across conversations.",
|
|
1268
1238
|
inputSchema: Type.Object({
|
|
1269
|
-
task_id: Type.String({ minLength: 1 }),
|
|
1239
|
+
task_id: Type.String({ minLength: 1, description: "ID of the task to update. Must be from this active Slack destination." }),
|
|
1270
1240
|
task: Type.Optional(Type.String({ minLength: 1, maxLength: 4e3 })),
|
|
1271
1241
|
schedule: Type.Optional(Type.String({ minLength: 1, maxLength: 300 })),
|
|
1272
1242
|
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80 })),
|
|
1273
|
-
next_run_at: Type.Optional(Type.String({ minLength: 1 })),
|
|
1243
|
+
next_run_at: Type.Optional(Type.String({ minLength: 1, description: "Exact ISO timestamp when changing the next run time." })),
|
|
1274
1244
|
recurrence: Type.Optional(
|
|
1275
|
-
Type.Union([
|
|
1245
|
+
Type.Union([Type.Literal("daily"), Type.Literal("weekly"), Type.Literal("monthly"), Type.Literal("yearly"), Type.Null()], { description: "Provide only for repeating schedules. Omit for one-time requests. Set to null to convert a recurring task to one-time." })
|
|
1276
1246
|
),
|
|
1277
1247
|
status: Type.Optional(
|
|
1278
1248
|
Type.Union([
|
|
1279
1249
|
Type.Literal("active"),
|
|
1280
1250
|
Type.Literal("paused"),
|
|
1281
1251
|
Type.Literal("blocked")
|
|
1282
|
-
])
|
|
1252
|
+
], { description: "Set to active, paused, or blocked to resume, pause, or block the task." })
|
|
1283
1253
|
)
|
|
1284
1254
|
}),
|
|
1285
1255
|
execute: async (input) => {
|
|
@@ -1340,11 +1310,9 @@ function createSlackScheduleUpdateTaskTool(context) {
|
|
|
1340
1310
|
}
|
|
1341
1311
|
function createSlackScheduleDeleteTaskTool(context) {
|
|
1342
1312
|
return tool({
|
|
1343
|
-
description: "Delete
|
|
1344
|
-
promptSnippet: "delete one schedule from this Slack destination",
|
|
1345
|
-
promptGuidelines: [ACTIVE_TASK_ID_GUIDELINE, ACTIVE_DESTINATION_GUIDELINE],
|
|
1313
|
+
description: "Delete one scheduled Junior task from the active Slack conversation. Use only task IDs returned for this destination. Do not delete schedules from threads, other channels, or another user's DM.",
|
|
1346
1314
|
inputSchema: Type.Object({
|
|
1347
|
-
task_id: Type.String({ minLength: 1 })
|
|
1315
|
+
task_id: Type.String({ minLength: 1, description: "ID of the task to delete. Must be from this active Slack destination." })
|
|
1348
1316
|
}),
|
|
1349
1317
|
execute: async ({ task_id }) => {
|
|
1350
1318
|
const lookup = await getWritableTask({ context, taskId: task_id });
|
|
@@ -1366,15 +1334,9 @@ function createSlackScheduleDeleteTaskTool(context) {
|
|
|
1366
1334
|
}
|
|
1367
1335
|
function createSlackScheduleRunTaskNowTool(context) {
|
|
1368
1336
|
return tool({
|
|
1369
|
-
description: "Queue an active Junior
|
|
1370
|
-
promptSnippet: "run one active schedule now without changing its cadence",
|
|
1371
|
-
promptGuidelines: [
|
|
1372
|
-
ACTIVE_TASK_ID_GUIDELINE,
|
|
1373
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
1374
|
-
"Use when the user asks to run an existing scheduled task now; do not rewrite the stored calendar cadence."
|
|
1375
|
-
],
|
|
1337
|
+
description: "Queue an existing active scheduled Junior task to run as soon as possible, without changing its cadence. Use when the user asks to run an existing scheduled task now. Use only task IDs returned for this destination.",
|
|
1376
1338
|
inputSchema: Type.Object({
|
|
1377
|
-
task_id: Type.String({ minLength: 1 })
|
|
1339
|
+
task_id: Type.String({ minLength: 1, description: "ID of the active task to run now. Must be from this active Slack destination." })
|
|
1378
1340
|
}),
|
|
1379
1341
|
execute: async ({ task_id }) => {
|
|
1380
1342
|
const lookup = await getWritableTask({ context, taskId: task_id });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-scheduler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@sinclair/typebox": "^0.34.49",
|
|
27
|
-
"@sentry/junior-plugin-api": "0.
|
|
27
|
+
"@sentry/junior-plugin-api": "0.61.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^25.9.1",
|
package/src/schedule-tools.ts
CHANGED
|
@@ -38,19 +38,6 @@ export interface SchedulerToolContext {
|
|
|
38
38
|
const TASK_ID_PREFIX = "sched";
|
|
39
39
|
const MAX_LISTED_TASKS = 50;
|
|
40
40
|
const DEFAULT_SCHEDULE_TIMEZONE = "America/Los_Angeles";
|
|
41
|
-
const ACTIVE_DESTINATION_GUIDELINE =
|
|
42
|
-
"Only manage tasks for the active Slack DM or channel; never target an existing thread, another channel, or another user's DM.";
|
|
43
|
-
const ACTIVE_TASK_ID_GUIDELINE =
|
|
44
|
-
"Use only task IDs returned from this active destination.";
|
|
45
|
-
const RECURRING_GUIDELINE =
|
|
46
|
-
"Omit recurrence for one-time requests like 'in 1 minute', 'tomorrow', or a specific date; provide recurrence only for requests that explicitly repeat.";
|
|
47
|
-
|
|
48
|
-
const recurrenceInputSchema = Type.Union([
|
|
49
|
-
Type.Literal("daily"),
|
|
50
|
-
Type.Literal("weekly"),
|
|
51
|
-
Type.Literal("monthly"),
|
|
52
|
-
Type.Literal("yearly"),
|
|
53
|
-
]);
|
|
54
41
|
|
|
55
42
|
function throwToolInputError(error: string): never {
|
|
56
43
|
throw new AgentPluginToolInputError(error);
|
|
@@ -349,22 +336,11 @@ export function createSlackScheduleCreateTaskTool(
|
|
|
349
336
|
) {
|
|
350
337
|
return tool({
|
|
351
338
|
description:
|
|
352
|
-
"Create a
|
|
353
|
-
promptSnippet: "create future or recurring Junior work here",
|
|
354
|
-
promptGuidelines: [
|
|
355
|
-
"Use only when the user explicitly asks Junior to do work later or on a recurring cadence.",
|
|
356
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
357
|
-
RECURRING_GUIDELINE,
|
|
358
|
-
"When the user's scheduling intent is clear, create the task immediately without asking for confirmation.",
|
|
359
|
-
"Ask for confirmation only when the task contract, schedule, or active destination is ambiguous.",
|
|
360
|
-
"Recurring tasks can run at most once per day; use only daily, weekly, monthly, or yearly recurrence frequencies.",
|
|
361
|
-
"Provide next_run_at as an exact ISO timestamp computed from the user's requested schedule.",
|
|
362
|
-
"Provide recurrence only for repeating schedules.",
|
|
363
|
-
],
|
|
339
|
+
"Create a future or recurring Junior task in the active Slack conversation. Use only when the user explicitly asks Junior to do work later or on a recurring cadence. Only manage tasks for the active Slack DM or channel; never target threads, other channels, or another user's DM. When the task, schedule, and destination are clear, create it without asking for confirmation; ask only when one of those is ambiguous.",
|
|
364
340
|
inputSchema: Type.Object({
|
|
365
341
|
task: Type.String({ minLength: 1, maxLength: 4000 }),
|
|
366
342
|
schedule: Type.String({ minLength: 1, maxLength: 300 }),
|
|
367
|
-
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80 })),
|
|
343
|
+
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80, description: "IANA timezone, e.g. 'America/Los_Angeles'. Defaults to the channel's configured timezone." })),
|
|
368
344
|
next_run_at: Type.Optional(
|
|
369
345
|
Type.String({
|
|
370
346
|
minLength: 1,
|
|
@@ -372,7 +348,12 @@ export function createSlackScheduleCreateTaskTool(
|
|
|
372
348
|
"Exact next run time as an ISO timestamp, computed from the user's requested schedule.",
|
|
373
349
|
}),
|
|
374
350
|
),
|
|
375
|
-
recurrence: Type.Optional(
|
|
351
|
+
recurrence: Type.Optional(Type.Union([
|
|
352
|
+
Type.Literal("daily"),
|
|
353
|
+
Type.Literal("weekly"),
|
|
354
|
+
Type.Literal("monthly"),
|
|
355
|
+
Type.Literal("yearly"),
|
|
356
|
+
], { description: "Provide only for explicitly repeating schedules; omit for one-time requests like 'in 1 minute', 'tomorrow', or a specific date. Recurring tasks run at most once per day: use daily, weekly, monthly, or yearly only." })),
|
|
376
357
|
}),
|
|
377
358
|
execute: async (input) => {
|
|
378
359
|
const destination = requireActiveDestination(context);
|
|
@@ -438,12 +419,7 @@ export function createSlackScheduleListTasksTool(
|
|
|
438
419
|
) {
|
|
439
420
|
return tool({
|
|
440
421
|
description:
|
|
441
|
-
"List scheduled Junior tasks for the active Slack conversation.",
|
|
442
|
-
promptSnippet: "list schedules for this Slack destination",
|
|
443
|
-
promptGuidelines: [
|
|
444
|
-
"Use when the user asks what is scheduled here or needs task IDs before editing, deleting, or running schedules.",
|
|
445
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
446
|
-
],
|
|
422
|
+
"List scheduled Junior tasks for the active Slack conversation. Use when the user asks what is scheduled here, or when task IDs are needed before editing, deleting, or running schedules. Only manages tasks for the active Slack DM or channel.",
|
|
447
423
|
annotations: { readOnlyHint: true, destructiveHint: false },
|
|
448
424
|
inputSchema: Type.Object({}),
|
|
449
425
|
execute: async () => {
|
|
@@ -471,32 +447,23 @@ export function createSlackScheduleUpdateTaskTool(
|
|
|
471
447
|
context: SchedulerToolContext,
|
|
472
448
|
) {
|
|
473
449
|
return tool({
|
|
474
|
-
description:
|
|
475
|
-
|
|
476
|
-
promptGuidelines: [
|
|
477
|
-
ACTIVE_TASK_ID_GUIDELINE,
|
|
478
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
479
|
-
RECURRING_GUIDELINE,
|
|
480
|
-
"Do not move scheduled tasks across conversations.",
|
|
481
|
-
"Provide next_run_at as an exact ISO timestamp when changing the next run.",
|
|
482
|
-
"Set recurrence to null when converting a recurring task to one-time.",
|
|
483
|
-
"Set status to active, paused, or blocked when the user asks to resume, pause, or block a task.",
|
|
484
|
-
],
|
|
450
|
+
description:
|
|
451
|
+
"Edit, pause, resume, or reschedule an existing Junior scheduled task in the active Slack conversation. Use only task IDs returned for this destination. Do not move scheduled tasks across conversations.",
|
|
485
452
|
inputSchema: Type.Object({
|
|
486
|
-
task_id: Type.String({ minLength: 1 }),
|
|
453
|
+
task_id: Type.String({ minLength: 1, description: "ID of the task to update. Must be from this active Slack destination." }),
|
|
487
454
|
task: Type.Optional(Type.String({ minLength: 1, maxLength: 4000 })),
|
|
488
455
|
schedule: Type.Optional(Type.String({ minLength: 1, maxLength: 300 })),
|
|
489
456
|
timezone: Type.Optional(Type.String({ minLength: 1, maxLength: 80 })),
|
|
490
|
-
next_run_at: Type.Optional(Type.String({ minLength: 1 })),
|
|
457
|
+
next_run_at: Type.Optional(Type.String({ minLength: 1, description: "Exact ISO timestamp when changing the next run time." })),
|
|
491
458
|
recurrence: Type.Optional(
|
|
492
|
-
Type.Union([
|
|
459
|
+
Type.Union([Type.Literal("daily"), Type.Literal("weekly"), Type.Literal("monthly"), Type.Literal("yearly"), Type.Null()], { description: "Provide only for repeating schedules. Omit for one-time requests. Set to null to convert a recurring task to one-time." }),
|
|
493
460
|
),
|
|
494
461
|
status: Type.Optional(
|
|
495
462
|
Type.Union([
|
|
496
463
|
Type.Literal("active"),
|
|
497
464
|
Type.Literal("paused"),
|
|
498
465
|
Type.Literal("blocked"),
|
|
499
|
-
]),
|
|
466
|
+
], { description: "Set to active, paused, or blocked to resume, pause, or block the task." }),
|
|
500
467
|
),
|
|
501
468
|
}),
|
|
502
469
|
execute: async (input) => {
|
|
@@ -571,11 +538,9 @@ export function createSlackScheduleDeleteTaskTool(
|
|
|
571
538
|
) {
|
|
572
539
|
return tool({
|
|
573
540
|
description:
|
|
574
|
-
"Delete
|
|
575
|
-
promptSnippet: "delete one schedule from this Slack destination",
|
|
576
|
-
promptGuidelines: [ACTIVE_TASK_ID_GUIDELINE, ACTIVE_DESTINATION_GUIDELINE],
|
|
541
|
+
"Delete one scheduled Junior task from the active Slack conversation. Use only task IDs returned for this destination. Do not delete schedules from threads, other channels, or another user's DM.",
|
|
577
542
|
inputSchema: Type.Object({
|
|
578
|
-
task_id: Type.String({ minLength: 1 }),
|
|
543
|
+
task_id: Type.String({ minLength: 1, description: "ID of the task to delete. Must be from this active Slack destination." }),
|
|
579
544
|
}),
|
|
580
545
|
execute: async ({ task_id }) => {
|
|
581
546
|
const lookup = await getWritableTask({ context, taskId: task_id });
|
|
@@ -604,15 +569,9 @@ export function createSlackScheduleRunTaskNowTool(
|
|
|
604
569
|
) {
|
|
605
570
|
return tool({
|
|
606
571
|
description:
|
|
607
|
-
"Queue an active Junior
|
|
608
|
-
promptSnippet: "run one active schedule now without changing its cadence",
|
|
609
|
-
promptGuidelines: [
|
|
610
|
-
ACTIVE_TASK_ID_GUIDELINE,
|
|
611
|
-
ACTIVE_DESTINATION_GUIDELINE,
|
|
612
|
-
"Use when the user asks to run an existing scheduled task now; do not rewrite the stored calendar cadence.",
|
|
613
|
-
],
|
|
572
|
+
"Queue an existing active scheduled Junior task to run as soon as possible, without changing its cadence. Use when the user asks to run an existing scheduled task now. Use only task IDs returned for this destination.",
|
|
614
573
|
inputSchema: Type.Object({
|
|
615
|
-
task_id: Type.String({ minLength: 1 }),
|
|
574
|
+
task_id: Type.String({ minLength: 1, description: "ID of the active task to run now. Must be from this active Slack destination." }),
|
|
616
575
|
}),
|
|
617
576
|
execute: async ({ task_id }) => {
|
|
618
577
|
const lookup = await getWritableTask({ context, taskId: task_id });
|