@vite-hub/schedule 0.6.0 → 0.7.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.
Files changed (43) hide show
  1. package/README.md +27 -6
  2. package/dist/cron-D0mqg3ql.js +22 -0
  3. package/dist/definition.d.ts +1 -1
  4. package/dist/definition.js +3 -4
  5. package/dist/{due-D-0trD1g.js → due-DXgXKgzg.js} +1 -1
  6. package/dist/{error-diagnostics-kKXseq8d.js → error-diagnostics-CsiNo_oI.js} +3 -3
  7. package/dist/{error-diagnostics-B1AaIGWP.js → error-diagnostics-KvK9MX6w.js} +14 -2
  8. package/dist/{started-errors-IG9DlT2A.js → execute-DoQC2i_V.js} +7 -34
  9. package/dist/index.d.ts +12 -8
  10. package/dist/index.js +1 -51
  11. package/dist/{kv-storage-hI2IOjb5.d.ts → kv-storage-CKSSQ6Fk.d.ts} +7 -3
  12. package/dist/{kv-storage-Dsr3TL9c.js → kv-storage-CszEkof6.js} +2 -2
  13. package/dist/{operation-definition-CqZkx1Rm.d.ts → operations-Blwi3jQF.d.ts} +1 -0
  14. package/dist/{operations-BTUQeba1.js → operations-CEZCefAG.js} +25 -13
  15. package/dist/operations.d.ts +2 -2
  16. package/dist/operations.js +7 -5
  17. package/dist/os.js +2 -2
  18. package/dist/runtime/console.js +24 -11
  19. package/dist/runtime/kv.d.ts +1 -1
  20. package/dist/runtime/kv.js +1 -1
  21. package/dist/runtime/process.d.ts +1 -1
  22. package/dist/runtime/process.js +14 -16
  23. package/dist/runtime/state.d.ts +1 -1
  24. package/dist/runtime/state.js +1 -1
  25. package/dist/runtime/static.d.ts +1 -1
  26. package/dist/runtime/static.js +2 -2
  27. package/dist/runtime.d.ts +6 -6
  28. package/dist/runtime.js +5 -5
  29. package/dist/{started-B1Se_Iwo.js → started-ClJ5XOWH.js} +48 -9
  30. package/dist/started-errors-DVw5cYHR.js +28 -0
  31. package/dist/{started-Bzvr4t5f.js → started-yb49f37g.js} +6 -4
  32. package/dist/state-CcVY3UzB.js +570 -0
  33. package/dist/{state-BDEDVlyr.d.ts → state-LuEgYpwR.d.ts} +1 -1
  34. package/dist/{static-Bg7Jj92L.js → static--wi-oIIb.js} +7 -5
  35. package/dist/{static-DeRvJqcQ.d.ts → static-BFV4x94g.d.ts} +1 -1
  36. package/dist/{store-CEv3cScg.d.ts → store-TOayO0NL.d.ts} +6 -3
  37. package/dist/{types-DTVPVY5O.d.ts → types-Wllh0U8N.d.ts} +35 -4
  38. package/dist/vite.d.ts +4 -2
  39. package/dist/vite.js +377 -118
  40. package/package.json +10 -4
  41. package/dist/started-name-w6n9uDdt.js +0 -4
  42. package/dist/state-BZLy46UJ.js +0 -427
  43. package/dist/{cron-BT3ef48f.js → cron-imqlBgO-.js} +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/schedule",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Schedule primitives and definition discovery for ViteHub.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -75,16 +75,18 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@valibot/to-json-schema": "^1.8.0",
78
- "@vite-hub/runtime": "0.6.0",
78
+ "@vite-hub/runtime": "0.7.0",
79
79
  "cron-schedule": "^8.0.1",
80
+ "magic-string": "^1.4.5",
80
81
  "nostics": "1.4.0",
81
82
  "valibot": "^1.5.0"
82
83
  },
83
84
  "devDependencies": {
84
85
  "@types/node": "^24.19.2",
85
86
  "@vite-hub/internal": "0.0.1",
86
- "@vite-hub/kv": "0.6.0",
87
+ "@vite-hub/kv": "0.7.0",
87
88
  "esbuild": "^0.28.2",
89
+ "nitro": "^3.0.261103-rc",
88
90
  "postgres": "^3.4.9",
89
91
  "publint": "^0.3.25",
90
92
  "typescript": "^6.0.3",
@@ -93,13 +95,17 @@
93
95
  "vitest": "5.1.0"
94
96
  },
