@github-tools/sdk 1.5.0 → 1.7.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.
@@ -1,8 +1,8 @@
1
- import { J as ToolOverrides, n as createGithubAgent, t as CreateGithubAgentOptions } from "./agents-C6nqZiYp.mjs";
2
- import { ApprovalConfig, GithubToolPreset, GithubTools, GithubToolsOptions, GithubWriteToolName, createGithubTools } from "./index.mjs";
3
- import * as ai from "ai";
4
- import { FinishReason, LanguageModelResponseMetadata, LanguageModelUsage, ModelMessage, StepResult, StopCondition, ToolSet } from "ai";
5
- import { CompatibleLanguageModel, DurableAgentOptions, DurableAgentStreamOptions, DurableAgentStreamResult } from "@workflow/ai/agent";
1
+ import { _ as PresetToolName, a as ApprovalConfig, d as ToolOverrides, f as GITHUB_WRITE_TOOLS, g as PRESET_TOOLS, h as GithubToolPreset, i as PickGithubTools, m as CombinedPresetToolNames, o as CommitIdentity, p as GithubWriteToolName, r as GithubToolsForPreset, s as CommitToolOptions, t as AllGithubTools, v as GITHUB_TOOL_NAMES, y as GithubToolName } from "./tool-types-CuirBEc8.mjs";
2
+ import { a as createGithubAgent, i as CreateGithubAgentOptions, n as GithubToolsOptions, r as createGithubTools, t as GithubTools } from "./index-BRUYe5q0.mjs";
3
+ import { FinishReason, LanguageModel, LanguageModelResponseMetadata, LanguageModelUsage, ModelMessage, StepResult, StopCondition, ToolSet } from "ai";
4
+ import { WorkflowAgentOptions, WorkflowAgentStreamOptions, WorkflowAgentStreamResult } from "@ai-sdk/workflow";
5
+ import { Context } from "@ai-sdk/provider-utils";
6
6
 
7
7
  //#region src/workflow.d.ts
8
8
  /**
@@ -18,11 +18,11 @@ interface DurableGithubAgentGenerateResult<TTools extends ToolSet = ToolSet> {
18
18
  };
19
19
  }
20
20
  /**
21
- * A wrapper around the Workflow SDK's `DurableAgent` that adds a non-streaming
21
+ * A wrapper around {@link WorkflowAgent} that adds a non-streaming
22
22
  * `.generate()` method alongside the existing `.stream()`.
23
23
  *
24
- * - `.stream()` — delegates to `DurableAgent.stream()`, each tool call is
25
- * an individually retriable workflow step. Works in workflow context.
24
+ * - `.stream()` — delegates to `WorkflowAgent.stream()`. Each tool call is
25
+ * an individually retriable workflow step. Supports `needsApproval` on tools.
26
26
  * - `.generate()` — uses `generateText` from the AI SDK for non-streaming
27
27
  * execution. Must be called from within a `"use step"` function in
28
28
  * workflow context (the Workflow runtime blocks raw I/O in workflow scope).
@@ -33,33 +33,20 @@ declare class DurableGithubAgent<TTools extends ToolSet = ToolSet> {
33
33
  private _instructions?;
34
34
  private _telemetry?;
35
35
  private _tools;
36
- constructor(options: DurableAgentOptions<TTools>);
36
+ constructor(options: WorkflowAgentOptions<TTools>);
37
37
  /** The tool set configured for this agent. */
38
38
  get tools(): TTools;
39
39
  /**
40
- * Stream the agent's response. Delegates directly to `DurableAgent.stream()`.
40
+ * Stream the agent's response. Delegates directly to `WorkflowAgent.stream()`.
41
41
  * Works in workflow context — each tool call is a durable step.
42
42
  */
