1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Scheduled jobs — escrow-backed recurring agent runs (ScheduleFacet).
//!
//! The admin schedule UI was removed; what remains is the escrow core the
//! `schedule_task` chat tool reuses: parse a cadence + submit a `scheduleJob`.
/// ScheduleFacet's on-chain minimum cadence (mirrors the CLI's
/// `SCHEDULE_MIN_INTERVAL_SECS`). The facet rejects anything faster.
const SCHEDULE_MIN_INTERVAL_SECS: u64 = 60;
/// Parse a human cadence (`60s` / `5m` / `1h`, bare number = seconds) into
/// seconds, enforcing the 60s floor. Mirrors the CLI's `parse_interval`
/// EXACTLY so the browser + CLI accept the same strings. `None` on garbage
/// or sub-minimum (handled by a silent no-op — no explanatory-validation).
pub
// The on-chain escrow submit/cancel core (`submit_schedule_job` /
// `cancel_schedule_job` over ScheduleFacet `scheduleJob`/`cancelJob`) was
// REMOVED: scheduling moved OFF-CHAIN. `scheduleJob` cost ~2.88M sponsored gas +
// locked refundable `$LH` per job — absurd for the common case (a one-shot
// reminder). The `schedule_task`/`cancel_task` chat tools now POST the proxy's
// `/api/schedule` (GitHub store, no gas/escrow) via
// `registry::{create_offchain_job, cancel_offchain_job}`. Only
// `parse_schedule_interval` (the shared cadence parser) lives on here.