@sentry/junior-scheduler 0.107.1 → 0.109.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/README.md +10 -1
- package/dist/cadence.d.ts +12 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +553 -524
- package/dist/schedule-intent.d.ts +61 -0
- package/dist/store.d.ts +1 -10
- package/dist/tool-support.d.ts +8 -31
- package/dist/tools/create-task.d.ts +23 -5
- package/dist/tools/update-task.d.ts +23 -4
- package/package.json +2 -2
- package/src/cadence.ts +228 -304
- package/src/index.ts +0 -1
- package/src/plugin.ts +0 -7
- package/src/schedule-intent.ts +372 -0
- package/src/store.ts +35 -94
- package/src/tool-support.ts +25 -143
- package/src/tools/create-task.ts +66 -69
- package/src/tools/update-task.ts +59 -71
package/README.md
CHANGED
|
@@ -9,8 +9,17 @@ Junior's durable agent runtime.
|
|
|
9
9
|
prompt text, timezone-aware schedule, recurrence, credential mode, status, and
|
|
10
10
|
next-run state.
|
|
11
11
|
- SQL schemas and migrations are authoritative for persistence.
|
|
12
|
-
-
|
|
12
|
+
- Model-facing tools accept structured schedule intent. The scheduler resolves
|
|
13
|
+
relative delays and calendar fields against its server clock and timezone,
|
|
14
|
+
computes `nextRunAtMs`, and stores the canonical schedule. Execution does not
|
|
13
15
|
reinterpret the original natural-language request.
|
|
16
|
+
- Relative delays are elapsed durations. Calendar schedules use local wall-clock
|
|
17
|
+
time: nonexistent recurring times are skipped, nonexistent one-off times are
|
|
18
|
+
rejected, and repeated times use their first instant.
|
|
19
|
+
- Multi-week recurrences use Monday-based calendar weeks; `startDate` is the
|
|
20
|
+
lower bound and its containing week is the first active week.
|
|
21
|
+
- Create tool-call identities produce stable task ids so retrying one committed
|
|
22
|
+
tool invocation returns the existing task instead of duplicating it.
|
|
14
23
|
- Updates and deletion invalidate obsolete pending run times.
|
|
15
24
|
|
|
16
25
|
## Dispatch
|
package/dist/cadence.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** Parse an ISO timestamp into a finite Unix timestamp in milliseconds. */
|
|
3
|
-
export declare function parseScheduleTimestamp(value: string): number | undefined;
|
|
1
|
+
import type { ScheduledLocalTime, ScheduledTask, ScheduledTaskRecurrence } from "./types";
|
|
4
2
|
export interface ZonedDateTimeParts {
|
|
5
3
|
day: number;
|
|
6
4
|
hour: number;
|
|
@@ -12,13 +10,17 @@ export interface ZonedDateTimeParts {
|
|
|
12
10
|
}
|
|
13
11
|
/** Resolve a UTC timestamp into calendar parts for a named time zone. */
|
|
14
12
|
export declare function getZonedDateTimeParts(timestampMs: number, timezone: string): ZonedDateTimeParts;
|
|
15
|
-
/**
|
|
16
|
-
export declare function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
nextRunAtMs: number;
|
|
13
|
+
/** Resolve local time, rejecting DST gaps and choosing the earlier instant in a fold. */
|
|
14
|
+
export declare function resolveLocalScheduleAtMs(args: {
|
|
15
|
+
date: string;
|
|
16
|
+
time: ScheduledLocalTime;
|
|
20
17
|
timezone: string;
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
}): number | undefined;
|
|
19
|
+
/** Compute the first recurring calendar occurrence strictly after a timestamp. */
|
|
20
|
+
export declare function getFirstRunAtMs(args: {
|
|
21
|
+
afterMs: number;
|
|
22
|
+
recurrence: ScheduledTaskRecurrence;
|
|
23
|
+
timezone: string;
|
|
24
|
+
}): number | undefined;
|
|
23
25
|
/** Return the next fire time after a completed run, when the task recurs. */
|
|
24
26
|
export declare function getNextRunAtMs(task: ScheduledTask, scheduledForMs: number, afterMs?: number): number | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createSchedulerPlugin, schedulerPlugin } from "./plugin";
|
|
2
2
|
export { createSlackScheduleCreateTaskTool, createSlackScheduleDeleteTaskTool, createSlackScheduleListTasksTool, createSlackScheduleRunTaskNowTool, createSlackScheduleUpdateTaskTool, type SchedulerToolContext, } from "./schedule-tools";
|
|
3
|
-
export { createSchedulerOperationalSqlStore, createSchedulerSqlStore,
|
|
3
|
+
export { createSchedulerOperationalSqlStore, createSchedulerSqlStore, type SchedulerDb, } from "./store";
|
|
4
4
|
export type { ScheduledCalendarFrequency, ScheduledLocalTime, ScheduledRun, ScheduledRunStatus, ScheduledTask, ScheduledTaskConversationAccess, ScheduledTaskExecutionActor, ScheduledTaskPrincipal, ScheduledTaskRecurrence, ScheduledTaskSchedule, ScheduledTaskSpec, ScheduledTaskStatus, } from "./types";
|