Conversation
This commit implements the `window.Meta` (MetaScript) runtime for cron job management and expression parsing. Key features: - `Meta.cron.parse()`: Synchronous JS API for calculating next UTC matching time. - `Meta.cron()`: OS-level job registration (crontab on Linux, launchd on macOS, schtasks on Windows). - `Meta.cron.remove()`: Clean removal of registered jobs across platforms. - CLI execution mode: `run` command for executing worker scripts with Cloudflare Workers-compatible `scheduled()` handlers. Implementation details: - Robust cron parser in both C++ and JavaScript. - Security-focused design with shell/Windows argument escaping. - Optimized registration logic to avoid Cartesian expansion of wildcards on macOS and Windows. - Full POSIX compliance for Day-of-Month and Day-of-Week OR logic. - Portable and thread-safe C++ time calculations. - Comprehensive test suite and demonstration examples.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
e7da6b8 to
cbbdee4
Compare
This commit provides a comprehensive MetaScript (window.meta) runtime: - Implement robust, cross-platform OS-level Cron support (Linux, macOS, Windows). - Provide a synchronous JS API for cron parsing and an async API for registration. - Initiate the project as a Bun project named @metascript/runtime. - Draft a build script (scripts/build_metascript.ts) that uses Bun.build to transpile MetaScript and embed it into a C++ host program. - Draft comprehensive SQLite tests using bun:test. Key technical highlights: - Optimized platform-specific cron registration (crontab, launchd, schtasks). - POSIX-compliant cron parsing logic. - Secure shell/Windows argument escaping. - Dynamic module loading for worker scripts.
|
Explain to me the implementation details of bind =>it is not possible to bind globals instead of window? |
The Implementation flow:
Regarding globals instead of |
This commit completes the implementation of the @metascript/runtime: - **MetaScript Runtime**: A C++ wrapper for webview providing OS-level features. - **Cron API**: Synchronous JS parsing and asynchronous OS-level registration (Linux crontab, macOS launchd, Windows Task Scheduler). - **Security**: Robust shell/Windows argument escaping for all OS commands. - **Bun Integration**: Initiated project as @metascript/runtime with bun init. - **Build Tooling**: Drafted scripts/build_metascript.ts using Bun.build to transpile and embed source code into C++ host programs. - **Testing**: Added comprehensive C++ cron parser tests and Bun-based SQLite tests (tests/sqlite.test.ts). - **Documentation/Examples**: Included metascript_cron.cc and worker.ts demo. Addressed PR feedback regarding the implementation details of 'bind' and global objects in WebView.
Implemented the
window.meta(MetaScript) Cron runtime, providing cross-platform OS-level cron job scheduling and parsing.Summary of changes:
metascript/cron_parser.hhfor robust, thread-safe cron parsing.metascript/cron.jsfor synchronous JS cron parsing API.metascript/runtime.hhfor the core MetaScript runtime and platform-specific backends.import()andBlobURLs.metascript/tests/.examples/metascript_cron.cc.CMakeLists.txt.PR created automatically by Jules for task 3096036330859335778 started by @yumin-chen