Conversation
Added a new practical example to the Jules TypeScript SDK demonstrating how to use the session GitPatch data. The example shows how to use a Repoless session to generate code, extract the resulting GitPatch (either via the changeSet artifact or manually from generated files), and then pass that patch to a second session for reviewing against the original goals and coding standards. - Created `packages/core/examples/gitpatch-goals/index.ts` containing the example logic. - Created `packages/core/examples/gitpatch-goals/README.md` explaining the example. - Created `packages/core/examples/gitpatch-goals/package.json` to configure the workspace module. - Updated `packages/core/README.md` to include a link to the new example. 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. |
Refactored the gitpatch-goals SDK example based on AI Agent DX best practices: - Wrapped the example in the `citty` CLI framework. - Applied the "Typed Service Contract" (Spec and Handler) pattern using Zod schema validation and explicit Result types for deterministic error handling. - Removed reliance on `jules.select()` cache queries, opting instead to extract `changeSet` and `agentMessaged` activities directly from the awaited session snapshot (`session.result()`). - Added a `--json` output flag to cater to agent-first readability. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Split `handler.ts` into discrete modules (`generate.ts`, `patch.ts`, `review.ts`) to avoid merge conflicts and promote code cleanliness. - Implemented real-time progress streaming using `for await (const activity of session.stream())` to provide CLI feedback before sessions complete, rather than waiting entirely on `session.result()`. - Maintained the Typed Service Contract pattern and JSON output formatting. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `--dry-run` to support input validation without executing costly or destructive Jules API mutations. - Added `--describe` using `zod-to-json-schema` to allow agents to introspect the CLI schema dynamically at runtime. - Added `SKILL.md` to document usage guidelines for agents, encouraging context window discipline via `--json` and input hardening via `--dry-run`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Fixes #234
This PR introduces the requested
gitpatch-goalsexample into thepackages/core/examplesdirectory.The new example showcases an advanced agent workflow using the Jules TypeScript SDK:
changeSetartifacts and extracts the raw unified diff (gitPatch.unidiffPatchrepresented here viaartifact.content). If no such artifact is present, it constructs a valid patch manually from thegeneratedFiles().Changes:
packages/core/examples/gitpatch-goals/index.tspackages/core/examples/gitpatch-goals/README.mdpackages/core/examples/gitpatch-goals/package.jsonpackages/core/README.mdto link to the new example.Testing:
bun run index.tswithin the example directory, which successfully initiates the generation and review sequence.npm run test --workspace=@google/jules-sdk) continue to pass.PR created automatically by Jules for task 16639661357293477856 started by @davideast