@sentry/junior-scheduler 0.107.1 → 0.108.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 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
- - Schedule parsing normalizes calendar intent before storage; execution does not
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 { ScheduledCalendarFrequency, ScheduledTask, ScheduledTaskRecurrence } from "./types";
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
- /** Build a calendar recurrence anchored to an exact first run timestamp. */
16
- export declare function buildCalendarRecurrence(args: {
17
- frequency: ScheduledCalendarFrequency;
18
- interval?: number;
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
- weekdays?: number[];
22
- }): ScheduledTaskRecurrence;
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;