Skip to content

Update examples#282

Merged
davideast merged 7 commits intomainfrom
fix/examples-typescript-and-streaming
Mar 16, 2026
Merged

Update examples#282
davideast merged 7 commits intomainfrom
fix/examples-typescript-and-streaming

Conversation

@davideast
Copy link
Copy Markdown
Collaborator

@davideast davideast commented Mar 16, 2026

Update the majority of SDK examples for code cleanliness and functionality improvements.

Fix 404 bug for streams.

…ility improvements

- Add _shared/check-env.ts, resolve-source.ts, log-stream.ts, run-session.ts
- All examples use stream-first non-blocking patterns (no await session.result())
- logStream() typed handler map replaces switch/if chains
- runRepolessSession() shared helper for google-docs/sheets
- github-actions: marked-based /jules parser with full test suite
- gitpatch-improve: file-based review.md output instead of string appending
- All fail() methods use typed error codes with as const narrowing
- Remove cloudflare-workers and database-triggers examples
- Fix express middleware return path
- mcp-plan-generation: registerTool() replaces deprecated tool()
- cron-jobs: conditional source (repoless when no GITHUB_REPO)
The streaming path (stream() → updates() → rawStream()) was missing the
withFirstRequestRetry wrapper that hydrate() already had. When a session
was freshly created, the first listActivities() call in rawStream() would
fail with 404 before the API was ready, causing the error to propagate
up as an unhandled exception.

Now the first poll in rawStream() uses the same retry logic (5 retries,
exponential backoff starting at 1s) as hydrate().
- Expand tsconfig.json include to cover ../_shared/**/*.ts
- Set rootDir to '..' so tsc can resolve _shared imports
- Add marked dependency to github-actions package.json
- Update bun.lock
- github-action-agentskills: only include check-env.ts (no external deps),
  not the full _shared glob which pulls in files depending on jules-sdk
- github-actions: add paths mapping so tsc resolves @google/jules-sdk from
  the example's node_modules, not from _shared/'s directory
These files reference an 'init' command that doesn't exist in
schema-handler.ts. They were accidentally staged in a previous commit.
@davideast davideast merged commit 4b6ceb2 into main Mar 16, 2026
4 checks passed
@davideast davideast deleted the fix/examples-typescript-and-streaming branch March 16, 2026 15:33
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