@github-tools/sdk 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -141,6 +141,31 @@ Supported override properties:
141
141
 
142
142
  Core properties (`execute`, `inputSchema`, `outputSchema`) cannot be overridden.
143
143
 
144
+ ## Commit Attribution
145
+
146
+ Control how commits are attributed when using `createOrUpdateFile` or `mergePullRequest`:
147
+
148
+ ```ts
149
+ import { createGithubTools } from '@github-tools/sdk'
150
+
151
+ const tools = createGithubTools({
152
+ token,
153
+ coAuthors: [
154
+ { name: 'my-bot[bot]', email: '12345+my-bot[bot]@users.noreply.github.com' }
155
+ ]
156
+ })
157
+ ```
158
+
159
+ This appends `Co-authored-by` trailers to commit messages, crediting additional contributors.
160
+
161
+ | Option | Type | Description |
162
+ |--------|------|-------------|
163
+ | `author` | `{ name: string, email: string }` | The person who wrote the code. Falls back to the authenticated user. |
164
+ | `committer` | `{ name: string, email: string }` | The person who applied the commit. Falls back to the authenticated user. |
165
+ | `coAuthors` | `{ name: string, email: string }[]` | Additional contributors added as `Co-authored-by` trailers. |
166
+
167
+ Commits made via the GitHub API are **automatically signed** by GitHub's web-flow key, passing branch protection rules that require signed commits.
168
+
144
169
  ## Tool Selection with toolpick
145
170
 
146
171
  With dozens of tools, context window usage adds up. [toolpick](https://github.com/pontusab/toolpick) selects only the most relevant tools per step so the model sees what it needs:
@@ -365,7 +390,9 @@ All other `ToolLoopAgent` options (`stopWhen`, `toolChoice`, `onStepFinish`, etc
365
390
 
366
391
  ### `createDurableGithubAgent(options)`
367
392
 
368
- Returns a `DurableAgent` instance for use inside Vercel Workflow SDK functions. Every LLM call and tool execution runs as a durable step with automatic retries and crash recovery.
393
+ Returns a `DurableGithubAgent` instance for use inside Vercel Workflow SDK functions. Every LLM call and tool execution runs as a durable step with automatic retries and crash recovery.
394
+
395
+ Supports both `.stream()` (real-time output to a writable) and `.generate()` (non-streaming, returns the full text response).
369
396
 
370
397
  Requires the optional peer dependencies `workflow` and `@workflow/ai`:
371
398
 
@@ -373,6 +400,8 @@ Requires the optional peer dependencies `workflow` and `@workflow/ai`:
373
400
  pnpm add workflow @workflow/ai
374
401
  ```
375
402
 
403
+ #### Streaming (chat UI)
404
+
376
405
  ```ts
377
406
  import { createDurableGithubAgent } from '@github-tools/sdk/workflow'
378
407
  import { getWritable } from 'workflow'
@@ -390,7 +419,26 @@ async function chatWorkflow(messages: ModelMessage[], token: string) {
390
419
  }
391
420
  ```
392
421
 
393
- All presets (`code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `maintainer`) work with `createDurableGithubAgent`. The options are the same as `createGithubAgent` except it returns a `DurableAgent` instead of a `ToolLoopAgent`.
422
+ #### Non-streaming (bot / background job — needs `"use step"`)
423
+
424
+ ```ts
425
+ import { createGithubAgent } from '@github-tools/sdk'
426
+
427
+ async function agentTurn(prompt: string) {
428
+ "use step"
429
+ const agent = createGithubAgent({
430
+ model: 'anthropic/claude-sonnet-4.6',
431
+ preset: 'code-review',
432
+ requireApproval: false,
433
+ })
434
+ const { text } = await agent.generate({ prompt })
435
+ return text
436
+ }
437
+ ```
438
+
439
+ > See [`examples/pr-review-agent`](../../examples/pr-review-agent) for a complete PR review agent built with Chat SDK and Vercel Workflow.
440
+
441
+ All presets (`code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `maintainer`) work with `createDurableGithubAgent`. Options mirror `createGithubAgent` with additional pass-through for `DurableAgentOptions` fields like `experimental_telemetry`, `onStepFinish`, `onFinish`, and `prepareStep`.
394
442
 
395
443
  > **Note:** `requireApproval` is accepted but currently ignored by `DurableAgent` — the Workflow SDK does not yet support interactive tool approval.
396
444