43
- stream<TStreamTools extends TTools = TTools, OUTPUT = never, PARTIAL_OUTPUT = never>(options: DurableAgentStreamOptions<TStreamTools, OUTPUT, PARTIAL_OUTPUT>): Promise<DurableAgentStreamResult<TStreamTools, OUTPUT>>;
43
+ stream<TStreamTools extends TTools = TTools, OUTPUT = never, PARTIAL_OUTPUT = never>(options: WorkflowAgentStreamOptions<TStreamTools, Context, OUTPUT, PARTIAL_OUTPUT>): Promise<WorkflowAgentStreamResult<TStreamTools, OUTPUT>>;
44
44
  /**
45
45
  * Generate a non-streaming response using `generateText` from the AI SDK.
46
46
  *
47
47
  * In workflow context this **must** be called from within a `"use step"`
48
48
  * function, because the Workflow runtime blocks direct I/O (HTTP calls)
49
49
  * at the workflow scope level.
50
- *
51
- * @example
52
- * ```ts
53
- * async function agentTurn(prompt: string) {
54
- * "use step"
55
- * const agent = createDurableGithubAgent({
56
- * model: 'anthropic/claude-sonnet-4.6',
57
- * preset: 'code-review',
58
- * })
59
- * const { text } = await agent.generate({ prompt })
60
- * return text
61
- * }
62
- * ```
63
50
  */
