Skip to content

Implement window.meta (MetaScript) Runtime#14

Open
yumin-chen wants to merge 1 commit into
masterfrom
feat/meta-runtime-spawn-13188888819980796488
Open

Implement window.meta (MetaScript) Runtime#14
yumin-chen wants to merge 1 commit into
masterfrom
feat/meta-runtime-spawn-13188888819980796488

Conversation

@yumin-chen
Copy link
Copy Markdown
Owner

I have implemented the window.meta (MetaScript) runtime providing spawn, spawnSync, and PTY support.

Key components:

  • C++ MetaRuntime: Manages subprocesses using POSIX fork/exec and GLib for async I/O.
  • Synchronous Bridge: Intercepts window.prompt() in the GTK backend to support synchronous operations like spawnSync.
  • JavaScript Shim: Provides the window.meta API surface, including a Subprocess class with ReadableStream stdout/stderr.
  • PTY Support: Integrated via forkpty for interactive terminal applications.
  • Platform Safety: POSIX-specific code is guarded to ensure the project still compiles on Windows.

Verification:

  • Successfully built the project and the new meta_demo example.
  • All core unit tests pass.
  • Verified meta_demo starts and terminates correctly.

PR created automatically by Jules for task 13188888819980796488 started by @yumin-chen

Introduces the MetaScript runtime (`window.meta`) providing capacity to:
- Spawn child processes asynchronously (`meta.spawn`) with I/O piping.
- Spawn processes synchronously (`meta.spawnSync`) using a prompt-based bridge.
- Support Terminal (PTY) for interactive subprocesses.

Backend implementation using POSIX APIs (fork, exec, pipe, forkpty) and
GLib integration for non-blocking I/O. JS API utilizes ReadableStreams
to match requirements. Includes a comprehensive meta_demo example.
Platform compatibility maintained via #ifndef _WIN32 guards.

Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant