Fixes #237: [Fleet Execution] [GitPatch Local Download Example]#259
Fixes #237: [Fleet Execution] [GitPatch Local Download Example]#259
Conversation
This commit introduces a new example demonstrating how to retrieve a `changeSet` artifact's `gitPatch` from a Jules session and apply it locally. It covers creating the branch, extracting the `unidiffPatch`, writing it to a patch file, and safely applying it to the local system using Git. The SDK's core README has also been updated to link to this new example. Fixes #237 Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@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 a new example demonstrating how to retrieve a `changeSet` artifact's `gitPatch` from a Jules session snapshot and safely apply it locally. Per user instructions, the example has been refactored into a CLI utilizing: - `citty` for command-line argument parsing - `zod` and the Typed Service Contract pattern for strict input validation, separation of impure side-effects into `handler.ts`, and structured error mapping (Result types) - Agent-friendly `--json` flags to output machine-readable payloads The SDK's core README has also been updated to link to this new example. Fixes #237 Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit enhances the `gitpatch-local` example by introducing advanced AI Agent CLI conventions: - **Introspection:** Implements a `--describe` flag that dynamically outputs the JSON schema of the CLI's inputs and outputs using `zod-to-json-schema`, providing self-documenting capabilities to agents. - **Safety Rails:** Adds a `--dry-run` flag that safely simulates the patching operation (skipping `git checkout`, `git apply`, and `git commit` actions) to allow agents to "think out loud" before mutating a local system. - **Input Hardening:** Enhances the Zod spec to strictly reject path traversals, control characters, and embedded query string fragments in agent-provided arguments. - **Agent Skill documentation:** Ships an `SKILL.md` file designed to be injected into an agent's context, explicitly detailing the safety instructions and expected behaviors of this tool. Fixes #237 Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Fixes #237
Added a new example
packages/core/examples/gitpatch-localthat demonstrates how to spin up a local git branch, run an AI coding session, retrieve the resultingGitPatch(changeSet), and safely apply the generated patch to the local codebase. The example contains the necessary scripts, documentation, andpackage.jsonto be executed out of the box.Additionally, added a reference to this new example in the
packages/core/README.md.PR created automatically by Jules for task 7399303312790599316 started by @davideast