@qilin-agent/schedule 3.1.7 → 3.1.9
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.i18n.yaml +72 -39
- package/README.md +180 -56
- package/README.zh.md +185 -61
- package/lib/index.js +5565 -1191
- package/lib/typert.host.js +1886 -267
- package/lib/typert.remote-client.d.ts +22 -10
- package/lib/typert.remote-client.js +1727 -190
- package/lib/types/delivery-history.d.ts +4 -6
- package/lib/types/delivery-history.js +7 -20
- package/lib/types/domain.d.ts +117 -80
- package/lib/types/domain.js +311 -797
- package/lib/types/index.d.ts +168 -80
- package/lib/types/index.js +531 -222
- package/lib/types/runtime.d.ts +92 -4
- package/lib/types/runtime.js +392 -72
- package/lib/types/storage.d.ts +126 -24
- package/lib/types/storage.js +85 -16
- package/lib/types/types.d.ts +287 -148
- package/lib/types/types.js +1 -1
- package/lib/types/update.d.ts +16 -21
- package/lib/types/update.js +72 -144
- package/package.json +38 -35
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
/** Saved delivery
|
|
1
|
+
/** Saved delivery retention and identity-based pagination without Session reads. */
|
|
2
2
|
import type { ScheduleTask } from './storage.ts';
|
|
3
3
|
import type { DeliveryRetentionBounds, ScheduleDeliveryHistoryRequest, ScheduleDeliveryHistoryResult, ScheduleDeliveryReceipt } from './types.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Prepare one real inbox acknowledgment for the same task write as its status and target.
|
|
6
|
-
* Prunes to the configured window and record cap here, on the only write path
|
|
7
|
-
*
|
|
8
|
-
* grow that document with every acknowledgment. The read path states no bound of
|
|
9
|
-
* its own, because a whole-unit document over the schema's limits refuses to open.
|
|
6
|
+
* Prunes to the configured window and record cap here, on the only write path, so a task record does not grow
|
|
7
|
+
* with every acknowledgment.
|
|
10
8
|
* @param task - Task supplying the immutable sent prompt and retained history.
|
|
11
9
|
* @param receipt - Acknowledgment obtained after successful Session flush.
|
|
12
10
|
* @param bounds - Configured retention window and record cap for the appended history.
|
|
@@ -15,7 +13,7 @@ import type { DeliveryRetentionBounds, ScheduleDeliveryHistoryRequest, ScheduleD
|
|
|
15
13
|
export declare function appendDelivery(task: ScheduleTask, receipt: ScheduleDeliveryReceipt, bounds: DeliveryRetentionBounds): Required<Pick<ScheduleTask, 'lastDelivery' | 'deliveryHistory'>>;
|
|
16
14
|
/**
|
|
17
15
|
* Read one newest-first page in append order, independent of wall-clock ordering.
|
|
18
|
-
* @param task - Task already
|
|
16
|
+
* @param task - Task already selected by the caller.
|
|
19
17
|
* @param request - Validated explicit page size and optional exclusive message cursor.
|
|
20
18
|
* @param retention - Current configured limits shared with the delivery writer.
|
|
21
19
|
* @returns Copied delivery records or a cursor-not-found result.
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
/** Milliseconds in one day, the unit the retention window is stated in. */
|
|
2
2
|
const DAY_MS = 86_400_000;
|
|
3
|
-
/**
|
|
4
|
-
* Read retained history; missing history exposes only the actual legacy receipt.
|
|
5
|
-
* @param task - Immutable stored task.
|
|
6
|
-
* @returns Oldest-first retained deliveries without changing storage.
|
|
7
|
-
*/
|
|
8
|
-
function deliveryHistoryOf(task) {
|
|
9
|
-
return task.deliveryHistory ?? {
|
|
10
|
-
records: task.lastDelivery === undefined ? [] : [task.lastDelivery],
|
|
11
|
-
earlierRecordsUnavailable: true,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
3
|
/**
|
|
15
4
|
* Prepare one real inbox acknowledgment for the same task write as its status and target.
|
|
16
|
-
* Prunes to the configured window and record cap here, on the only write path
|
|
17
|
-
*
|
|
18
|
-
* grow that document with every acknowledgment. The read path states no bound of
|
|
19
|
-
* its own, because a whole-unit document over the schema's limits refuses to open.
|
|
5
|
+
* Prunes to the configured window and record cap here, on the only write path, so a task record does not grow
|
|
6
|
+
* with every acknowledgment.
|
|
20
7
|
* @param task - Task supplying the immutable sent prompt and retained history.
|
|
21
8
|
* @param receipt - Acknowledgment obtained after successful Session flush.
|
|
22
9
|
* @param bounds - Configured retention window and record cap for the appended history.
|
|
23
10
|
* @returns Receipt and retained history; the caller publishes them only after task persistence.
|
|
24
11
|
*/
|
|
25
12
|
export function appendDelivery(task, receipt, bounds) {
|
|
26
|
-
const history =
|
|
13
|
+
const history = task.deliveryHistory;
|
|
27
14
|
const appended = [...history.records, { ...receipt, prompt: task.record.prompt }];
|
|
28
15
|
const floor = Date.parse(receipt.deliveredAt) - bounds.days * DAY_MS;
|
|
29
16
|
const retained = appended
|
|
@@ -34,19 +21,19 @@ export function appendDelivery(task, receipt, bounds) {
|
|
|
34
21
|
deliveryHistory: {
|
|
35
22
|
records: retained,
|
|
36
23
|
earlierRecordsUnavailable: history.earlierRecordsUnavailable || retained.length !== appended.length,
|
|
37
|
-
earlierRecordsPruned: history.earlierRecordsPruned
|
|
24
|
+
earlierRecordsPruned: history.earlierRecordsPruned || retained.length !== appended.length,
|
|
38
25
|
},
|
|
39
26
|
};
|
|
40
27
|
}
|
|
41
28
|
/**
|
|
42
29
|
* Read one newest-first page in append order, independent of wall-clock ordering.
|
|
43
|
-
* @param task - Task already
|
|
30
|
+
* @param task - Task already selected by the caller.
|
|
44
31
|
* @param request - Validated explicit page size and optional exclusive message cursor.
|
|
45
32
|
* @param retention - Current configured limits shared with the delivery writer.
|
|
46
33
|
* @returns Copied delivery records or a cursor-not-found result.
|
|
47
34
|
*/
|
|
48
35
|
export function deliveryHistoryPage(task, request, retention) {
|
|
49
|
-
const history =
|
|
36
|
+
const history = task.deliveryHistory;
|
|
50
37
|
const end = request.before === undefined
|
|
51
38
|
? history.records.length
|
|
52
39
|
: history.records.findIndex(record => record.messageId === request.before);
|
|
@@ -59,7 +46,7 @@ export function deliveryHistoryPage(task, request, retention) {
|
|
|
59
46
|
const oldest = records.at(-1);
|
|
60
47
|
return {
|
|
61
48
|
id: request.id, records, earlierRecordsUnavailable: history.earlierRecordsUnavailable,
|
|
62
|
-
earlierRecordsPruned: history.earlierRecordsPruned
|
|
49
|
+
earlierRecordsPruned: history.earlierRecordsPruned, retention: { ...retention },
|
|
63
50
|
...(oldest !== undefined && start > 0 ? { nextBefore: oldest.messageId } : {}),
|
|
64
51
|
};
|
|
65
52
|
}
|
package/lib/types/domain.d.ts
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Host task decoding, timing validation, occurrence selection, and reminder framing.
|
|
3
3
|
* @module @qilin-agent/schedule
|
|
4
4
|
*/
|
|
5
5
|
import { Temporal } from '@js-temporal/polyfill';
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
/**
|
|
9
|
-
export declare const SCHEDULE_CHANGE_VERSION: 1;
|
|
10
|
-
/** Fixed v1 lower bound for a fixed-rate reminder. */
|
|
6
|
+
import type { AfterScheduleRecord, AtInput, AtScheduleRecord, EveryScheduleRecord, CronInput, CronScheduleRecord, DailyInput, DailyScheduleRecord, WeeklyInput, WeeklyScheduleRecord, RecurringScheduleRecord, ScheduleId as ScheduleIdType, ScheduleInputErrorCode } from './types.ts';
|
|
7
|
+
import type { ScheduleRecord, RRuleScheduleRecord } from './types.ts';
|
|
8
|
+
/** Minimum supported fixed-rate interval. */
|
|
11
9
|
export declare const MIN_EVERY_INTERVAL_SECONDS = 60;
|
|
12
|
-
/**
|
|
10
|
+
/** Maximum stored task title length. */
|
|
13
11
|
export declare const MAX_TITLE_LENGTH = 120;
|
|
14
|
-
/**
|
|
15
|
-
* Longest forward or backward walk of the cron date search, in years.
|
|
16
|
-
*
|
|
17
|
-
* The proleptic Gregorian leap-year and weekday alignment repeats every 400
|
|
18
|
-
* years, so a rule that matches any local date has a match within this window;
|
|
19
|
-
* walking further can only reach a rule that never matches. Bounding the walk
|
|
20
|
-
* keeps a valid but unsatisfiable rule's creation and decision cost fixed
|
|
21
|
-
* instead of enumerating candidate dates toward the four-digit-year ceiling.
|
|
22
|
-
*/
|
|
23
|
-
export declare const CRON_SEARCH_HORIZON_YEARS = 400;
|
|
24
12
|
/** Error from malformed or transition-invalid durable Schedule data. */
|
|
25
13
|
export declare class ScheduleLogError extends Error {
|
|
26
14
|
/** Stable machine-readable error code. */
|
|
@@ -34,21 +22,14 @@ export declare class ScheduleLogError extends Error {
|
|
|
34
22
|
/** Error from a model-supplied Schedule rule or target Session that cannot become a record. */
|
|
35
23
|
export declare class ScheduleInputError extends Error {
|
|
36
24
|
/** Stable public Schedule input code. */
|
|
37
|
-
readonly code:
|
|
25
|
+
readonly code: ScheduleInputErrorCode;
|
|
38
26
|
/**
|
|
39
27
|
* Construct a stable input failure.
|
|
40
28
|
* @param code - Public Schedule error discriminator.
|
|
41
29
|
* @param message - Stable public diagnostic.
|
|
42
30
|
* @param options - Optional contained implementation cause.
|
|
43
31
|
*/
|
|
44
|
-
constructor(code:
|
|
45
|
-
}
|
|
46
|
-
/** Pure replay result, retaining active create order and every used id. */
|
|
47
|
-
export interface FoldedSchedules {
|
|
48
|
-
/** Active records in their original create order. */
|
|
49
|
-
readonly active: readonly LegacyScheduleRecord[];
|
|
50
|
-
/** Every id ever created in this session-local suffix. */
|
|
51
|
-
readonly seenIds: readonly ScheduleIdType[];
|
|
32
|
+
constructor(code: ScheduleInputErrorCode, message: string, options?: ErrorOptions);
|
|
52
33
|
}
|
|
53
34
|
/** One latest-only recurring decision derived without enumerating a backlog. */
|
|
54
35
|
export interface RecurringOccurrence {
|
|
@@ -58,11 +39,24 @@ export interface RecurringOccurrence {
|
|
|
58
39
|
readonly nextScheduledAt?: string;
|
|
59
40
|
}
|
|
60
41
|
/**
|
|
61
|
-
* Brand a raw
|
|
62
|
-
* @param value - Raw
|
|
42
|
+
* Brand a raw task id without changing its runtime value.
|
|
43
|
+
* @param value - Raw task id.
|
|
63
44
|
* @returns The same string with the Schedule brand.
|
|
64
45
|
*/
|
|
65
46
|
export declare function ScheduleId(value: string): ScheduleIdType;
|
|
47
|
+
/**
|
|
48
|
+
* Narrow an unknown value to a non-array object.
|
|
49
|
+
* @param value - Value to inspect.
|
|
50
|
+
* @returns Whether the value is a non-null, non-array object.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* Require exactly the named durable object keys.
|
|
55
|
+
* @param value - Object to inspect.
|
|
56
|
+
* @param expected - Complete allowed key set.
|
|
57
|
+
* @returns Whether every expected key is present and no other key is present.
|
|
58
|
+
*/
|
|
59
|
+
export declare function hasExactKeys(value: Record<string, unknown>, expected: readonly string[]): boolean;
|
|
66
60
|
/** Stable diagnostic for a title that is missing or empty after trimming. */
|
|
67
61
|
export declare const REQUIRED_TITLE_MESSAGE = "title is required and must be non-empty after trimming.";
|
|
68
62
|
/**
|
|
@@ -84,12 +78,31 @@ export declare function scheduleTitle(title: string): string;
|
|
|
84
78
|
* @returns The stored title; an invalid title throws ScheduleLogError.
|
|
85
79
|
*/
|
|
86
80
|
export declare function decodeStoredTitle(value: unknown): string;
|
|
81
|
+
/**
|
|
82
|
+
* Validate one stable task id at the durable boundary.
|
|
83
|
+
* @param value - Untrusted durable id field.
|
|
84
|
+
* @returns The branded id; an invalid id throws ScheduleLogError.
|
|
85
|
+
*/
|
|
86
|
+
export declare function decodeId(value: unknown): ScheduleIdType;
|
|
87
|
+
/**
|
|
88
|
+
* Validate one canonical four-digit-year UTC instant at the durable boundary.
|
|
89
|
+
* @param value - Untrusted durable instant field.
|
|
90
|
+
* @returns The canonical instant; an invalid instant throws ScheduleLogError.
|
|
91
|
+
*/
|
|
92
|
+
export declare function decodeInstant(value: unknown): string;
|
|
87
93
|
/**
|
|
88
94
|
* Validate and canonicalize one raw IANA time-zone selector.
|
|
89
95
|
* @param value - Candidate `UTC` or IANA Area/Location name.
|
|
90
96
|
* @returns The runtime's canonical IANA name.
|
|
91
97
|
*/
|
|
92
98
|
export declare function canonicalizeTimeZone(value: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Require a safe, representable, strictly future UTC target.
|
|
101
|
+
* @param epoch - Candidate target in epoch milliseconds.
|
|
102
|
+
* @param now - Exclusive lower bound in epoch milliseconds.
|
|
103
|
+
* @returns The canonical UTC instant; an out-of-range or past target throws ScheduleInputError.
|
|
104
|
+
*/
|
|
105
|
+
export declare function futureInstant(epoch: number, now: number): string;
|
|
93
106
|
/**
|
|
94
107
|
* Parse one strict local clock time accepted by the weekly selector.
|
|
95
108
|
* @param value - Candidate `HH:mm:ss` time with optional one-to-three fractional digits.
|
|
@@ -103,20 +116,11 @@ export declare function weeklyTime(value: string): Temporal.PlainTime;
|
|
|
103
116
|
*/
|
|
104
117
|
export declare function normalizeWeekdays(weekdays: unknown): number[];
|
|
105
118
|
/**
|
|
106
|
-
* Decode
|
|
107
|
-
*
|
|
108
|
-
* Every variant of a stored Host task carries its title, so the historical
|
|
109
|
-
* one-shot variants are re-checked for that member after their shape decodes.
|
|
119
|
+
* Decode one of the seven current Host timing records without recomputing its committed occurrence.
|
|
110
120
|
* @param value - Untrusted durable JSON record.
|
|
111
|
-
* @returns Detached frozen record
|
|
121
|
+
* @returns Detached frozen record with its required title and authoritative timing fields.
|
|
112
122
|
*/
|
|
113
123
|
export declare function decodeScheduleRecord(value: unknown): ScheduleRecord;
|
|
114
|
-
/**
|
|
115
|
-
* Decode one strict version-1 `schedule/change` payload.
|
|
116
|
-
* @param value - Untrusted durable JSON value.
|
|
117
|
-
* @returns Detached, frozen Schedule change.
|
|
118
|
-
*/
|
|
119
|
-
export declare function decodeScheduleChange(value: unknown): ScheduleChange;
|
|
120
124
|
/** Timing fields one fixed-rate decision needs from its record. */
|
|
121
125
|
type EveryOccurrenceInput = Pick<EveryScheduleRecord, 'everySeconds' | 'scheduledAt'>;
|
|
122
126
|
/**
|
|
@@ -126,6 +130,13 @@ type EveryOccurrenceInput = Pick<EveryScheduleRecord, 'everySeconds' | 'schedule
|
|
|
126
130
|
* @returns The latest due occurrence and first strictly future target, if representable.
|
|
127
131
|
*/
|
|
128
132
|
export declare function resolveEveryOccurrence(record: EveryOccurrenceInput, acceptedAt: number): RecurringOccurrence;
|
|
133
|
+
/**
|
|
134
|
+
* Resolve a wall-clock rule only when its decision is at a representable four-digit-year instant.
|
|
135
|
+
* @param selector - Rule kind named in the failure message.
|
|
136
|
+
* @param acceptedAt - Explicit wall-clock decision time in epoch milliseconds.
|
|
137
|
+
* @returns The validated decision time.
|
|
138
|
+
*/
|
|
139
|
+
export declare function acceptedDecision(selector: string, acceptedAt: number): number;
|
|
129
140
|
/**
|
|
130
141
|
* Resolve a daily decision near the decision's local date, not across its missed history.
|
|
131
142
|
* @param record - Daily rule with a committed earliest unaccepted UTC target.
|
|
@@ -141,10 +152,10 @@ export declare function resolveDailyOccurrence(record: DailyScheduleRecord, acce
|
|
|
141
152
|
*/
|
|
142
153
|
export declare function resolveWeeklyOccurrence(record: WeeklyScheduleRecord, acceptedAt: number): RecurringOccurrence;
|
|
143
154
|
/**
|
|
144
|
-
* Resolve a
|
|
145
|
-
* @param record - Cron
|
|
146
|
-
* @param acceptedAt -
|
|
147
|
-
* @returns
|
|
155
|
+
* Resolve a Cron rule through the shared bounded recurrence engine.
|
|
156
|
+
* @param record - Authoritative Cron expression, zone, and committed occurrence.
|
|
157
|
+
* @param acceptedAt - Decision time at or after the committed occurrence.
|
|
158
|
+
* @returns The latest due occurrence and optional future successor.
|
|
148
159
|
*/
|
|
149
160
|
export declare function resolveCronOccurrence(record: CronScheduleRecord, acceptedAt: number): RecurringOccurrence;
|
|
150
161
|
/**
|
|
@@ -160,29 +171,6 @@ export declare function isRecurringScheduleRecord(record: ScheduleRecord): recor
|
|
|
160
171
|
* @returns Latest due occurrence and optional future target.
|
|
161
172
|
*/
|
|
162
173
|
export declare function resolveRecurringOccurrence(record: RecurringScheduleRecord, acceptedAt: number): RecurringOccurrence;
|
|
163
|
-
/**
|
|
164
|
-
* Apply already-decoded Schedule changes to one complete fold value.
|
|
165
|
-
*
|
|
166
|
-
* The transition authority for full-log replay. One mutable Map/Set pair spans
|
|
167
|
-
* the whole batch; the returned arrays are materialized and frozen once.
|
|
168
|
-
* @param folded - complete active records and used-id history before the changes.
|
|
169
|
-
* @param changes - strictly decoded durable mutations in log order.
|
|
170
|
-
* @returns the complete fold value after every mutation.
|
|
171
|
-
*/
|
|
172
|
-
export declare function applyScheduleChanges(folded: FoldedSchedules, changes: Iterable<ScheduleChange>): FoldedSchedules;
|
|
173
|
-
/**
|
|
174
|
-
* Fold the package-owned stream after the durable fork seed boundary.
|
|
175
|
-
* @param events - Complete ordered session log or candidate-extended log.
|
|
176
|
-
* @param inheritedEventCount - Inherited prefix length excluded from child ownership.
|
|
177
|
-
* @returns Active records and all previously used ids.
|
|
178
|
-
*/
|
|
179
|
-
export declare function foldScheduleEvents(events: readonly SessionEvent[], inheritedEventCount?: SessionLogOffsetType): FoldedSchedules;
|
|
180
|
-
/**
|
|
181
|
-
* Allocate the next readable id without reusing any prior session-local id.
|
|
182
|
-
* @param folded - Fold containing every previously created id.
|
|
183
|
-
* @returns A fresh `schedule-N` identity.
|
|
184
|
-
*/
|
|
185
|
-
export declare function allocateScheduleId(folded: FoldedSchedules): ScheduleIdType;
|
|
186
174
|
/**
|
|
187
175
|
* Validate a model after rule and compute its durable target.
|
|
188
176
|
* @param id - Already allocated task id.
|
|
@@ -269,9 +257,9 @@ export declare function parseWeeklyInput(weekly: WeeklyInput): {
|
|
|
269
257
|
readonly weekdays: number[];
|
|
270
258
|
};
|
|
271
259
|
/**
|
|
272
|
-
* Canonicalize one
|
|
273
|
-
* @param expression -
|
|
274
|
-
* @returns
|
|
260
|
+
* Canonicalize one supported five-field Cron expression.
|
|
261
|
+
* @param expression - Strict five-field input text.
|
|
262
|
+
* @returns Canonical text preserving the Vixie day-matching semantics.
|
|
275
263
|
*/
|
|
276
264
|
export declare function canonicalizeCronExpression(expression: string): string;
|
|
277
265
|
/**
|
|
@@ -284,26 +272,75 @@ export declare function parseCronInput(cron: CronInput): {
|
|
|
284
272
|
readonly timeZone: string;
|
|
285
273
|
};
|
|
286
274
|
/**
|
|
287
|
-
*
|
|
288
|
-
* @param record -
|
|
289
|
-
* @param now - Wall-clock sample used for its timing state.
|
|
290
|
-
* @returns Complete Host delivery view.
|
|
291
|
-
*/
|
|
292
|
-
export declare function scheduleView(record: ScheduleRecord, now: number): ScheduleView;
|
|
293
|
-
/**
|
|
294
|
-
* Render the fixed model framing for a due reminder.
|
|
295
|
-
* @param record - Due active record.
|
|
275
|
+
* Render the fixed model framing for one due reminder.
|
|
276
|
+
* @param record - Due task identity, instruction, and delivered occurrence.
|
|
296
277
|
* @returns Stable model-visible text with JSON-escaped dynamic fields.
|
|
297
278
|
*/
|
|
298
|
-
export declare function renderReminderFraming(record:
|
|
279
|
+
export declare function renderReminderFraming(record: {
|
|
280
|
+
readonly id: ScheduleIdType;
|
|
281
|
+
readonly prompt: string;
|
|
282
|
+
readonly scheduledAt: string;
|
|
283
|
+
}): string;
|
|
299
284
|
/**
|
|
300
285
|
* Render one recurring reminder batch in the supplied order.
|
|
301
286
|
* @param reminders - Complete admitted batch with one latest occurrence per record.
|
|
302
287
|
* @returns Stable model-visible text whose dynamic payload is canonical JSON.
|
|
303
288
|
*/
|
|
304
289
|
export declare function renderRecurringReminderBatchFraming(reminders: readonly {
|
|
305
|
-
readonly record:
|
|
290
|
+
readonly record: {
|
|
291
|
+
readonly id: ScheduleIdType;
|
|
292
|
+
readonly prompt: string;
|
|
293
|
+
};
|
|
306
294
|
readonly occurrenceAt: string;
|
|
307
295
|
}[]): string;
|
|
296
|
+
/**
|
|
297
|
+
* Validate and normalize the supported RFC 5545 recurrence content.
|
|
298
|
+
* @param value - Two-line DTSTART and RRULE input.
|
|
299
|
+
* @returns The trimmed newline-separated recurrence; an unsupported rule throws ScheduleInputError.
|
|
300
|
+
*/
|
|
301
|
+
export declare function normalizeRRule(value: string): string;
|
|
302
|
+
/**
|
|
303
|
+
* Create one Host task record with its first committed occurrence.
|
|
304
|
+
* @param id - Host-allocated canonical schedule id.
|
|
305
|
+
* @param title - User-facing schedule title.
|
|
306
|
+
* @param prompt - Instruction delivered when the schedule fires.
|
|
307
|
+
* @param rrule - DTSTART and RRULE content.
|
|
308
|
+
* @param now - Exclusive creation-time lower bound in epoch milliseconds.
|
|
309
|
+
* @returns Frozen schedule record.
|
|
310
|
+
*/
|
|
311
|
+
export declare function createRRuleScheduleRecord(id: ScheduleIdType, title: string, prompt: string, rrule: string, now: number): RRuleScheduleRecord;
|
|
312
|
+
/**
|
|
313
|
+
* Update descriptive fields and optionally recompute the next occurrence.
|
|
314
|
+
* @param current - Existing schedule record.
|
|
315
|
+
* @param change - Supplied editable record fields.
|
|
316
|
+
* @param now - Exclusive edit-time lower bound in epoch milliseconds.
|
|
317
|
+
* @param recompute - Whether to derive a fresh next occurrence.
|
|
318
|
+
* @returns Frozen updated schedule record.
|
|
319
|
+
*/
|
|
320
|
+
export declare function updateRRuleScheduleRecord(current: RRuleScheduleRecord, change: {
|
|
321
|
+
readonly title?: string;
|
|
322
|
+
readonly prompt?: string;
|
|
323
|
+
readonly rrule?: string;
|
|
324
|
+
}, now: number, recompute: boolean): RRuleScheduleRecord;
|
|
325
|
+
/**
|
|
326
|
+
* Resolve the latest due occurrence and the first later occurrence without replaying a backlog.
|
|
327
|
+
* @param record - Due schedule record.
|
|
328
|
+
* @param acceptedAt - Dispatch admission time in epoch milliseconds.
|
|
329
|
+
* @returns Latest due occurrence and optional next occurrence.
|
|
330
|
+
*/
|
|
331
|
+
export declare function resolveRRuleOccurrence(record: RRuleScheduleRecord, acceptedAt: number): RecurringOccurrence;
|
|
332
|
+
/**
|
|
333
|
+
* Decode a current Host task record.
|
|
334
|
+
* @param value - Untrusted durable JSON record.
|
|
335
|
+
* @returns Detached frozen record; malformed fields throw ScheduleLogError.
|
|
336
|
+
*/
|
|
337
|
+
export declare function decodeRRuleScheduleRecord(value: unknown): RRuleScheduleRecord;
|
|
338
|
+
/**
|
|
339
|
+
* Render an instant in the authoritative zone of any timing kind; elapsed and absolute rules use UTC.
|
|
340
|
+
* @param record - Timing record that owns the display zone.
|
|
341
|
+
* @param instant - UTC instant to render with second precision.
|
|
342
|
+
* @returns Local ISO date-time with its numeric offset.
|
|
343
|
+
*/
|
|
344
|
+
export declare function formatScheduleLocalTime(record: ScheduleRecord, instant: string): string;
|
|
308
345
|
export {};
|
|
309
346
|
//# sourceMappingURL=domain.d.ts.map
|