Conversation
This commit introduces a new AlloyScript runtime integrated into the webview library. Key features include: - `window.Alloy.spawn`: Asynchronously spawn subprocesses with stdout/stderr bridged to JS ReadableStreams. - `window.Alloy.spawnSync`: Synchronously spawn processes and capture output. - `window.Alloy.Terminal`: Pseudo-terminal (PTY) support for interactive subprocesses (Linux/macOS). - Inter-Process Communication (IPC) support between the webview and spawned processes. - Thread-safe callbacks and non-blocking I/O for `stdin` writing. - Portable implementation using `posix_spawn` and `poll`. Added an example in `examples/alloy_test.cc` to demonstrate these features. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
|
👋 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. |
This commit introduces the AlloyScript runtime and Shell scripting API integrated into the webview library. Key features include: - `window.Alloy.spawn`: Asynchronously spawn subprocesses with cross-platform support (Win32 & POSIX). - `window.Alloy.$`: A bash-like shell scripting API for JavaScript with support for pipes, redirection placeholders, and secure argument tokenization. - Pseudo-terminal (PTY) support via `window.Alloy.Terminal` (POSIX). - Robust thread safety: background monitoring threads communicate with the main UI thread via safe dispatch mechanisms. - Deadlock-free synchronous execution: uses `poll` to multiplex output reading from subprocesses. - Ordered non-blocking stdin writing: data is queued and written by dedicated worker threads. - Comprehensive JS API: includes fluent methods like `.text()`, `.json()`, `.lines()`, and global configuration for `cwd`, `env`, and error behavior. Added examples `examples/alloy_test.cc` and `examples/alloy_shell_test.cc` to demonstrate the new capabilities. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
This commit completes the AlloyScript runtime integration for the webview library. Key enhancements include: - Native C++ implementations for common shell built-ins (`echo`, `pwd`, `ls`, `cd`, `mkdir`, `rm`, `true`, `false`) to ensure cross-platform consistency and better performance. - Robust shell interpreter supporting pipe chains and quoted/escaped arguments. - Complete cross-platform process management (Win32 & POSIX). - Thread-safe background monitoring with safe dispatch to the UI thread. - Efficient, non-blocking stdin writing via background worker queues. - Comprehensive JavaScript API via `window.Alloy.$`, providing fluent result processing and secure interpolation. Added `examples/alloy_shell_test.cc` to exercise the full suite of new shell features. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
…lt-ins This commit introduces a robust AlloyScript runtime integrated into the webview library, following a host-orchestrator architecture. Key features include: - window.Alloy.spawn (Async) and window.Alloy.spawnSync (Sync) for cross-platform subprocess management (Win32 & POSIX). - window.Alloy.$ shell scripting API with support for pipes, secure argument tokenization, and fluent result processing. - Native C++ implementations of common shell commands (echo, pwd, ls, mkdir, rm, cd, etc.) for cross-platform consistency. - Thread-safe background monitoring with safe dispatch to the UI thread. - Deadlock-free I/O using multiplexed reading and ordered background stdin writing. - PTY support for interactive terminals on POSIX systems. Added comprehensive unit tests in `core/tests/src/alloy_tests.cc` covering: - Shell tokenization (quotes and escapes). - Async spawn with environment variables and custom working directories. - spawnSync with output capturing. - Complex shell pipe chains. Demonstration examples included in `examples/alloy_shell_test.cc`. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
e7da6b8 to
cbbdee4
Compare
…l API This commit finalized the AlloyScript runtime, providing a robust bridge between native C++ capacities and the WebView's JavaScript runtime. Key features: - Complete SQLite driver via `window.Alloy.sqlite.Database`, supporting parameter binding, transactions, and BigInt/Uint8Array conversions. - Bash-like shell scripting API via `window.Alloy.$`, featuring native C++ built-ins for cross-platform consistency and pipe support. - Bun-based build system (`scripts/build.ts`) that transpiles AlloyScript and embeds it into a generated C++ host program. - Comprehensive unit tests using `bun:test` and standard webview unit tests. Added tests: - `tests/alloy.test.ts`: JavaScript-level API tests. - `core/tests/src/alloy_tests.cc`: C++-level runtime integration tests. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
- Implemented cross-platform process spawning (Alloy.spawn/spawnSync) - Added full PTY support with terminal resizing - Integrated native high-performance SQLite3 driver with BigInt support - Added native GUI bridge for GTK/Win32 components (Alloy.gui) - Implemented native C++ shell interpreter for consistent cross-platform pipelines - Added comprehensive unit tests and professional GUI examples - Refined build system and amalgamation script for Alloy components Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
I have implemented 16 UI components in the GTK backend, with 12 of them fully exposed to the JavaScript bridge. I have also added a visually professional dashboard demo in Implemented UI Components
|
- Implemented 16 native UI components in the GTK backend (Window, Button, TextField, TextArea, Label, CheckBox, Switch, Slider, ProgressBar, VStack, HStack, Image, ComboBox, RadioButton, WebView, ScrollView). - Exposed 12 UI components to the JavaScript bridge (`Alloy.gui`). - Added professional GUI examples in `/examples/gui.c` and `/examples/gui.cc`. - Fixed SQLite BigInt round-tripping to maintain 64-bit precision in JS. - Refined thread safety and resource cleanup for background subprocesses. - Verified all core runtime tests and example builds. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
I have significantly refined the native GTK implementation and expanded the JS bridge. I have now implemented 23 UI components and dialogs. Below is the updated status table. alloy:gui Component Implementation Status
Missing Components (Yet to be implemented)
I have also added professional GUI demos in |
- Added `timeout`, `killSignal`, and `maxBuffer` support to `Alloy.spawn/spawnSync`. - Implemented `ListView`, `TreeView`, and `TabView` in the GTK backend. - Fixed environment variable handling for Windows processes. - Refined the JS module loader and bridge method binding. - Improved Windows GUI support with a standard message loop. - Cleaned up build artifacts and fixed dead code in the amalgamation script. - Verified all new features with comprehensive unit tests. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
I have implemented the Cocoa backend stubs in |
… stubs - Implemented ListView, TreeView, and TabView in the GTK backend. - Added comprehensive JS bindings for all implemented GUI components (25+ components/dialogs). - Added Cocoa backend stubs for macOS support. - Refined Spawn API with timeout, killSignal, and maxBuffer support. - Improved C/C++ examples to showcase advanced layouts and system dialogs. - Cleaned up build artifacts and ensured C99/C++17 compatibility. - All core unit tests passing. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
|
update examples/gui.ts to support macos |
I have created |
- Created `examples/gui.ts` demonstrating the AlloyScript GUI bridge. - Added platform detection to the GUI example for macOS-specific behavior. - Verified all core runtime tests and example builds. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
I have updated |
- Updated `examples/CMakeLists.txt` to build Alloy GUI C/C++ examples. - Added a custom CMake command to build `gui.ts` using `bun` if available. - Created `examples/gui.ts` demonstrating the JS bridge with platform detection. - Verified the build and core runtime tests. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
…atures - Implemented `Alloy.ArrayBufferSink` for fast incremental binary construction. - Enhanced `Alloy.spawn` with file redirection (`Alloy.file()`) and `ReadableStream` stdin support. - Added support for `timeout`, `killSignal`, and `maxBuffer` in the Spawn API. - Implemented `ListView`, `TreeView`, and `TabView` in the GTK backend. - Added Cocoa backend stubs for macOS support. - Refined C++ runtime with improved polling logic and thread safety. - Verified all features with 12+ unit tests and professional GUI examples. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
I have fixed the crash by adding comprehensive null-checks to all native component setter and layout functions in |
I have now implemented all 28+ core UI components and dialogs across the GTK backend, with full JavaScript bridge support for the most critical ones including Navigation and System Dialogs. |
I have implemented |
I have implemented |
- Implemented `bind_global` in C++ engine and C API for high-privilege system bindings. - Added `secureEval` global function for safe code execution. - Fixed null-dereference crashes in native GUI component handlers. - Expanded GTK backend with 28+ components including Navigation, Dialogs, and advanced widgets (ListView, TreeView, TabView). - Enhanced Spawn API with `timeout`, `killSignal`, and `maxBuffer` support. - Refined JavaScript bridge with a module loader polyfill for seamless `Alloy:*` imports. - Added `examples/gui.ts` with platform detection for macOS support. - Verified all features with an expanded unit test suite (15+ cases) and professional GUI examples. - Cleaned up codebase of build artifacts and redundant logic. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
Understood. I will implement the dual-engine architecture using MicroQuickJS as the primary safe runtime and a hidden WebView for browser-specific capacities. I'll redesign the IPC to be more secure, implement |
I will update the examples to demonstrate the separation between the safe host process and the unsafe WebView process. |
I'll design the ABI so that browser-only capacities are automatically polyfilled and forwarded to the WebView, making it appear seamless to the MicroQuickJS runtime. |
The transpiler will be designed to automatically handle forwarding of browser APIs to the WebView when targeting |
Designed and implemented the AlloyScript runtime for the webview library. The implementation provides a comprehensive
window.AlloyAPI in the JavaScript environment, allowing for powerful subprocess management, PTY terminal interaction, and IPC.Refined the implementation based on code review to ensure:
spawnSyncusingpollfor multiplexed reading.stdinwriting using background threads.PR created automatically by Jules for task 10197739583029115294 started by @yumin-chen