@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 +50 -2
- package/dist/index-ikP-LT-3.d.mts +1634 -0
- package/dist/index-ikP-LT-3.d.mts.map +1 -0
- package/dist/index.d.mts +2 -777
- package/dist/index.mjs +1 -219
- package/dist/{agents-D9aKsd_7.mjs → src--pAdGYqY.mjs} +335 -23
- package/dist/src--pAdGYqY.mjs.map +1 -0
- package/dist/workflow.d.mts +159 -55
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +105 -11
- package/dist/workflow.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/agents-C6nqZiYp.d.mts +0 -781
- package/dist/agents-C6nqZiYp.d.mts.map +0 -1
- package/dist/agents-D9aKsd_7.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
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 `
|
|
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
|
-
|
|
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
|
|