64
51
  generate({
65
52
  prompt,
@@ -72,39 +59,74 @@ declare class DurableGithubAgent<TTools extends ToolSet = ToolSet> {
72
59
  /**
73
60
  * Options for creating a durable GitHub agent via {@link createDurableGithubAgent}.
74
61
  *
75
- * Extends all `DurableAgentOptions` (temperature, telemetry, callbacks, etc.)
62
+ * Extends all `WorkflowAgentOptions` (temperature, telemetry, callbacks, etc.)
76
63
  * and adds GitHub-specific fields (token, preset, approval config).
77
64
  */
78
- type CreateDurableGithubAgentOptions = Omit<DurableAgentOptions, 'model' | 'tools' | 'instructions'> & {
79
- model: string | CompatibleLanguageModel | (() => Promise<CompatibleLanguageModel>);
65
+ type CreateDurableGithubAgentOptions = Omit<WorkflowAgentOptions, 'model' | 'tools' | 'instructions'> & {
66
+ model: string | LanguageModel;
80
67
  /**
81
68
  * GitHub personal access token.
82
69
  * Falls back to `process.env.GITHUB_TOKEN` when omitted.
83
70
  */
84
71
  token?: string;
72
+ /**
73
+ * Restrict tools and system prompt to a predefined preset.
74
+ *
75
+ * Selects a subset of tools and, when a single preset is passed,
76
+ * sets a matching system prompt. Combine presets with an array to merge tool sets.
77
+ *
78
+ * @see {@link GithubToolPreset} for available presets and included tools.
79
+ */
85
80
  preset?: GithubToolPreset | GithubToolPreset[];
81
+ /**
82
+ * Control whether write operations require user approval before execution.
83
+ *
84
+ * @see {@link ApprovalConfig} for global and per-tool options.
85
+ */
86
86
  requireApproval?: ApprovalConfig;
87
+ /**
88
+ * Fully replace the default system prompt.
89
+ * When set, `preset` system prompts and `additionalInstructions` are ignored.
90
+ */
87
91
  instructions?: string;
92
+ /**
93
+ * Append text to the preset-specific (or default) system prompt.
94
+ * Ignored when `instructions` is set.
95
+ */
88
96
  additionalInstructions?: string;
97
+ /**
98
+ * Default author for commit-creating tools.
99
+ * Falls back to the authenticated user when omitted.
100
+ */
101
+ author?: CommitIdentity;
102
+ /**
103
+ * Default committer for commit-creating tools.
104
+ * Falls back to the authenticated user when omitted.
105
+ */
106
+ committer?: CommitIdentity;
107
+ /**
108
+ * Co-authors to attribute on all commits.
109
+ * Added as "Co-authored-by" trailers to commit messages.
110
+ */
111
+ coAuthors?: CommitIdentity[];
89
112
  };
90
113
  /**
91
- * Create a pre-configured durable GitHub agent powered by Vercel Workflow SDK's `DurableAgent`.
114
+ * Create a pre-configured durable GitHub agent powered by `WorkflowAgent`
115
+ * from `@ai-sdk/workflow`.
92
116
  *
93
117
  * Returns a {@link DurableGithubAgent} with two interaction modes:
94
118
  *
95
119
  * - `.stream()` — works directly in workflow scope; each tool call is a durable step.
120
+ * Write tools honor `requireApproval` via `needsApproval` and pause the workflow
121
+ * until the user approves or denies.
96
122
  * - `.generate()` — uses `generateText` from the AI SDK; must be called from
97
123
  * within a `"use step"` function when running inside a workflow.
98
124
  *
99
- * **Note:** `requireApproval` is accepted for forward-compatibility but is currently
100
- * ignored by `DurableAgent` — the Workflow SDK does not yet support interactive tool
101
- * approval. All tools execute immediately without user confirmation.
102
- *
103
125
  * @example Streaming (chat UI — works in workflow scope)
104
126
  * ```ts
105
127
  * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'
106
128
  * import { getWritable } from 'workflow'
107
- * import type { ModelMessage, UIMessageChunk } from 'ai'
129
+ * import type { ModelMessage, ModelCallStreamPart } from 'ai'
108
130
  *
109
131
  * async function chatWorkflow(messages: ModelMessage[], token: string) {
110
132
  * "use workflow"
@@ -113,702 +135,20 @@ type CreateDurableGithubAgentOptions = Omit<DurableAgentOptions, 'model' | 'tool
113
135
  * token,
114
136
  * preset: 'code-review',
115
137
  * })
116
- * const writable = getWritable<UIMessageChunk>()
138
+ * const writable = getWritable<ModelCallStreamPart>()
117
139
  * await agent.stream({ messages, writable })
118
140
  * }
119
141
  * ```
120
- *
121
- * @example Non-streaming (bot / background job — needs "use step")
122
- * ```ts
123
- * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'
124
- *
125
- * async function agentTurn(prompt: string) {
126
- * "use step"
127
- * const agent = createDurableGithubAgent({
128
- * model: 'anthropic/claude-sonnet-4.6',
129
- * preset: 'code-review',
130
- * })
131
- * const { text } = await agent.generate({ prompt })
132
- * return text
133
- * }
134
- * ```
135
142
  */
136
- declare function createDurableGithubAgent({
137
- model,
138
- token,
139
- preset,
140
- requireApproval,
141
- instructions,
142
- additionalInstructions,
143
- ...agentOptions
144
- }: CreateDurableGithubAgentOptions): DurableGithubAgent<Partial<{
145
- getRepository: ai.Tool<{
146
- owner: string;
147
- repo: string;
148
- }, {
149
- name: string;
150
- fullName: string;
151
- description: string | null;
152
- url: string;
153
- defaultBranch: string;
154
- stars: number;
155
- forks: number;
156
- openIssues: number;
157
- language: string | null;
158
- private: boolean;
159
- createdAt: string;
160
- updatedAt: string;
161
- }>;
162
- listBranches: ai.Tool<{
163
- owner: string;
164
- repo: string;
165
- perPage: number;
166
- }, {
167
- name: string;
168
- sha: string;
169
- protected: boolean;
170
- }[]>;
171
- getFileContent: ai.Tool<{
172
- owner: string;
173
- repo: string;
174
- path: string;
175
- ref?: string | undefined;
176
- }, {
177
- type: string;
178
- entries: {
179
- name: string;
180
- type: "file" | "dir" | "submodule" | "symlink";
181
- path: string;
182
- }[];
183
- path?: undefined;
184
- sha?: undefined;
185
- size?: undefined;
186
- content?: undefined;
187
- } | {
188
- type: "submodule" | "symlink";
189
- path: string;
190
- entries?: undefined;
191
- sha?: undefined;
192
- size?: undefined;
193
- content?: undefined;
194
- } | {
195
- type: string;
196
- path: string;
197
- sha: string;
198
- size: number;
199
- content: string;
200
- entries?: undefined;
201
- }>;
202
- listPullRequests: ai.Tool<{
203
- owner: string;
204
- repo: string;
205
- state: "open" | "closed" | "all";
206
- perPage: number;
207
- }, {
208
- number: number;
209
- title: string;
210
- state: string;
211
- url: string;
212
- author: string | undefined;
213
- branch: string;
214
- base: string;
215
- draft: boolean | undefined;
216
- createdAt: string;
217
- updatedAt: string;
218
- }[]>;
219
- getPullRequest: ai.Tool<{
220
- owner: string;
221
- repo: string;
222
- pullNumber: number;
223
- }, {
224
- number: number;
225
- title: string;
226
- body: string | null;
227
- state: "open" | "closed";
228
- url: string;
229
- author: string;
230
- branch: string;
231
- base: string;
232
- draft: boolean | undefined;
233
- merged: boolean;
234
- mergeable: boolean | null;
235
- additions: number;
236
- deletions: number;
237
- changedFiles: number;
238
- createdAt: string;
239
- updatedAt: string;
240
- mergedAt: string | null;
241
- }>;
242
- listIssues: ai.Tool<{
243
- owner: string;
244
- repo: string;
245
- state: "open" | "closed" | "all";
246
- perPage: number;
247
- labels?: string | undefined;
248
- }, {
249
- number: number;
250
- title: string;
251
- state: string;
252
- url: string;
253
- author: string | undefined;
254
- labels: (string | undefined)[];
255
- createdAt: string;
256
- updatedAt: string;
257
- }[]>;
258
- getIssue: ai.Tool<{
259
- owner: string;
260
- repo: string;
261
- issueNumber: number;
262
- }, {
263
- number: number;
264
- title: string;
265
- body: string | null | undefined;
266
- state: string;
267
- url: string;
268
- author: string | undefined;
269
- assignees: string[] | undefined;
270
- labels: (string | undefined)[];
271
- comments: number;
272
- createdAt: string;
273
- updatedAt: string;
274
- closedAt: string | null;
275
- }>;
276
- searchCode: ai.Tool<{
277
- query: string;
278
- perPage: number;
279
- }, {
280
- totalCount: number;
281
- items: {
282
- name: string;
283
- path: string;
284
- url: string;
285
- repository: string;
286
- sha: string;
287
- }[];
288
- }>;
289
- searchRepositories: ai.Tool<{
290
- query: string;
291
- perPage: number;
292
- order: "asc" | "desc";
293
- sort?: "stars" | "forks" | "help-wanted-issues" | "updated" | undefined;
294
- }, {
295
- totalCount: number;
296
- items: {
297
- name: string;
298
- fullName: string;
299
- description: string | null;
300
- url: string;
301
- stars: number;
302
- forks: number;
303
- language: string | null;
304
- topics: string[] | undefined;
305
- }[];
306
- }>;
307
- listCommits: ai.Tool<{
308
- owner: string;
309
- repo: string;
310
- perPage: number;
311
- path?: string | undefined;
312
- sha?: string | undefined;
313
- author?: string | undefined;
314
- since?: string | undefined;
315
- until?: string | undefined;
316
- }, {
317
- sha: string;
318
- message: string;
319
- author: string | undefined;
320
- authorLogin: string | undefined;
321
- date: string | undefined;
322
- url: string;
323
- }[]>;
324
- getCommit: ai.Tool<{
325
- owner: string;
326
- repo: string;
327
- ref: string;
328
- }, {
329
- sha: string;
330
- message: string;
331
- author: string | undefined;
332
- authorLogin: string | undefined;
333
- date: string | undefined;
334
- url: string;
335
- stats: {
336
- additions: number | undefined;
337
- deletions: number | undefined;
338
- total: number | undefined;
339
- } | null;
340
- files: {
341
- filename: string;
342
- status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
343
- additions: number;
344
- deletions: number;
345
- patch: string | undefined;
346
- }[] | undefined;
347
- }>;
348
- getBlame: ai.Tool<{
349
- owner: string;
350
- repo: string;
351
- path: string;
352
- ref?: string | undefined;
353
- line?: number | undefined;
354
- lineStart?: number | undefined;
355
- lineEnd?: number | undefined;
356
- }, {
357
- error: string;
358
- ref?: undefined;
359
- tipSha?: undefined;
360
- path?: undefined;
361
- rangeCount?: undefined;
362
- ranges?: undefined;
363
- } | {
364
- ref: string;
365
- tipSha: string;
366
- path: string;
367
- rangeCount: number;
368
- ranges: {
369
- startingLine: number;
370
- endingLine: number;
371
- age: number;
372
- commit: {
373
- sha: string;
374
- abbreviatedSha: string;
375
- messageHeadline: string;
376
- authoredDate: string;
377
- url: string;
378
- authorName: string | null;
379
- authorEmail: string | null;
380
- authorLogin: string | null;
381
- };
382
- }[];
383
- error?: undefined;
384
- }>;
385
- createBranch: ai.Tool<{
386
- owner: string;
387
- repo: string;
388
- branch: string;
389
- from?: string | undefined;
390
- }, {
391
- ref: string;
392
- sha: string;
393
- url: string;
394
- }>;
395
- forkRepository: ai.Tool<{
396
- owner: string;
397
- repo: string;
398
- organization?: string | undefined;
399
- name?: string | undefined;
400
- }, {
401
- name: string;
402
- fullName: string;
403
- url: string;
404
- cloneUrl: string;
405
- sshUrl: string;
406
- defaultBranch: string;
407
- private: boolean;
408
- parent: {
409
- fullName: string;
410
- url: string;
411
- } | null;
412
- }>;
413
- createRepository: ai.Tool<{
414
- name: string;
415
- isPrivate: boolean;
416
- autoInit: boolean;
417
- description?: string | undefined;
418
- gitignoreTemplate?: string | undefined;
419
- licenseTemplate?: string | undefined;
420
- org?: string | undefined;
421
- }, {
422
- name: string;
423
- fullName: string;
424
- description: string | null;
425
- url: string;
426
- cloneUrl: string;
427
- sshUrl: string;
428
- defaultBranch: string;
429
- private: boolean;
430
- createdAt: string;
431
- }>;
432
- createOrUpdateFile: ai.Tool<{
433
- owner: string;
434
- repo: string;
435
- path: string;
436
- message: string;
437
- content: string;
438
- branch?: string | undefined;
439
- sha?: string | undefined;
440
- }, {
441
- path: string | undefined;
442
- sha: string | undefined;
443
- commitSha: string | undefined;
444
- commitUrl: string | undefined;
445
- }>;
446
- createPullRequest: ai.Tool<{
447
- owner: string;
448
- repo: string;
449
- title: string;
450
- head: string;
451
- base: string;
452
- draft: boolean;
453
- body?: string | undefined;
454
- }, {
455
- number: number;
456
- title: string;
457
- url: string;
458
- state: "open" | "closed";
459
- draft: boolean | undefined;
460
- branch: string;
461
- base: string;
462
- }>;
463
- mergePullRequest: ai.Tool<{
464
- owner: string;
465
- repo: string;
466
- pullNumber: number;
467
- mergeMethod: "merge" | "squash" | "rebase";
468
- commitTitle?: string | undefined;
469
- commitMessage?: string | undefined;
470
- }, {
471
- merged: boolean;
472
- message: string;
473
- sha: string;
474
- }>;
475
- addPullRequestComment: ai.Tool<{
476
- owner: string;
477
- repo: string;
478
- pullNumber: number;
479
- body: string;
480
- }, {
481
- id: number;
482
- url: string;
483
- body: string | undefined;
484
- author: string | undefined;
485
- createdAt: string;
486
- }>;
487
- listPullRequestFiles: ai.Tool<{
488
- owner: string;
489
- repo: string;
490
- pullNumber: number;
491
- perPage: number;
492
- page: number;
493
- }, {
494
- filename: string;
495
- status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
496
- additions: number;
497
- deletions: number;
498
- changes: number;
499
- patch: string | undefined;
500
- }[]>;
501
- listPullRequestReviews: ai.Tool<{
502
- owner: string;
503
- repo: string;
504
- pullNumber: number;
505
- perPage: number;
506
- page: number;
507
- }, {
508
- id: number;
509
- state: string;
510
- body: string;
511
- author: string | undefined;
512
- url: string;
513
- submittedAt: string | undefined;
514
- }[]>;
515
- createPullRequestReview: ai.Tool<{
516
- owner: string;
517
- repo: string;
518
- pullNumber: number;
519
- event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT";
520
- body?: string | undefined;
521
- comments?: {
522
- path: string;
523
- body: string;
524
- line?: number | undefined;
525
- side?: "LEFT" | "RIGHT" | undefined;
526
- }[] | undefined;
527
- }, {
528
- id: number;
529
- state: string;
530
- body: string;
531
- url: string;
532
- author: string | undefined;
533
- submittedAt: string | undefined;
534
- }>;
535
- createIssue: ai.Tool<{
536
- owner: string;
537
- repo: string;
538
- title: string;
539
- body?: string | undefined;
540
- labels?: string[] | undefined;
541
- assignees?: string[] | undefined;
542
- }, {
543
- number: number;
544
- title: string;
545
- url: string;
546
- state: string;
547
- labels: (string | undefined)[];
548
- }>;
549
- addIssueComment: ai.Tool<{
550
- owner: string;
551
- repo: string;
552
- issueNumber: number;
553
- body: string;
554
- }, {
555
- id: number;
556
- url: string;
557
- body: string | undefined;
558
- author: string | undefined;
559
- createdAt: string;
560
- }>;
561
- closeIssue: ai.Tool<{
562
- owner: string;
563
- repo: string;
564
- issueNumber: number;
565
- stateReason: "completed" | "not_planned";
566
- }, {
567
- number: number;
568
- title: string;
569
- state: string;
570
- url: string;
571
- closedAt: string | null;
572
- }>;
573
- listLabels: ai.Tool<{
574
- owner: string;
575
- repo: string;
576
- perPage: number;
577
- page: number;
578
- }, {
579
- name: string;
580
- color: string;
581
- description: string | null;
582
- }[]>;
583
- addLabels: ai.Tool<{
584
- owner: string;
585
- repo: string;
586
- issueNumber: number;
587
- labels: string[];
588
- }, {
589
- name: string;
590
- color: string;
591
- description: string | null;
592
- }[]>;
593
- removeLabel: ai.Tool<{
594
- owner: string;
595
- repo: string;
596
- issueNumber: number;
597
- label: string;
598
- }, {
599
- removed: boolean;
600
- label: string;
601
- issueNumber: number;
602
- }>;
603
- listGists: ai.Tool<{
604
- perPage: number;
605
- page: number;
606
- username?: string | undefined;
607
- }, {
608
- id: string;
609
- description: string | null;
610
- public: boolean;
611
- url: string;
612
- files: string[];
613
- owner: string | undefined;
614
- comments: number;
615
- createdAt: string;
616
- updatedAt: string;
617
- }[]>;
618
- getGist: ai.Tool<{
619
- gistId: string;
620
- }, {
621
- id: string | undefined;
622
- description: string | null | undefined;
623
- public: boolean | undefined;
624
- url: string | undefined;
625
- owner: string | undefined;
626
- files: {
627
- filename: string | undefined;
628
- language: string | undefined;
629
- size: number | undefined;
630
- content: string | undefined;
631
- }[];
632
- comments: number | undefined;
633
- createdAt: string | undefined;
634
- updatedAt: string | undefined;
635
- }>;
636
- listGistComments: ai.Tool<{
637
- gistId: string;
638
- perPage: number;
639
- page: number;
640
- }, {
641
- id: number;
642
- body: string;
643
- author: string | undefined;
644
- url: string;
645
- createdAt: string;
646
- updatedAt: string;
647
- }[]>;
648
- createGist: ai.Tool<{
649
- files: Record<string, {
650
- content: string;
651
- }>;
652
- isPublic: boolean;
653
- description?: string | undefined;
654
- }, {
655
- id: string | undefined;
656
- description: string | null | undefined;
657
- public: boolean | undefined;
658
- url: string | undefined;
659
- files: string[];
660
- owner: string | undefined;
661
- }>;
662
- updateGist: ai.Tool<{
663
- gistId: string;
664
- description?: string | undefined;
665
- files?: Record<string, {
666
- content: string;
667
- }> | undefined;
668
- filesToDelete?: string[] | undefined;
669
- }, {
670
- id: string | undefined;
671
- description: string | null | undefined;
672
- url: string | undefined;
673
- files: string[];
674
- }>;
675
- deleteGist: ai.Tool<{
676
- gistId: string;
677
- }, {
678
- deleted: boolean;
679
- gistId: string;
680
- }>;
681
- createGistComment: ai.Tool<{
682
- gistId: string;
683
- body: string;
684
- }, {
685
- id: number;
686
- url: string;
687
- body: string;
688
- author: string | undefined;
689
- createdAt: string;
690
- }>;
691
- listWorkflows: ai.Tool<{
692
- owner: string;
693
- repo: string;
694
- perPage: number;
695
- page: number;
696
- }, {
697
- totalCount: number;
698
- workflows: {
699
- id: number;
700
- name: string;
701
- path: string;
702
- state: "active" | "deleted" | "disabled_fork" | "disabled_inactivity" | "disabled_manually";
703
- url: string;
704
- createdAt: string;
705
- updatedAt: string;
706
- }[];
707
- }>;
708
- listWorkflowRuns: ai.Tool<{
709
- owner: string;
710
- repo: string;
711
- perPage: number;
712
- page: number;
713
- workflowId?: string | number | undefined;
714
- branch?: string | undefined;
715
- event?: string | undefined;
716
- status?: "success" | "completed" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "timed_out" | "in_progress" | "queued" | "requested" | "waiting" | "pending" | undefined;
717
- }, {
718
- totalCount: number;
719
- runs: {
720
- id: number;
721
- name: string | null | undefined;
722
- status: string | null;
723
- conclusion: string | null;
724
- branch: string | null;
725
- event: string;
726
- url: string;
727
- actor: string | undefined;
728
- createdAt: string;
729
- updatedAt: string;
730
- runNumber: number;
731
- runAttempt: number | undefined;
732
- }[];
733
- }>;
734
- getWorkflowRun: ai.Tool<{
735
- owner: string;
736
- repo: string;
737
- runId: number;
738
- }, {
739
- id: number;
740
- name: string | null | undefined;
741
- status: string | null;
742
- conclusion: string | null;
743
- branch: string | null;
744
- sha: string;
745
- event: string;
746
- url: string;
747
- actor: string | undefined;
748
- runNumber: number;
749
- runAttempt: number | undefined;
750
- createdAt: string;
751
- updatedAt: string;
752
- runStartedAt: string | undefined;
753
- }>;
754
- listWorkflowJobs: ai.Tool<{
755
- owner: string;
756
- repo: string;
757
- runId: number;
758
- filter: "all" | "latest";
759
- perPage: number;
760
- page: number;
761
- }, {
762
- totalCount: number;
763
- jobs: {
764
- id: number;
765
- name: string;
766
- status: "completed" | "in_progress" | "queued" | "requested" | "waiting" | "pending";
767
- conclusion: "success" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "timed_out" | null;
768
- url: string | null;
769
- startedAt: string;
770
- completedAt: string | null;
771
- runnerName: string | null;
772
- steps: {
773
- name: string;
774
- status: "completed" | "in_progress" | "queued";
775
- conclusion: string | null;
776
- number: number;
777
- startedAt: string | null | undefined;
778
- completedAt: string | null | undefined;
779
- }[] | undefined;
780
- }[];
781
- }>;
782
- triggerWorkflow: ai.Tool<{
783
- owner: string;
784
- repo: string;
785
- workflowId: string | number;
786
- ref: string;
787
- inputs?: Record<string, string> | undefined;
788
- }, {
789
- triggered: boolean;
790
- workflowId: string | number;
791
- ref: string;
792
- }>;
793
- cancelWorkflowRun: ai.Tool<{
794
- owner: string;
795
- repo: string;
796
- runId: number;
797
- }, {
798
- cancelled: boolean;
799
- runId: number;
800
- }>;
801
- rerunWorkflowRun: ai.Tool<{
802
- owner: string;
803
- repo: string;
804
- runId: number;
805
- onlyFailedJobs: boolean;
806
- }, {
807
- rerun: boolean;
808
- runId: number;
809
- onlyFailedJobs: boolean;
810
- }>;
811
- }>>;
143
+ declare function createDurableGithubAgent(options: CreateDurableGithubAgentOptions & {
144
+ preset?: undefined;
145
+ }): DurableGithubAgent<AllGithubTools>;
146
+ declare function createDurableGithubAgent<P extends GithubToolPreset>(options: CreateDurableGithubAgentOptions & {
147
+ preset: P;
148
+ }): DurableGithubAgent<Pick<AllGithubTools, PresetToolName<P>>>;
149
+ declare function createDurableGithubAgent<P extends readonly GithubToolPreset[]>(options: CreateDurableGithubAgentOptions & {
150
+ preset: P;
151
+ }): DurableGithubAgent<Pick<AllGithubTools, CombinedPresetToolNames<P>>>;
812
152
  //#endregion
813
- export { type ApprovalConfig, CreateDurableGithubAgentOptions, type CreateGithubAgentOptions, DurableGithubAgent, DurableGithubAgentGenerateResult, type GithubToolPreset, type GithubTools, type GithubToolsOptions, type GithubWriteToolName, type ToolOverrides, createDurableGithubAgent, createGithubAgent, createGithubTools };
153
+ export { type AllGithubTools, type ApprovalConfig, type CombinedPresetToolNames, type CommitIdentity, type CommitToolOptions, CreateDurableGithubAgentOptions, type CreateGithubAgentOptions, DurableGithubAgent, DurableGithubAgentGenerateResult, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, type GithubToolName, type GithubToolPreset, type GithubTools, type GithubToolsForPreset, type GithubToolsOptions, type GithubWriteToolName, PRESET_TOOLS, type PickGithubTools, type PresetToolName, type ToolOverrides, createDurableGithubAgent, createGithubAgent, createGithubTools };
814
154
  //# sourceMappingURL=workflow.d.mts.map