95
97
  "peerDependencies": {
96
- "@vite-hub/kv": "0.6.0",
98
+ "@vite-hub/kv": "0.7.0",
99
+ "nitro": "3.0.261102-rc || ^3.0.261103-rc",
97
100
  "vite": ">=8.0.0"
98
101
  },
99
102
  "peerDependenciesMeta": {
100
103
  "@vite-hub/kv": {
101
104
  "optional": true
102
105
  },
106
+ "nitro": {
107
+ "optional": true
108
+ },
103
109
  "vite": {
104
110
  "optional": true
105
111
  }
@@ -1,4 +0,0 @@
1
- // src/runtime/started-name.ts
2
- /** Name of the Schedule that runs due started Schedules each minute. Discovery adds it when a Definition has no `cron`. */
3
- const startedSchedulesTickName = "vitehub/started-schedules";
4
- export { startedSchedulesTickName as t };
@@ -1,427 +0,0 @@
1
- import { t as scheduleErrorDiagnostics } from "./error-diagnostics-B1AaIGWP.js";
2
- import { n as isRecordOrFunction } from "./object-CAK6UYR5.js";
3
- import { AsyncLocalStorage } from "node:async_hooks";
4
- // src/runtime/store.ts
5
- function trimPrefix(prefix) {
6
- return prefix.replace(/^\/+|\/+$/g, "");
7
- }
8
- /**
9
- * Decoded trailing segments of a listed key. Some KV stores, such as unstorage, list keys with `:` instead of `/`.
10
- * Encoded parts contain neither, so both separators are safe to split on.
11
- */
12
- function keySegments(key, count) {
13
- return key.split(/[/:]/).slice(-count).map(decodeURIComponent);
14
- }
15
- function joinKey(prefix, ...parts) {
16
- const base = trimPrefix(prefix);
17
- const suffix = parts.map(encodeURIComponent).join("/");
18
- return base ? `${base}/${suffix}` : suffix;
19
- }
20
- function scheduleRunKey(prefix, id) {
21
- return joinKey(prefix, "schedule-runs", id);
22
- }
23
- function scheduleRunAttemptKey(prefix, id) {
24
- return joinKey(prefix, "schedule-run-attempts", id);
25
- }
26
- function scheduleRunBase(prefix) {
27
- return `${joinKey(prefix, "schedule-runs")}/`;
28
- }
29
- const keyLocks = /* @__PURE__ */ new Map();
30
- async function withKVKeyLock(key, operation) {
31
- const previous = keyLocks.get(key) ?? Promise.resolve();
32
- let release;
33
- const current = new Promise((resolve) => {
34
- release = resolve;
35
- });
36
- const queued = previous.then(() => current, () => current);
37
- keyLocks.set(key, queued);
38
- await previous;
39
- try {
40
- return await operation();
41
- } finally {
42
- release();
43
- if (keyLocks.get(key) === queued) keyLocks.delete(key);
44
- }
45
- }
46
- function cloneScheduleRun(record) {
47
- return {
48
- ...record,
49
- completedAt: record.completedAt ? new Date(record.completedAt) : void 0,
50
- createdAt: new Date(record.createdAt),
51
- error: record.error ? { ...record.error } : void 0,
52
- response: record.response ? structuredClone(record.response) : void 0,
53
- scheduledAt: new Date(record.scheduledAt),
54
- startedAt: record.startedAt ? new Date(record.startedAt) : void 0,
55
- updatedAt: new Date(record.updatedAt)
56
- };
57
- }
58
- function cloneScheduleRunAttempt(record) {
59
- return {
60
- ...record,
61
- completedAt: record.completedAt ? new Date(record.completedAt) : void 0,
62
- createdAt: new Date(record.createdAt),
63
- error: record.error ? { ...record.error } : void 0,
64
- startedAt: new Date(record.startedAt),
65
- updatedAt: new Date(record.updatedAt)
66
- };
67
- }
68
- function serializeScheduleRun(record) {
69
- return {
70
- ...record,
71
- completedAt: record.completedAt?.toISOString(),
72
- createdAt: record.createdAt.toISOString(),
73
- error: record.error ? { ...record.error } : void 0,
74
- response: record.response ? structuredClone(record.response) : void 0,
75
- scheduledAt: record.scheduledAt.toISOString(),
76
- startedAt: record.startedAt?.toISOString(),
77
- updatedAt: record.updatedAt.toISOString()
78
- };
79
- }
80
- function serializeScheduleRunAttempt(record) {
81
- return {
82
- ...record,
83
- completedAt: record.completedAt?.toISOString(),
84
- createdAt: record.createdAt.toISOString(),
85
- error: record.error ? { ...record.error } : void 0,
86
- startedAt: record.startedAt.toISOString(),
87
- updatedAt: record.updatedAt.toISOString()
88
- };
89
- }
90
- function createMemoryScheduleRunStore() {
91
- const runs = /* @__PURE__ */ new Map();
92
- const attempts = /* @__PURE__ */ new Map();
93
- return {
94
- createAttempt(attempt) {
95
- if (attempts.has(attempt.id)) throw scheduleErrorDiagnostics.SCHEDULE_R0030({ message: `Schedule Run Attempt already exists: ${attempt.id}` });
96
- attempts.set(attempt.id, cloneScheduleRunAttempt(attempt));
97
- return cloneScheduleRunAttempt(attempt);
98
- },
99
- createRun(run) {
100
- if (runs.has(run.id)) throw scheduleErrorDiagnostics.SCHEDULE_R0031({ message: `Schedule Run already exists: ${run.id}` });
101
- runs.set(run.id, cloneScheduleRun(run));
102
- return cloneScheduleRun(run);
103
- },
104
- getAttempt(id) {
105
- const attempt = attempts.get(id);
106
- return attempt ? cloneScheduleRunAttempt(attempt) : void 0;
107
- },
108
- getRun(id) {
109
- const run = runs.get(id);
110
- return run ? cloneScheduleRun(run) : void 0;
111
- },
112
- listAttempts(runId) {
113
- return [...attempts.values()].filter((attempt) => attempt.runId === runId).map(cloneScheduleRunAttempt);
114
- },
115
- listRuns(options) {
116
- return selectRuns([...runs.values()], options).map(cloneScheduleRun);
117
- },
118
- updateAttempt(id, patch) {
119
- const existing = attempts.get(id);
120
- if (!existing) return;
121
- const next = cloneScheduleRunAttempt({
122
- ...existing,
123
- ...patch,
124
- updatedAt: patch.updatedAt
125
- });
126
- attempts.set(id, next);
127
- return cloneScheduleRunAttempt(next);
128
- },
129
- updateRun(id, patch) {
130
- const existing = runs.get(id);
131
- if (!existing) return;
132
- const next = cloneScheduleRun({
133
- ...existing,
134
- ...patch,
135
- updatedAt: patch.updatedAt
136
- });
137
- runs.set(id, next);
138
- return cloneScheduleRun(next);
139
- }
140
- };
141
- }
142
- function selectRuns(runs, options = {}) {
143
- const selected = runs.filter((run) => (options.scheduleId === void 0 || run.scheduleId === options.scheduleId) && (options.idPrefix === void 0 || run.id.startsWith(options.idPrefix)));
144
- selected.sort((left, right) => right.scheduledAt.getTime() - left.scheduledAt.getTime());
145
- return options.limit === void 0 ? selected : selected.slice(0, options.limit);
146
- }
147
- function listedKeyId(key) {
148
- try {
149
- return keySegments(key, 1)[0];
150
- } catch {
151
- return;
152
- }
153
- }
154
- async function mapInBatches(items, map) {
155
- const result = [];
156
- for (let offset = 0; offset < items.length; offset += 16) result.push(...await Promise.all(items.slice(offset, offset + 16).map(map)));
157
- return result;
158
- }
159
- function createKVScheduleRunStore(options) {
160
- const prefix = options.prefix ?? "vitehub:schedule";
161
- const store = options.kvStore;
162
- const runIndex = joinKey(prefix, "run-index");
163
- const attemptIndex = joinKey(prefix, "attempt-index");
164
- const upgradeKey = joinKey(prefix, "indexes-v2");
165
- let indexesReady = false;
166
- function writeRunIndex(key, run) {
167
- return store.set(key, {
168
- scheduleId: run.scheduleId,
169
- scheduledAt: new Date(run.scheduledAt).getTime()
170
- });
171
- }
172
- async function ensureIndexes() {
173
- if (indexesReady) return;
174
- await withKVKeyLock(upgradeKey, async () => {
175
- if (indexesReady) return;
176
- if (!await store.has(upgradeKey)) {
177
- await mapInBatches(await store.keys(scheduleRunBase(prefix)), async (key) => {
178
- const id = listedKeyId(key);
179
- if (id === void 0) return;
180
- const indexKey = joinKey(runIndex, id);
181
- if (await store.has(indexKey)) return;
182
- const run = await store.get(key);
183
- if (run) await writeRunIndex(indexKey, run);
184
- });
185
- await mapInBatches(await store.keys(`${joinKey(prefix, "schedule-run-attempts")}/`), async (key) => {
186
- const id = listedKeyId(key);
187
- if (id === void 0) return;
188
- const indexKey = joinKey(attemptIndex, id);
189
- if (await store.has(indexKey)) return;
190
- const attempt = await store.get(key);
191
- if (attempt) await store.set(indexKey, { runId: attempt.runId });
192
- });
193
- await store.set(upgradeKey, true);
194
- }
195
- indexesReady = true;
196
- });
197
- }
198
- async function readSnapshot() {
199
- await ensureIndexes();
200
- const indexed = await mapInBatches(await store.keys(scheduleRunBase(prefix)), async (key) => {
201
- const id = listedKeyId(key);
202
- if (id === void 0) return;
203
- const metadata = await store.get(joinKey(runIndex, id));
204
- if (metadata) return {
205
- id,
206
- key,
207
- ...metadata
208
- };
209
- });
210
- const known = [];
211
- const bySchedule = /* @__PURE__ */ new Map();
212
- for (const entry of indexed) {
213
- if (!entry) continue;
214
- known.push(entry);
215
- const group = bySchedule.get(entry.scheduleId) ?? [];
216
- bySchedule.set(entry.scheduleId, group);
217
- group.push(entry);
218
- }
219
- for (const entries of [known, ...bySchedule.values()]) entries.sort((left, right) => right.scheduledAt - left.scheduledAt);
220
- return {
221
- known,
222
- bySchedule,
223
- recordsByKey: /* @__PURE__ */ new Map()
224
- };
225
- }
226
- async function listRuns(options, snapshot) {
227
- const { recordsByKey } = snapshot;
228
- const known = options.scheduleId === void 0 ? snapshot.known : snapshot.bySchedule.get(options.scheduleId) ?? [];
229
- const matching = options.idPrefix === void 0 ? known : known.filter((entry) => entry.id.startsWith(options.idPrefix));
230
- const records = [];
231
- const selectedKeys = matching.slice(0, options.limit ?? matching.length).map((entry) => entry.key);
232
- for (let index = 0; index < selectedKeys.length; index += 16) {
233
- const batch = await Promise.all(selectedKeys.slice(index, index + 16).map(async (key) => {
234
- if (recordsByKey.has(key)) return recordsByKey.get(key);
235
- const stored = await store.get(key);
236
- const run = stored ? cloneScheduleRun(stored) : void 0;
237
- recordsByKey.set(key, run);
238
- return run;
239
- }));
240
- records.push(...batch.flatMap((run) => run ? [run] : []));
241
- }
242
- return selectRuns(records, options).map(cloneScheduleRun);
243
- }
244
- return {
245
- async createAttempt(attempt) {
246
- const key = scheduleRunAttemptKey(prefix, attempt.id);
247
- return await withKVKeyLock(key, async () => {
248
- if (await store.has(key)) throw scheduleErrorDiagnostics.SCHEDULE_R0032({ message: `Schedule Run Attempt already exists: ${attempt.id}` });
249
- await store.set(joinKey(attemptIndex, attempt.id), { runId: attempt.runId });
250
- await store.set(key, serializeScheduleRunAttempt(attempt));
251
- return cloneScheduleRunAttempt(attempt);
252
- });
253
- },
254
- async createRun(run) {
255
- const key = scheduleRunKey(prefix, run.id);
256
- return await withKVKeyLock(key, async () => {
257
- if (await store.has(key)) throw scheduleErrorDiagnostics.SCHEDULE_R0033({ message: `Schedule Run already exists: ${run.id}` });
258
- await writeRunIndex(joinKey(runIndex, run.id), run);
259
- await store.set(key, serializeScheduleRun(run));
260
- return cloneScheduleRun(run);
261
- });
262
- },
263
- async getAttempt(id) {
264
- const attempt = await store.get(scheduleRunAttemptKey(prefix, id));
265
- return attempt ? cloneScheduleRunAttempt(attempt) : void 0;
266
- },
267
- async getRun(id) {
268
- const run = await store.get(scheduleRunKey(prefix, id));
269
- return run ? cloneScheduleRun(run) : void 0;
270
- },
271
- async listAttempts(runId) {
272
- await ensureIndexes();
273
- return (await mapInBatches(await store.keys(`${attemptIndex}/`), async (key) => {
274
- if ((await store.get(key))?.runId !== runId) return;
275
- const id = listedKeyId(key);
276
- if (id === void 0) return;
277
- const attempt = await store.get(scheduleRunAttemptKey(prefix, id));
278
- if (attempt?.runId === runId) return cloneScheduleRunAttempt(attempt);
279
- })).flatMap((attempt) => attempt ? [attempt] : []);
280
- },
281
- async listRuns(options = {}) {
282
- return listRuns(options, await readSnapshot());
283
- },
284
- async listRunsBatch(options) {
285
- if (!options.length) return [];
286
- const snapshot = await readSnapshot();
287
- const results = [];
288
- for (const query of options) results.push(await listRuns(query, snapshot));
289
- return results;
290
- },
291
- async updateAttempt(id, patch) {
292
- const key = scheduleRunAttemptKey(prefix, id);
293
- return await withKVKeyLock(key, async () => {
294
- const existing = await store.get(key);
295
- if (!existing) return;
296
- const next = cloneScheduleRunAttempt({
297
- ...cloneScheduleRunAttempt(existing),
298
- ...patch,
299
- updatedAt: patch.updatedAt
300
- });
301
- await store.set(key, serializeScheduleRunAttempt(next));
302
- return cloneScheduleRunAttempt(next);
303
- });
304
- },
305
- async updateRun(id, patch) {
306
- const key = scheduleRunKey(prefix, id);
307
- return await withKVKeyLock(key, async () => {
308
- const existing = await store.get(key);
309
- if (!existing) return;
310
- const next = cloneScheduleRun({
311
- ...cloneScheduleRun(existing),
312
- ...patch,
313
- updatedAt: patch.updatedAt
314
- });
315
- await store.set(key, serializeScheduleRun(next));
316
- return cloneScheduleRun(next);
317
- });
318
- }
319
- };
320
- }
321
- // src/runtime/state.ts
322
- let runtimeRegistry;
323
- let hostInventory;
324
- const processDefinitions = /* @__PURE__ */ new Set();
325
- let runtimeRegistryVersion = 0;
326
- let runStore;
327
- let startedRuntime;
328
- let occurrenceClaims;
329
- const loadedRegistryEntries = /* @__PURE__ */ new Map();
330
- const loadingRegistryEntries = /* @__PURE__ */ new Map();
331
- const loadingRegistryStorage = new AsyncLocalStorage();
332
- function isScheduleDefinition(value) {
333
- return isRecordOrFunction(value) && Object.hasOwn(value, "handler") && typeof Reflect.get(value, "handler") === "function";
334
- }
335
- function setScheduleRuntimeRegistry(registry) {
336
- runtimeRegistry = registry;
337
- runtimeRegistryVersion++;
338
- loadedRegistryEntries.clear();
339
- loadingRegistryEntries.clear();
340
- }
341
- function getScheduleRuntimeRegistry() {
342
- return runtimeRegistry;
343
- }
344
- /** Publish only ready runtimes, retaining earlier snapshots until their controllers close. */
345
- function registerProcessScheduleDefinitions(definitions) {
346
- processDefinitions.add(definitions);
347
- return () => {
348
- processDefinitions.delete(definitions);
349
- };
350
- }
351
- function getProcessScheduleDefinitions() {
352
- return [...processDefinitions].at(-1);
353
- }
354
- function setHostScheduleInventory(inventory) {
355
- hostInventory = inventory;
356
- }
357
- function getHostScheduleInventory() {
358
- return hostInventory;
359
- }
360
- function setScheduleRunStore(store) {
361
- runStore = store;
362
- }
363
- function getScheduleRunStore() {
364
- return runStore ??= createMemoryScheduleRunStore();
365
- }
366
- /** Installs the claims that make each occurrence run in one process only. The Process Runtime installs them. */
367
- function setScheduleOccurrenceClaims(claims) {
368
- occurrenceClaims = claims;
369
- }
370
- function getScheduleOccurrenceClaims() {
371
- return occurrenceClaims;
372
- }
373
- function setStartedScheduleRuntime(runtime) {
374
- startedRuntime = runtime;
375
- }
376
- function getStartedScheduleRuntime() {
377
- return startedRuntime;
378
- }
379
- async function loadScheduleDefinition(name) {
380
- const entry = runtimeRegistry && Object.hasOwn(runtimeRegistry, name) ? runtimeRegistry[name] : void 0;
381
- if (typeof entry !== "function") return;
382
- if (loadedRegistryEntries.has(name)) return loadedRegistryEntries.get(name);
383
- const activeLoads = loadingRegistryStorage.getStore();
384
- const inFlightEntry = loadingRegistryEntries.get(name);
385
- if (inFlightEntry) {
386
- if (activeLoads?.has(name)) return void 0;
387
- const loaded = await inFlightEntry.promise;
388
- return inFlightEntry.version === runtimeRegistryVersion ? loaded : void 0;
389
- }
390
- const loadingVersion = runtimeRegistryVersion;
391
- const nextActiveLoads = new Set(activeLoads);
392
- nextActiveLoads.add(name);
393
- const loadingEntry = Promise.resolve().then(() => loadingRegistryStorage.run(nextActiveLoads, async () => {
394
- const loaded = await entry();
395
- if (isScheduleDefinition(loaded)) return loaded;
396
- if (isRecordOrFunction(loaded) && Object.hasOwn(loaded, "default")) {
397
- const definition = Reflect.get(loaded, "default");
398
- if (isScheduleDefinition(definition)) return definition;
399
- }
400
- }));
401
- loadingRegistryEntries.set(name, {
402
- promise: loadingEntry,
403
- version: loadingVersion
404
- });
405
- try {
406
- const loaded = await loadingEntry;
407
- if (loadingVersion === runtimeRegistryVersion) {
408
- loadedRegistryEntries.set(name, loaded);
409
- return loaded;
410
- }
411
- return;
412
- } finally {
413
- if (loadingRegistryEntries.get(name)?.promise === loadingEntry) loadingRegistryEntries.delete(name);
414
- }
415
- }
416
- function resetScheduleRuntime() {
417
- runtimeRegistry = void 0;
418
- hostInventory = void 0;
419
- processDefinitions.clear();
420
- runtimeRegistryVersion++;
421
- runStore = void 0;
422
- startedRuntime = void 0;
423
- occurrenceClaims = void 0;
424
- loadedRegistryEntries.clear();
425
- loadingRegistryEntries.clear();
426
- }
427
- export { joinKey as _, getScheduleRuntimeRegistry as a, registerProcessScheduleDefinitions as c, setScheduleOccurrenceClaims as d, setScheduleRunStore as f, createMemoryScheduleRunStore as g, createKVScheduleRunStore as h, getScheduleRunStore as i, resetScheduleRuntime as l, setStartedScheduleRuntime as m, getProcessScheduleDefinitions as n, getStartedScheduleRuntime as o, setScheduleRuntimeRegistry as p, getScheduleOccurrenceClaims as r, loadScheduleDefinition as s, getHostScheduleInventory as t, setHostScheduleInventory as u, keySegments as v };
@@ -1,5 +1,5 @@
1
- import { defineDiagnostics } from "nostics";
2
1
  import { parseCronExpression } from "cron-schedule";
2
+ import { defineDiagnostics } from "nostics";
3
3
  // ../internal/src/invariant.ts
4
4
  const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
5
5
  docsBase: "https://vitehub.dev/docs/development/diagnostics",